@aehrc/smart-forms-renderer 1.0.0-alpha.23 → 1.0.0-alpha.24
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.d.ts +1 -0
- package/lib/components/FormComponents/AttachmentItem/AttachmentField.js +4 -2
- package/lib/components/FormComponents/AttachmentItem/AttachmentField.js.map +1 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.d.ts +1 -0
- package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js +3 -3
- package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js.map +1 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentItem.d.ts +2 -2
- package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js +6 -3
- package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js.map +1 -1
- package/lib/components/FormComponents/BooleanItem/BooleanField.js +2 -3
- package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
- package/lib/components/FormComponents/BooleanItem/BooleanItem.d.ts +2 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js +2 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +7 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +6 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +7 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +6 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +7 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +8 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +2 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +2 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +8 -5
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +7 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.d.ts +2 -2
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.d.ts +2 -2
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.d.ts +2 -2
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +3 -3
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerItem.d.ts +2 -2
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js +2 -2
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/Item.styles.d.ts +4 -0
- package/lib/components/FormComponents/Item.styles.js +6 -0
- package/lib/components/FormComponents/Item.styles.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +7 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +7 -5
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +6 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.d.ts +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.js +7 -5
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js +6 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +8 -8
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +7 -5
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +5 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.d.ts +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.js +7 -5
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.js +5 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +7 -4
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +13 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +19 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +6 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +4 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +6 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityItem.d.ts +2 -2
- package/lib/components/FormComponents/QuantityItem/QuantityItem.js +2 -2
- package/lib/components/FormComponents/QuantityItem/QuantityItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItem.js +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +17 -17
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItemView.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItemView.js +4 -4
- package/lib/components/FormComponents/SingleItem/SingleItemView.js.map +1 -1
- package/lib/components/FormComponents/SliderItem/SliderField.d.ts +1 -0
- package/lib/components/FormComponents/SliderItem/SliderField.js +12 -9
- package/lib/components/FormComponents/SliderItem/SliderField.js.map +1 -1
- package/lib/components/FormComponents/SliderItem/SliderItem.d.ts +2 -2
- package/lib/components/FormComponents/SliderItem/SliderItem.js +7 -4
- package/lib/components/FormComponents/SliderItem/SliderItem.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringItem.d.ts +2 -2
- package/lib/components/FormComponents/StringItem/StringItem.js +2 -2
- package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextItem.d.ts +2 -2
- package/lib/components/FormComponents/TextItem/TextItem.js +2 -2
- package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
- package/lib/components/FormComponents/TimeItem/TimeItem.d.ts +2 -2
- package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
- package/lib/components/FormComponents/UrlItem/UrlItem.d.ts +2 -2
- package/lib/components/FormComponents/UrlItem/UrlItem.js +2 -2
- package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
- package/lib/hooks/useValidationFeedback.d.ts +1 -1
- package/lib/hooks/useValidationFeedback.js +5 -1
- package/lib/hooks/useValidationFeedback.js.map +1 -1
- package/lib/interfaces/overrideComponent.interface.d.ts +1 -0
- package/lib/interfaces/renderProps.interface.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/FormComponents/AttachmentItem/AttachmentField.tsx +5 -0
- package/src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx +4 -0
- package/src/components/FormComponents/AttachmentItem/AttachmentItem.tsx +19 -4
- package/src/components/FormComponents/BooleanItem/BooleanField.tsx +2 -5
- package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +13 -3
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +17 -9
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +15 -10
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +12 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +15 -10
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +12 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +11 -1
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +3 -5
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +5 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +2 -6
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +5 -3
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +3 -3
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +5 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +41 -34
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +12 -3
- package/src/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.tsx +3 -1
- package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx +3 -1
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +6 -3
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +5 -2
- package/src/components/FormComponents/Item.styles.ts +7 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +17 -9
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +24 -18
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +11 -1
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.tsx +24 -18
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.tsx +11 -1
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +11 -1
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +26 -20
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +10 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.tsx +26 -20
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.tsx +10 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +48 -33
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +10 -1
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +5 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +10 -1
- package/src/components/FormComponents/QuantityItem/QuantityItem.tsx +5 -2
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +5 -1
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +20 -1
- package/src/components/FormComponents/SingleItem/SingleItemView.tsx +7 -1
- package/src/components/FormComponents/SliderItem/SliderField.tsx +28 -21
- package/src/components/FormComponents/SliderItem/SliderItem.tsx +20 -3
- package/src/components/FormComponents/StringItem/StringItem.tsx +5 -2
- package/src/components/FormComponents/TextItem/TextItem.tsx +13 -4
- package/src/components/FormComponents/TimeItem/TimeItem.tsx +3 -1
- package/src/components/FormComponents/UrlItem/UrlItem.tsx +5 -2
- package/src/hooks/useValidationFeedback.ts +10 -1
- package/src/interfaces/overrideComponent.interface.ts +1 -0
- package/src/interfaces/renderProps.interface.ts +4 -0
|
@@ -4,6 +4,7 @@ import type { AttachmentValues } from './AttachmentItem';
|
|
|
4
4
|
interface AttachmentFieldProps extends PropsWithIsTabledAttribute {
|
|
5
5
|
linkId: string;
|
|
6
6
|
attachmentValues: AttachmentValues;
|
|
7
|
+
feedback: string;
|
|
7
8
|
readOnly: boolean;
|
|
8
9
|
onUploadFile: (file: File | null) => void;
|
|
9
10
|
onUrlChange: (url: string) => void;
|
|
@@ -22,8 +22,9 @@ import Box from '@mui/material/Box';
|
|
|
22
22
|
import Stack from '@mui/material/Stack';
|
|
23
23
|
import AttachmentUrlField from './AttachmentUrlField';
|
|
24
24
|
import { useRendererStylingStore } from '../../../stores';
|
|
25
|
+
import { StyledRequiredTypography } from '../Item.styles';
|
|
25
26
|
function AttachmentField(props) {
|
|
26
|
-
const { linkId, attachmentValues, readOnly, isTabled, onUploadFile, onUrlChange, onFileNameChange } = props;
|
|
27
|
+
const { linkId, attachmentValues, feedback, readOnly, isTabled, onUploadFile, onUrlChange, onFileNameChange } = props;
|
|
27
28
|
const textFieldWidth = useRendererStylingStore.use.textFieldWidth();
|
|
28
29
|
const { uploadedFile, url, fileName } = attachmentValues;
|
|
29
30
|
return (React.createElement(React.Fragment, null,
|
|
@@ -35,7 +36,8 @@ function AttachmentField(props) {
|
|
|
35
36
|
React.createElement(Box, null,
|
|
36
37
|
React.createElement(Typography, { variant: "body2", color: readOnly ? 'text.disabled' : 'text.primary' }, "File name (optional)"),
|
|
37
38
|
React.createElement(StandardTextField, { fullWidth: true, textFieldWidth: textFieldWidth, isTabled: isTabled, id: linkId, value: fileName, onChange: (event) => onFileNameChange(event.target.value), disabled: readOnly, size: "small", "data-test": "q-item-attachment-field" })),
|
|
38
|
-
uploadedFile && url ? (React.createElement(Typography, { variant: "subtitle2", color: readOnly ? 'text.disabled' : 'text.primary' }, "Ensure that the attached file and URL has the same content.")) : null)
|
|
39
|
+
uploadedFile && url ? (React.createElement(Typography, { variant: "subtitle2", color: readOnly ? 'text.disabled' : 'text.primary' }, "Ensure that the attached file and URL has the same content.")) : null),
|
|
40
|
+
feedback ? React.createElement(StyledRequiredTypography, null, feedback) : null));
|
|
39
41
|
}
|
|
40
42
|
export default AttachmentField;
|
|
41
43
|
//# sourceMappingURL=AttachmentField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAY1D,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EACJ,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,gBAAgB,EACjB,GAAG,KAAK,CAAC;IAEV,MAAM,cAAc,GAAG,uBAAuB,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IAEpE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;IAEzD,OAAO,CACL;QACE,oBAAC,KAAK,IAAC,MAAM,EAAE,CAAC;YACd,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,+DAErE;YACb,oBAA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em: QuestionnaireItem;
|
|
7
7
|
attachmentValues: AttachmentValues;
|
|
8
|
+
feedback: string;
|
|
8
9
|
readOnly: boolean;
|
|
9
10
|
onUploadFile: (file: File | null) => void;
|
|
10
11
|
onUrlChange: (url: string) => void;
|
|
@@ -21,13 +21,13 @@ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
|
21
21
|
import { useQuestionnaireStore } from '../../../stores';
|
|
22
22
|
import { ItemLabelWrapper } from '../ItemParts';
|
|
23
23
|
function AttachmentFieldWrapper(props) {
|
|
24
|
-
const { qItem, attachmentValues, readOnly, isRepeated, isTabled, onUploadFile, onUrlChange, onFileNameChange } = props;
|
|
24
|
+
const { qItem, attachmentValues, feedback, readOnly, isRepeated, isTabled, onUploadFile, onUrlChange, onFileNameChange } = props;
|
|
25
25
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
26
26
|
if (isRepeated) {
|
|
27
|
-
return (React.createElement(AttachmentField, { linkId: qItem.linkId, attachmentValues: attachmentValues, readOnly: readOnly, isTabled: isTabled, onUploadFile: onUploadFile, onUrlChange: onUrlChange, onFileNameChange: onFileNameChange }));
|
|
27
|
+
return (React.createElement(AttachmentField, { linkId: qItem.linkId, attachmentValues: attachmentValues, feedback: feedback, readOnly: readOnly, isTabled: isTabled, onUploadFile: onUploadFile, onUrlChange: onUrlChange, onFileNameChange: onFileNameChange }));
|
|
28
28
|
}
|
|
29
29
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-attachment-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
30
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(AttachmentField, { linkId: qItem.linkId, attachmentValues: attachmentValues, readOnly: readOnly, isTabled: isTabled, onUploadFile: onUploadFile, onUrlChange: onUrlChange, onFileNameChange: onFileNameChange }) })));
|
|
30
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(AttachmentField, { linkId: qItem.linkId, attachmentValues: attachmentValues, feedback: feedback, readOnly: readOnly, isTabled: isTabled, onUploadFile: onUploadFile, onUrlChange: onUrlChange, onFileNameChange: onFileNameChange }) })));
|
|
31
31
|
}
|
|
32
32
|
export default AttachmentFieldWrapper;
|
|
33
33
|
//# sourceMappingURL=AttachmentFieldWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentFieldWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAOvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentFieldWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAOvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAchD,SAAS,sBAAsB,CAAC,K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epeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithFeedbackFromParentAttribute, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
4
|
export interface AttachmentValues {
|
|
5
5
|
uploadedFile: File | null;
|
|
6
6
|
url: string;
|
|
7
7
|
fileName: string;
|
|
8
8
|
}
|
|
9
|
-
interface AttachmentItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
9
|
+
interface AttachmentItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithFeedbackFromParentAttribute {
|
|
10
10
|
qItem: QuestionnaireItem;
|
|
11
11
|
qrItem: QuestionnaireResponseItem | null;
|
|
12
12
|
}
|
|
@@ -32,10 +32,10 @@ import AttachmentFieldWrapper from './AttachmentFieldWrapper';
|
|
|
32
32
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
33
33
|
import { DndProvider } from 'react-dnd';
|
|
34
34
|
import { createAttachmentAnswer } from '../../../utils/fileUtils';
|
|
35
|
+
import useValidationFeedback from '../../../hooks/useValidationFeedback';
|
|
35
36
|
function AttachmentItem(props) {
|
|
36
37
|
var _a;
|
|
37
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
38
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
38
|
+
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, feedbackFromParent, onQrItemChange } = props;
|
|
39
39
|
// Init input value
|
|
40
40
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
41
41
|
let valueString = '';
|
|
@@ -45,6 +45,9 @@ function AttachmentItem(props) {
|
|
|
45
45
|
const [uploadedFile, setUploadedFile] = useState(null);
|
|
46
46
|
const [url, setUrl] = useState(valueString);
|
|
47
47
|
const [fileName, setFileName] = useState(valueString);
|
|
48
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
49
|
+
// Perform validation checks
|
|
50
|
+
const feedback = useValidationFeedback(qItem, feedbackFromParent, '');
|
|
48
51
|
// Event handlers
|
|
49
52
|
function handleUploadFile(newUploadedFile) {
|
|
50
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -81,7 +84,7 @@ function AttachmentItem(props) {
|
|
|
81
84
|
}
|
|
82
85
|
}), DEBOUNCE_DURATION), [onQrItemChange, qItem]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
|
|
83
86
|
return (React.createElement(DndProvider, { backend: HTML5Backend, context: window },
|
|
84
|
-
React.createElement(AttachmentFieldWrapper, { qItem: qItem, attachmentValues: { uploadedFile: uploadedFile, url: url, fileName: fileName }, readOnly: readOnly, isRepeated: isRepeated, isTabled: isTabled, onUploadFile: handleUploadFile, onUrlChange: handleUrlChange, onFileNameChange: handleFileNameChange })));
|
|
87
|
+
React.createElement(AttachmentFieldWrapper, { qItem: qItem, attachmentValues: { uploadedFile: uploadedFile, url: url, fileName: fileName }, feedback: feedback, readOnly: readOnly, isRepeated: isRepeated, isTabled: isTabled, onUploadFile: handleUploadFile, onUrlChange: handleUrlChange, onFileNameChange: handleFileNameChange })));
|
|
85
88
|
}
|
|
86
89
|
export default AttachmentItem;
|
|
87
90
|
//# sourceMappingURL=AttachmentItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUrD,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AAmBzE,SAAS,cAAc,CAAC,KAA0B;;IAChD,MAAM,EACJ,KAAK,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,mBAAmB;IACnB,MAAM,SAAS,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAG,CAAC,EAAE,EAAE,CAAC;IACzC,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,MAAI,MAAM,aA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
|
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
|
|
20
20
|
import ChoiceRadioSingle from '../ChoiceItems/ChoiceRadioSingle';
|
|
21
|
-
import { StyledRadioGroup } from '../Item.styles';
|
|
21
|
+
import { StyledRadioGroup, StyledRequiredTypography } from '../Item.styles';
|
|
22
22
|
import { getChoiceOrientation } from '../../../utils/choice';
|
|
23
23
|
import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
|
|
24
24
|
import Checkbox from '@mui/material/Checkbox';
|
|
@@ -27,7 +27,6 @@ import { isSpecificItemControl } from '../../../utils';
|
|
|
27
27
|
import ClearInputButton from '../ItemParts/ClearInputButton';
|
|
28
28
|
import { useRendererStylingStore } from '../../../stores';
|
|
29
29
|
import { findCalculatedExpressionsInExtensions } from '../../../utils/getExpressionsFromItem';
|
|
30
|
-
import Typography from '@mui/material/Typography';
|
|
31
30
|
const BooleanField = memo(function BooleanField(props) {
|
|
32
31
|
var _a, _b;
|
|
33
32
|
const { qItem, readOnly, valueBoolean, feedback, calcExpUpdated, onCheckedChange, onClear } = props;
|
|
@@ -56,7 +55,7 @@ const BooleanField = memo(function BooleanField(props) {
|
|
|
56
55
|
React.createElement(Box, { flexGrow: 1 }),
|
|
57
56
|
calculatedExpressionExist ? (React.createElement(FadingCheckIcon, { fadeIn: calcExpUpdated, disabled: readOnly })) : null,
|
|
58
57
|
hideClearButton ? null : (React.createElement(ClearInputButton, { buttonShown: valueBoolean !== undefined, readOnly: readOnly, onClear: onClear }))),
|
|
59
|
-
feedback ?
|
|
58
|
+
feedback ? React.createElement(StyledRequiredTypography, null, feedback) : null));
|
|
60
59
|
});
|
|
61
60
|
export default BooleanField;
|
|
62
61
|
//# sourceMappingURL=BooleanField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/BooleanItem/BooleanField.tsx"],"names":[],"m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C,gBAAgB,IACf,WAAW,EAAE,YAAY,KAAK,SAAS,EACvC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,GAChB,CACH,CACG;QAEL,QAAQ,CAAC,CAAC,CAAC,oBAAC,wBAAwB,QAAE,QAAQ,CAA4B,CAAC,CAAC,CAAC,IAAI,CACjF,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithFeedbackFromParentAttribute, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface BooleanItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
4
|
+
interface BooleanItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithFeedbackFromParentAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
@@ -27,11 +27,11 @@ import { ItemLabelWrapper } from '../ItemParts';
|
|
|
27
27
|
import useValidationFeedback from '../../../hooks/useValidationFeedback';
|
|
28
28
|
function BooleanItem(props) {
|
|
29
29
|
var _a, _b, _c;
|
|
30
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
30
|
+
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, feedbackFromParent, onQrItemChange } = props;
|
|
31
31
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
32
32
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
33
33
|
// Perform validation checks - there's no string-based input here
|
|
34
|
-
const feedback = useValidationFeedback(qItem, '');
|
|
34
|
+
const feedback = useValidationFeedback(qItem, feedbackFromParent, '');
|
|
35
35
|
// Init input value
|
|
36
36
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
37
37
|
let valueBoolean = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/BooleanItem/BooleanItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BooleanItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/BooleanItem/BooleanItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAA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AAiB,EAClC,OAAO,EAAE,WAAW,GACpB,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd,oBAAoB,iBACjB,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,oBAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,EACrE,aAAa,EACX,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,iBAAiB,EAClC,OAAO,EAAE,WAAW,GACpB,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface ChoiceAutocompleteItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithRenderingExtensionsAttribute {
|
|
3
|
+
import type { PropsWithFeedbackFromParentAttribute, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface ChoiceAutocompleteItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithRenderingExtensionsAttribute, PropsWithFeedbackFromParentAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
@@ -25,9 +25,10 @@ import ChoiceAutocompleteField from './ChoiceAutocompleteField';
|
|
|
25
25
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
26
26
|
import { useQuestionnaireStore } from '../../../stores';
|
|
27
27
|
import { ItemLabelWrapper } from '../ItemParts';
|
|
28
|
+
import useValidationFeedback from '../../../hooks/useValidationFeedback';
|
|
28
29
|
function ChoiceAutocompleteItem(props) {
|
|
29
30
|
var _a;
|
|
30
|
-
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, parentIsReadOnly, onQrItemChange } = props;
|
|
31
|
+
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, parentIsReadOnly, feedbackFromParent, onQrItemChange } = props;
|
|
31
32
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
32
33
|
// Init input value
|
|
33
34
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
@@ -36,11 +37,14 @@ function ChoiceAutocompleteItem(props) {
|
|
|
36
37
|
if (qrChoice.answer) {
|
|
37
38
|
valueCoding = qrChoice.answer[0].valueCoding;
|
|
38
39
|
}
|
|
39
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
40
40
|
const maxList = 10;
|
|
41
41
|
const [input, setInput] = useState('');
|
|
42
42
|
const debouncedInput = useDebounce(input, AUTOCOMPLETE_DEBOUNCE_DURATION);
|
|
43
|
-
const
|
|
43
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
44
|
+
// Perform validation checks
|
|
45
|
+
const validationFeedback = useValidationFeedback(qItem, feedbackFromParent, '');
|
|
46
|
+
const { options, loading, feedback: terminologyFeedback } = useTerminologyServerQuery(qItem, maxList, input, debouncedInput);
|
|
47
|
+
const feedback = terminologyFeedback !== null && terminologyFeedback !== void 0 ? terminologyFeedback : { message: validationFeedback, color: 'error' };
|
|
44
48
|
if (!qItem.answerValueSet) {
|
|
45
49
|
return null;
|
|
46
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceAutocompleteItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"ChoiceAutocompleteItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AASjF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACv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AE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,oBAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,EACrE,aAAa,EACX,oBAAC,uBAAuB,IACtB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,IAAI,EAChC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,EAC1B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,QAAQ,EACvB,aAAa,EAAE,iBAAiB,GAChC,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -18,14 +18,16 @@ import React from 'react';
|
|
|
18
18
|
import { getChoiceOrientation } from '../../../utils/choice';
|
|
19
19
|
import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
|
|
20
20
|
import CheckboxOptionList from './CheckboxOptionList';
|
|
21
|
-
import { StyledFormGroup } from '../Item.styles';
|
|
21
|
+
import { StyledFormGroup, StyledRequiredTypography } from '../Item.styles';
|
|
22
22
|
function ChoiceCheckboxAnswerOptionFields(props) {
|
|
23
23
|
var _a;
|
|
24
|
-
const { qItem, options, answers, readOnly, onCheckedChange } = props;
|
|
24
|
+
const { qItem, options, answers, feedback, readOnly, onCheckedChange } = props;
|
|
25
25
|
const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
|
|
26
26
|
if (options.length > 0) {
|
|
27
|
-
return (React.createElement(
|
|
28
|
-
React.createElement(
|
|
27
|
+
return (React.createElement(React.Fragment, null,
|
|
28
|
+
React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal },
|
|
29
|
+
React.createElement(CheckboxOptionList, { options: options, answers: answers, readOnly: readOnly, onCheckedChange: onCheckedChange })),
|
|
30
|
+
feedback ? React.createElement(StyledRequiredTypography, null, feedback) : null));
|
|
29
31
|
}
|
|
30
32
|
return null;
|
|
31
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceCheckboxAnswerOptionFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChoiceCheckboxAnswerOptionFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAW3E,SAAS,gCAAgC,CAAC,KAA4C;;IACpF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE/E,MAAM,WAAW,GAAG,MAAA,oBAAoB,CAAC,KAAK,CAAC,mCAAI,qBAAqB,CAAC,QAAQ,CAAC;IAElF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,CACL;YACE,oBAAC,eAAe,IAAC,GAAG,EAAE,WAAW,KAAK,qBAAqB,CAAC,UAAU;gBACpE,oBAAC,kBAAkB,IACjB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,GAChC,CACc;YAEjB,QAAQ,CAAC,CAAC,CAAC,oBAAC,wBAAwB,QAAE,QAAQ,CAA4B,CAAC,CAAC,CAAC,IAAI,CACjF,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,eAAe,gCAAgC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface ChoiceCheckboxAnswerOptionItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
3
|
+
import type { PropsWithFeedbackFromParentAttribute, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface ChoiceCheckboxAnswerOptionItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithFeedbackFromParentAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
@@ -24,19 +24,22 @@ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
|
24
24
|
import { useQuestionnaireStore } from '../../../stores';
|
|
25
25
|
import ChoiceCheckboxAnswerOptionFields from './ChoiceCheckboxAnswerOptionFields';
|
|
26
26
|
import { ItemLabelWrapper } from '../ItemParts';
|
|
27
|
+
import useValidationFeedback from '../../../hooks/useValidationFeedback';
|
|
27
28
|
function ChoiceCheckboxAnswerOptionItem(props) {
|
|
28
29
|
var _a, _b, _c;
|
|
29
|
-
const { qItem, qrItem, isRepeated, renderingExtensions, showMinimalView = false, parentIsReadOnly, onQrItemChange } = props;
|
|
30
|
+
const { qItem, qrItem, isRepeated, renderingExtensions, showMinimalView = false, parentIsReadOnly, feedbackFromParent, onQrItemChange } = props;
|
|
30
31
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
31
32
|
// Init input value
|
|
32
33
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
33
34
|
const qrChoiceCheckbox = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem, answerKey);
|
|
34
35
|
const answers = (_b = qrChoiceCheckbox.answer) !== null && _b !== void 0 ? _b : [];
|
|
35
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
36
36
|
const { displayInstructions } = renderingExtensions;
|
|
37
37
|
// TODO Process calculated expressions
|
|
38
38
|
// This requires its own hook, because in the case of multi-select, we need to check if the value is already checked to prevent an infinite loop
|
|
39
39
|
// This will be done after the choice/open-choice refactoring
|
|
40
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
41
|
+
// Perform validation checks
|
|
42
|
+
const feedback = useValidationFeedback(qItem, feedbackFromParent, '');
|
|
40
43
|
const options = (_c = qItem.answerOption) !== null && _c !== void 0 ? _c : [];
|
|
41
44
|
// Event handlers
|
|
42
45
|
function handleCheckedChange(changedValue) {
|
|
@@ -51,11 +54,11 @@ function ChoiceCheckboxAnswerOptionItem(props) {
|
|
|
51
54
|
}
|
|
52
55
|
if (showMinimalView) {
|
|
53
56
|
return (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(ChoiceCheckboxAnswerOptionFields, { qItem: qItem, options: options, answers: answers, readOnly: readOnly, onCheckedChange: handleCheckedChange }),
|
|
57
|
+
React.createElement(ChoiceCheckboxAnswerOptionFields, { qItem: qItem, options: options, answers: answers, feedback: feedback, readOnly: readOnly, onCheckedChange: handleCheckedChange }),
|
|
55
58
|
React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })));
|
|
56
59
|
}
|
|
57
60
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-checkbox-answer-option-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
58
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(ChoiceCheckboxAnswerOptionFields, { qItem: qItem, options: options, answers: answers, readOnly: readOnly, onCheckedChange: handleCheckedChange }) })));
|
|
61
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(ChoiceCheckboxAnswerOptionFields, { qItem: qItem, options: options, answers: answers, feedback: feedback, readOnly: readOnly, onCheckedChange: handleCheckedChange }) })));
|
|
59
62
|
}
|
|
60
63
|
export default ChoiceCheckboxAnswerOptionItem;
|
|
61
64
|
//# sourceMappingURL=ChoiceCheckboxAnswerOptionItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceCheckboxAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChoiceCheckboxAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAS7D,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AAazE,SAAS,8BAA8B,CAAC,KAA0C;;IAChF,MAAM,EACJ,KAAK,EACL,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,eAAe,GAAG,KAAK,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAEhE,mBAAmB;IACnB,MAAM,SAAS,GAAG,MAA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,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACpF,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd,0CAA0C,iBACvC,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,oBAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,EACrE,aAAa,EACX,oBAAC,gCAAgC,IAC/B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,mBAAmB,GACpC,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
|
|
@@ -5,6 +5,7 @@ interface ChoiceCheckboxAnswerValueSetFieldsProps {
|
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
options: QuestionnaireItemAnswerOption[];
|
|
7
7
|
answers: QuestionnaireResponseItemAnswer[];
|
|
8
|
+
feedback: string;
|
|
8
9
|
readOnly: boolean;
|
|
9
10
|
terminologyError: TerminologyError;
|
|
10
11
|
onCheckedChange: (newValue: string) => void;
|
|
@@ -21,14 +21,16 @@ import Typography from '@mui/material/Typography';
|
|
|
21
21
|
import { getChoiceOrientation } from '../../../utils/choice';
|
|
22
22
|
import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
|
|
23
23
|
import CheckboxOptionList from './CheckboxOptionList';
|
|
24
|
-
import { StyledFormGroup } from '../Item.styles';
|
|
24
|
+
import { StyledFormGroup, StyledRequiredTypography } from '../Item.styles';
|
|
25
25
|
function ChoiceCheckboxAnswerValueSetFields(props) {
|
|
26
26
|
var _a;
|
|
27
|
-
const { qItem, options, answers, readOnly, terminologyError, onCheckedChange } = props;
|
|
27
|
+
const { qItem, options, answers, feedback, readOnly, terminologyError, onCheckedChange } = props;
|
|
28
28
|
const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
|
|
29
29
|
if (options.length > 0) {
|
|
30
|
-
return (React.createElement(
|
|
31
|
-
React.createElement(
|
|
30
|
+
return (React.createElement(React.Fragment, null,
|
|
31
|
+
React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal },
|
|
32
|
+
React.createElement(CheckboxOptionList, { options: options, answers: answers, readOnly: readOnly, onCheckedChange: onCheckedChange })),
|
|
33
|
+
feedback ? React.createElement(StyledRequiredTypography, null, feedback) : null));
|
|
32
34
|
}
|
|
33
35
|
if (terminologyError.error) {
|
|
34
36
|
return (React.createElement(StyledAlert, { color: "error" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceCheckboxAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChoiceCheckboxAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../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AC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW;;gBACuC,GAAG;gBACtE,gBAAgB,CAAC,cAAc,CACrB,CACD,CACf,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,kCAAkC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface ChoiceCheckboxAnswerValueSetItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
3
|
+
import type { PropsWithFeedbackFromParentAttribute, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface ChoiceCheckboxAnswerValueSetItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithFeedbackFromParentAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
showText?: boolean;
|
|
@@ -25,16 +25,19 @@ import useReadOnly from '../../../hooks/useReadOnly';
|
|
|
25
25
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
26
26
|
import { useQuestionnaireStore } from '../../../stores';
|
|
27
27
|
import { ItemLabelWrapper } from '../ItemParts';
|
|
28
|
+
import useValidationFeedback from '../../../hooks/useValidationFeedback';
|
|
28
29
|
function ChoiceCheckboxAnswerValueSetItem(props) {
|
|
29
30
|
var _a, _b;
|
|
30
|
-
const { qItem, qrItem, isRepeated, renderingExtensions, showMinimalView = false, parentIsReadOnly, onQrItemChange } = props;
|
|
31
|
+
const { qItem, qrItem, isRepeated, renderingExtensions, showMinimalView = false, parentIsReadOnly, feedbackFromParent, onQrItemChange } = props;
|
|
31
32
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
32
33
|
// Init input value
|
|
33
34
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
34
35
|
const qrChoiceCheckbox = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem, answerKey);
|
|
35
36
|
const answers = (_b = qrChoiceCheckbox.answer) !== null && _b !== void 0 ? _b : [];
|
|
36
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
37
37
|
const { displayInstructions } = renderingExtensions;
|
|
38
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
39
|
+
// Perform validation checks
|
|
40
|
+
const feedback = useValidationFeedback(qItem, feedbackFromParent, '');
|
|
38
41
|
// Get codings/options from valueSet
|
|
39
42
|
const { codings, terminologyError } = useValueSetCodings(qItem);
|
|
40
43
|
const options = useMemo(() => convertCodingsToAnswerOptions(codings), [codings]);
|
|
@@ -54,11 +57,11 @@ function ChoiceCheckboxAnswerValueSetItem(props) {
|
|
|
54
57
|
}
|
|
55
58
|
if (showMinimalView) {
|
|
56
59
|
return (React.createElement(React.Fragment, null,
|
|
57
|
-
React.createElement(ChoiceCheckboxAnswerValueSetFields, { qItem: qItem, options: options, answers: answers, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleCheckedChange }),
|
|
60
|
+
React.createElement(ChoiceCheckboxAnswerValueSetFields, { qItem: qItem, options: options, answers: answers, feedback: feedback, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleCheckedChange }),
|
|
58
61
|
React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })));
|
|
59
62
|
}
|
|
60
63
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-checkbox-answer-value-set-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
61
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(ChoiceCheckboxAnswerValueSetFields, { qItem: qItem, options: options, answers: answers, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleCheckedChange }) })));
|
|
64
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(ChoiceCheckboxAnswerValueSetFields, { qItem: qItem, options: options, answers: answers, feedback: feedback, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleCheckedChange }) })));
|
|
62
65
|
}
|
|
63
66
|
export default ChoiceCheckboxAnswerValueSetItem;
|
|
64
67
|
//# sourceMappingURL=ChoiceCheckboxAnswerValueSetItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAS7D,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AAczE,SAAS,gCAAgC,CAAC,KAA4C;;IACpF,MAAM,EACJ,KAAK,EACL,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,eAAe,GAAG,KAAK,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,GAAG,KAAK,CAAC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C,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,CACL;YACE,oBAAC,kCAAkC,IACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,mBAAmB,GACpC;YACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACpF,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd,6CAA6C,iBAC1C,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,oBAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,EACrE,aAAa,EACX,oBAAC,kCAAkC,IACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,mBAAmB,GACpC,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,gCAAgC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface ChoiceItemSwitcherProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
3
|
+
import type { PropsWithFeedbackFromParentAttribute, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface ChoiceItemSwitcherProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithFeedbackFromParentAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
@@ -27,31 +27,31 @@ import ChoiceCheckboxAnswerValueSetItem from './ChoiceCheckboxAnswerValueSetItem
|
|
|
27
27
|
import Typography from '@mui/material/Typography';
|
|
28
28
|
function ChoiceItemSwitcher(props) {
|
|
29
29
|
var _a, _b;
|
|
30
|
-
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
|
|
30
|
+
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, showMinimalView, parentIsReadOnly, feedbackFromParent, onQrItemChange } = props;
|
|
31
31
|
const choiceControlType = getChoiceControlType(qItem);
|
|
32
32
|
switch (choiceControlType) {
|
|
33
33
|
case ChoiceItemControl.Radio:
|
|
34
34
|
if (qItem.answerOption) {
|
|
35
|
-
return (React.createElement(ChoiceRadioAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
35
|
+
return (React.createElement(ChoiceRadioAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, feedbackFromParent: feedbackFromParent, onQrItemChange: onQrItemChange }));
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
return (React.createElement(ChoiceRadioAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
38
|
+
return (React.createElement(ChoiceRadioAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, feedbackFromParent: feedbackFromParent, onQrItemChange: onQrItemChange }));
|
|
39
39
|
}
|
|
40
40
|
case ChoiceItemControl.Checkbox:
|
|
41
41
|
if (qItem.answerOption) {
|
|
42
|
-
return (React.createElement(ChoiceCheckboxAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
42
|
+
return (React.createElement(ChoiceCheckboxAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, feedbackFromParent: feedbackFromParent, onQrItemChange: onQrItemChange }));
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
return (React.createElement(ChoiceCheckboxAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_b = qItem.repeats) !== null && _b !== void 0 ? _b : false, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
45
|
+
return (React.createElement(ChoiceCheckboxAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_b = qItem.repeats) !== null && _b !== void 0 ? _b : false, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, feedbackFromParent: feedbackFromParent, onQrItemChange: onQrItemChange }));
|
|
46
46
|
}
|
|
47
47
|
case ChoiceItemControl.Autocomplete:
|
|
48
|
-
return (React.createElement(ChoiceAutocompleteItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
48
|
+
return (React.createElement(ChoiceAutocompleteItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, feedbackFromParent: feedbackFromParent, onQrItemChange: onQrItemChange }));
|
|
49
49
|
case ChoiceItemControl.Select:
|
|
50
50
|
if (qItem.answerOption) {
|
|
51
|
-
return (React.createElement(ChoiceSelectAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
51
|
+
return (React.createElement(ChoiceSelectAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, feedbackFromParent: feedbackFromParent, onQrItemChange: onQrItemChange }));
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
|
-
return (React.createElement(ChoiceSelectAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
54
|
+
return (React.createElement(ChoiceSelectAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, feedbackFromParent: feedbackFromParent, onQrItemChange: onQrItemChange }));
|
|
55
55
|
}
|
|
56
56
|
default:
|
|
57
57
|
return (React.createElement(Typography, null,
|