@aehrc/smart-forms-renderer 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +12 -12
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +12 -12
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +3 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/CustomDateItem/CustomDateField2.d.ts +18 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js +31 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateItem.d.ts +9 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js +68 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.d.ts +9 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js +75 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.d.ts +9 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js +75 -0
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.d.ts +18 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.js +33 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.d.ts +11 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.js +55 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.d.ts +9 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js +13 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.d.ts +5 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.js +20 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.d.ts +5 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js +27 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.d.ts +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.js +18 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.d.ts +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js +18 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.d.ts +9 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.js +121 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.d.ts +9 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js +71 -0
- package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js.map +1 -0
- package/lib/components/FormComponents/CustomDateItem/index.d.ts +1 -0
- package/lib/components/FormComponents/CustomDateItem/index.js +18 -0
- package/lib/components/FormComponents/CustomDateItem/index.js.map +1 -0
- package/lib/components/FormComponents/DateItem/DateItem.d.ts +3 -4
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.d.ts +2 -2
- package/lib/components/FormComponents/DecimalItem/DecimalItem.d.ts +2 -2
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +2 -3
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/DisplayItem/DisplayBox.d.ts +0 -0
- package/lib/components/FormComponents/DisplayItem/DisplayBox.js +2 -0
- package/lib/components/FormComponents/DisplayItem/DisplayBox.js.map +1 -0
- package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.d.ts +4 -0
- package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js +35 -0
- package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js.map +1 -0
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.d.ts +2 -1
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js.map +1 -1
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js +0 -1
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridGroup.d.ts +3 -3
- package/lib/components/FormComponents/GridGroup/GridGroup.js +13 -8
- package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridRow.d.ts +3 -4
- package/lib/components/FormComponents/GridGroup/GridRow.js +3 -3
- package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridTable.d.ts +3 -3
- package/lib/components/FormComponents/GridGroup/GridTable.js +9 -4
- package/lib/components/FormComponents/GridGroup/GridTable.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/index.d.ts +1 -0
- package/lib/components/FormComponents/GridGroup/index.js +18 -0
- package/lib/components/FormComponents/GridGroup/index.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +2 -2
- package/lib/components/FormComponents/GroupItem/GroupItem.js +2 -2
- package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.styles.d.ts +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +5 -6
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerItem.d.ts +2 -2
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js +2 -3
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/SliderItem.d.ts +9 -0
- package/lib/components/FormComponents/IntegerItem/SliderItem.js +75 -0
- package/lib/components/FormComponents/IntegerItem/SliderItem.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +2 -2
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +2 -2
- package/lib/components/FormComponents/Lists.styles.d.ts +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +12 -12
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +15 -4
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.d.ts +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatField.d.ts +3 -3
- package/lib/components/FormComponents/RepeatItem/RepeatField.js +3 -3
- package/lib/components/FormComponents/RepeatItem/RepeatField.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +3 -2
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js +11 -2
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/index.d.ts +1 -0
- package/lib/components/FormComponents/RepeatItem/index.js +18 -0
- package/lib/components/FormComponents/RepeatItem/index.js.map +1 -0
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +3 -3
- 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 +3 -3
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +12 -7
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/SliderItem/DisplayBox.styles.d.ts +4 -0
- package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js +35 -0
- package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js.map +1 -0
- package/lib/components/FormComponents/SliderItem/Slider.styles.d.ts +6 -0
- package/lib/components/FormComponents/SliderItem/Slider.styles.js +33 -0
- package/lib/components/FormComponents/SliderItem/Slider.styles.js.map +1 -0
- package/lib/components/FormComponents/SliderItem/SliderDisplayValue.d.ts +8 -0
- package/lib/components/FormComponents/SliderItem/SliderDisplayValue.js +28 -0
- package/lib/components/FormComponents/SliderItem/SliderDisplayValue.js.map +1 -0
- package/lib/components/FormComponents/SliderItem/SliderField.d.ts +16 -0
- package/lib/components/FormComponents/SliderItem/SliderField.js +41 -0
- package/lib/components/FormComponents/SliderItem/SliderField.js.map +1 -0
- package/lib/components/FormComponents/SliderItem/SliderItem.d.ts +9 -0
- package/lib/components/FormComponents/SliderItem/SliderItem.js +56 -0
- package/lib/components/FormComponents/SliderItem/SliderItem.js.map +1 -0
- package/lib/components/FormComponents/SliderItem/SliderLabels.d.ts +7 -0
- package/lib/components/FormComponents/SliderItem/SliderLabels.js +32 -0
- package/lib/components/FormComponents/SliderItem/SliderLabels.js.map +1 -0
- package/lib/components/FormComponents/StringItem/StringItem.d.ts +2 -2
- package/lib/components/FormComponents/Tables/GroupTable.d.ts +3 -2
- package/lib/components/FormComponents/Tables/GroupTable.js +18 -1
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +3 -4
- package/lib/components/FormComponents/Tables/GroupTableRow.js +3 -3
- package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextItem.d.ts +2 -2
- package/lib/components/FormComponents/TimeItem/TimeItem.d.ts +2 -2
- package/lib/components/FormComponents/UrlItem/UrlItem.d.ts +2 -2
- package/lib/components/FormComponents/index.d.ts +3 -0
- package/lib/components/FormComponents/index.js +3 -0
- package/lib/components/FormComponents/index.js.map +1 -1
- package/lib/components/Lists.styles.d.ts +1 -1
- package/lib/components/Renderer/BaseRenderer.js +3 -5
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/components/Renderer/FormBodyCollapsible.d.ts +2 -2
- package/lib/components/Renderer/FormBodyCollapsible.js +6 -5
- package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -1
- package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.d.ts +2 -2
- package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js.map +1 -1
- package/lib/components/Renderer/FormBodyTabbed.d.ts +2 -2
- package/lib/components/Renderer/FormBodyTabbed.js +6 -5
- package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
- package/lib/components/Renderer/FormTopLevelItem.d.ts +2 -2
- package/lib/components/Renderer/FormTopLevelItem.js +3 -1
- package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
- package/lib/components/Renderer/SmartFormsRenderer.js +1 -1
- package/lib/components/Renderer/SmartFormsRenderer.js.map +1 -1
- package/lib/hooks/useDateSeparatorValidation.d.ts +2 -0
- package/lib/hooks/useDateSeparatorValidation.js +25 -0
- package/lib/hooks/useDateSeparatorValidation.js.map +1 -0
- package/lib/hooks/useDateValidation.d.ts +2 -0
- package/lib/hooks/useDateValidation.js +61 -0
- package/lib/hooks/useDateValidation.js.map +1 -0
- package/lib/hooks/useDecimalCalculatedExpression.d.ts +0 -1
- package/lib/hooks/useDecimalCalculatedExpression.js +3 -3
- package/lib/hooks/useDecimalCalculatedExpression.js.map +1 -1
- package/lib/hooks/useInitialiseRepeatAnswers.d.ts +1 -1
- package/lib/hooks/useInitialiseRepeatAnswers.js.map +1 -1
- package/lib/hooks/useIntegerCalculatedExpression.d.ts +0 -1
- package/lib/hooks/useIntegerCalculatedExpression.js +3 -3
- package/lib/hooks/useIntegerCalculatedExpression.js.map +1 -1
- package/lib/hooks/useSliderExtensions.d.ts +10 -0
- package/lib/hooks/useSliderExtensions.js +37 -0
- package/lib/hooks/useSliderExtensions.js.map +1 -0
- package/lib/hooks/useTerminologyServerQuery.js +0 -1
- package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +15 -6
- package/lib/index.js.map +1 -1
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/interfaces/index.js +18 -0
- package/lib/interfaces/index.js.map +1 -0
- package/lib/interfaces/questionnaireStore.interface.d.ts +1 -0
- package/lib/interfaces/renderProps.interface.d.ts +4 -3
- package/lib/stores/useQuestionnaireStore.d.ts +1 -0
- package/lib/stores/useQuestionnaireStore.js +28 -12
- package/lib/stores/useQuestionnaireStore.js.map +1 -1
- package/lib/test.d.ts +4 -0
- package/lib/test.js +18 -0
- package/lib/test.js.map +1 -0
- package/lib/theme/customGlobalStyles.js +2 -5
- package/lib/theme/customGlobalStyles.js.map +1 -1
- package/lib/theme/typography.js +9 -9
- package/lib/theme/typography.js.map +1 -1
- package/lib/utils/calculatedExpression.d.ts +5 -1
- package/lib/utils/calculatedExpression.js +21 -16
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/dayjsExtend.d.ts +1 -0
- package/lib/utils/dayjsExtend.js +22 -0
- package/lib/utils/dayjsExtend.js.map +1 -0
- package/lib/utils/enableWhenExpression.d.ts +5 -1
- package/lib/utils/enableWhenExpression.js +26 -21
- package/lib/utils/enableWhenExpression.js.map +1 -1
- package/lib/utils/fhirpath.d.ts +3 -1
- package/lib/utils/fhirpath.js +25 -15
- package/lib/utils/fhirpath.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/initialiseForm.d.ts +2 -0
- package/lib/utils/initialiseForm.js +13 -5
- package/lib/utils/initialiseForm.js.map +1 -1
- package/lib/utils/itemControl.d.ts +12 -0
- package/lib/utils/itemControl.js +30 -0
- package/lib/utils/itemControl.js.map +1 -1
- package/lib/utils/launchContext.d.ts +0 -0
- package/lib/utils/launchContext.js +2 -0
- package/lib/utils/launchContext.js.map +1 -0
- package/lib/utils/mapItem.d.ts +1 -1
- package/lib/utils/populateContexts.d.ts +2 -12
- package/lib/utils/populateContexts.js +0 -36
- package/lib/utils/populateContexts.js.map +1 -1
- package/lib/utils/qrItem.d.ts +1 -7
- package/lib/utils/qrItem.js +1 -12
- package/lib/utils/qrItem.js.map +1 -1
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +4 -2
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
- package/lib/utils/removeHidden.js +2 -1
- package/lib/utils/removeHidden.js.map +1 -1
- package/lib/utils/repopulateIntoResponse.js +90 -29
- package/lib/utils/repopulateIntoResponse.js.map +1 -1
- package/lib/utils/repopulateItems.d.ts +14 -1
- package/lib/utils/repopulateItems.js +251 -70
- package/lib/utils/repopulateItems.js.map +1 -1
- package/lib/utils/repopulateRepeatGroup.js +9 -1
- package/lib/utils/repopulateRepeatGroup.js.map +1 -1
- package/lib/utils/slider.d.ts +28 -0
- package/lib/utils/slider.js +89 -0
- package/lib/utils/slider.js.map +1 -0
- package/package.json +18 -15
- package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +2 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +2 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +33 -33
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +35 -35
- package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +8 -8
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +2 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +2 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +2 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +2 -2
- package/src/components/FormComponents/CustomDateItem/CustomDateItem.tsx +140 -0
- package/src/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.tsx +96 -0
- package/src/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.tsx +81 -0
- package/src/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.tsx +33 -0
- package/src/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.ts +22 -0
- package/src/components/FormComponents/CustomDateItem/customDateTimePicker/index.ts +18 -0
- package/src/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.ts +18 -0
- package/src/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.ts +154 -0
- package/src/components/FormComponents/CustomDateItem/index.ts +18 -0
- package/src/components/FormComponents/DateItem/DateItem.tsx +3 -3
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +2 -2
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +4 -5
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts +0 -1
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +2 -1
- package/src/components/FormComponents/GridGroup/GridGroup.tsx +41 -15
- package/src/components/FormComponents/GridGroup/GridRow.tsx +10 -9
- package/src/components/FormComponents/GridGroup/GridTable.tsx +29 -9
- package/src/components/FormComponents/GridGroup/index.ts +18 -0
- package/src/components/FormComponents/GroupItem/GroupItem.tsx +5 -6
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +7 -8
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +4 -5
- package/src/components/FormComponents/ItemParts/FadingCheckIcon.tsx +2 -2
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +2 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +2 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +43 -43
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +6 -6
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +2 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +2 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +2 -2
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +49 -6
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +13 -8
- package/src/components/FormComponents/RepeatItem/RepeatField.tsx +15 -9
- package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +33 -3
- package/src/components/FormComponents/RepeatItem/index.ts +18 -0
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +6 -6
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +27 -11
- package/src/components/FormComponents/SliderItem/Slider.styles.ts +34 -0
- package/src/components/FormComponents/SliderItem/SliderDisplayValue.tsx +43 -0
- package/src/components/FormComponents/SliderItem/SliderField.tsx +88 -0
- package/src/components/FormComponents/SliderItem/SliderItem.tsx +115 -0
- package/src/components/FormComponents/SliderItem/SliderLabels.tsx +53 -0
- package/src/components/FormComponents/StringItem/StringItem.tsx +2 -2
- package/src/components/FormComponents/Tables/GroupTable.tsx +55 -3
- package/src/components/FormComponents/Tables/GroupTableRow.tsx +10 -9
- package/src/components/FormComponents/TextItem/TextItem.tsx +2 -2
- package/src/components/FormComponents/TimeItem/TimeItem.tsx +2 -2
- package/src/components/FormComponents/UrlItem/UrlItem.tsx +2 -2
- package/src/components/FormComponents/index.ts +3 -0
- package/src/components/Renderer/BaseRenderer.tsx +5 -12
- package/src/components/Renderer/FormBodyCollapsible.tsx +9 -7
- package/src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx +2 -3
- package/src/components/Renderer/FormBodyTabbed.tsx +9 -7
- package/src/components/Renderer/FormTopLevelItem.tsx +14 -11
- package/src/components/Renderer/SmartFormsRenderer.tsx +2 -1
- package/src/hooks/useDateValidation.tsx +79 -0
- package/src/hooks/useDecimalCalculatedExpression.ts +3 -4
- package/src/hooks/useInitialiseRepeatAnswers.ts +1 -1
- package/src/hooks/useIntegerCalculatedExpression.ts +3 -4
- package/src/hooks/useSliderExtensions.ts +50 -0
- package/src/hooks/useTerminologyServerQuery.ts +0 -2
- package/src/index.ts +12 -9
- package/src/interfaces/questionnaireStore.interface.ts +1 -0
- package/src/interfaces/renderProps.interface.ts +4 -3
- package/src/stores/useQuestionnaireStore.ts +39 -16
- package/src/theme/customGlobalStyles.tsx +2 -5
- package/src/theme/typography.ts +9 -9
- package/src/utils/calculatedExpression.ts +41 -28
- package/src/utils/dayjsExtend.ts +23 -0
- package/src/utils/enableWhenExpression.ts +49 -34
- package/src/utils/fhirpath.ts +50 -31
- package/src/utils/index.ts +1 -0
- package/src/utils/initialiseForm.ts +15 -5
- package/src/utils/itemControl.ts +32 -0
- package/src/utils/mapItem.ts +1 -1
- package/src/utils/populateContexts.ts +2 -61
- package/src/utils/qrItem.ts +1 -16
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +4 -2
- package/src/utils/removeHidden.ts +2 -1
- package/src/utils/repopulateIntoResponse.ts +134 -43
- package/src/utils/repopulateItems.ts +379 -101
- package/src/utils/slider.ts +112 -0
- package/src/utils/populateInputParams.ts +0 -242
- package/src/utils/repopulateRepeatGroup.ts +0 -68
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/CustomDateItem/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
|
-
import type { PropsWithParentIsReadOnlyAttribute } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
5
|
-
interface DateItemProps extends PropsWithQrItemChangeHandler
|
|
4
|
+
interface DateItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
6
5
|
qItem: QuestionnaireItem;
|
|
7
|
-
qrItem: QuestionnaireResponseItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
8
7
|
}
|
|
9
8
|
declare function DateItem(props: DateItemProps): React.JSX.Element;
|
|
10
9
|
export default DateItem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface DateTimeItemProps extends PropsWithQrItemChangeHandler
|
|
4
|
+
interface DateTimeItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
8
8
|
declare function DateTimeItem(props: DateTimeItemProps): React.JSX.Element;
|
|
9
9
|
export default DateTimeItem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface DecimalItemProps extends PropsWithQrItemChangeHandler
|
|
4
|
+
interface DecimalItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
8
8
|
declare function DecimalItem(props: DecimalItemProps): React.JSX.Element;
|
|
9
9
|
export default DecimalItem;
|
|
@@ -20,7 +20,7 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
|
20
20
|
import useValidationError from '../../../hooks/useValidationError';
|
|
21
21
|
import debounce from 'lodash.debounce';
|
|
22
22
|
import { DEBOUNCE_DURATION } from '../../../utils/debounce';
|
|
23
|
-
import {
|
|
23
|
+
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
24
24
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
25
25
|
import DecimalField from './DecimalField';
|
|
26
26
|
import { parseDecimalStringToFloat, parseDecimalStringWithPrecision } from '../../../utils/parseInputs';
|
|
@@ -52,7 +52,6 @@ function DecimalItem(props) {
|
|
|
52
52
|
const { calcExpUpdated } = useDecimalCalculatedExpression({
|
|
53
53
|
qItem: qItem,
|
|
54
54
|
inputValue: input,
|
|
55
|
-
displayUnit: displayUnit,
|
|
56
55
|
precision: precision,
|
|
57
56
|
setInputValue: (newInput) => {
|
|
58
57
|
setInput(newInput);
|
|
@@ -67,7 +66,7 @@ function DecimalItem(props) {
|
|
|
67
66
|
}
|
|
68
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
68
|
const updateQrItemWithDebounce = useCallback(debounce((parsedNewInput) => {
|
|
70
|
-
onQrItemChange(Object.assign(Object.assign({},
|
|
69
|
+
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: precision
|
|
71
70
|
? [{ valueDecimal: parseDecimalStringToFloat(parsedNewInput, precision) }]
|
|
72
71
|
: [{ valueDecimal: parseFloat(parsedNewInput) }] }));
|
|
73
72
|
}, DEBOUNCE_DURATION), [onQrItemChange, qItem, displayUnit, precision]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DecimalItem/DecimalItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,
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,GAChC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisplayBox.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayBox.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledDisplayBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 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
|
+
import { styled } from '@mui/material/styles';
|
|
18
|
+
import { Box } from '@mui/material';
|
|
19
|
+
export const StyledDisplayBox = styled(Box)(({ theme }) => ({
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
padding: theme.spacing(0.5),
|
|
23
|
+
borderRadius: Number(theme.shape.borderRadius) * 1.5
|
|
24
|
+
// backgroundColor: alpha(
|
|
25
|
+
// color === 'error' ? theme.palette.error.light : theme.palette.info.light,
|
|
26
|
+
// 0.12
|
|
27
|
+
// ),
|
|
28
|
+
// [theme.breakpoints.up('sm')]: {
|
|
29
|
+
// padding: theme.spacing(1.5)
|
|
30
|
+
// },
|
|
31
|
+
// [theme.breakpoints.up('md')]: {
|
|
32
|
+
// padding: theme.spacing(2)
|
|
33
|
+
// }
|
|
34
|
+
}));
|
|
35
|
+
//# sourceMappingURL=DisplayBox.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisplayBox.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayBox.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1D,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,GAAG;IACpD,0BAA0B;IAC1B,8EAA8E;IAC9E,SAAS;IACT,KAAK;IACL,kCAAkC;IAClC,gCAAgC;IAChC,KAAK;IACL,kCAAkC;IAClC,8BAA8B;IAC9B,IAAI;CACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
interface DisplayInstructionsProps {
|
|
3
|
-
displayInstructions: string;
|
|
4
|
+
displayInstructions: string | ReactElement;
|
|
4
5
|
readOnly: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const DisplayInstructions: React.NamedExoticComponent<DisplayInstructionsProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayInstructions.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"DisplayInstructions.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAO1E,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,mBAAmB,CAAC,KAA+B;IAC3F,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEhD,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAC3B,oBAAC,0BAA0B;QACzB,oBAAC,UAAU,IACT,OAAO,EAAC,SAAS,EACjB,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,IAClD,mBAAmB,CACT,CACc,CAC9B,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -18,7 +18,6 @@ import Box from '@mui/material/Box';
|
|
|
18
18
|
import { styled } from '@mui/material/styles';
|
|
19
19
|
export const DisplayInstructionsWrapper = styled(Box)(({ theme }) => ({
|
|
20
20
|
color: theme.palette.text.secondary,
|
|
21
|
-
textTransform: 'capitalize',
|
|
22
21
|
marginBottom: '8px'
|
|
23
22
|
}));
|
|
24
23
|
//# sourceMappingURL=DisplayInstructions.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayInstructions.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACpE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;IACnC,
|
|
1
|
+
{"version":3,"file":"DisplayInstructions.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACpE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;IACnC,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface GridGroupProps extends PropsWithQrItemChangeHandler
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface GridGroupProps extends PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
groupCardElevation: number;
|
|
8
8
|
}
|
|
9
9
|
declare function GridGroup(props: GridGroupProps): React.JSX.Element | null;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React, { useMemo } from 'react';
|
|
18
|
-
import {
|
|
18
|
+
import { createEmptyQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
|
|
19
19
|
import useHidden from '../../../hooks/useHidden';
|
|
20
20
|
import { QGroupContainerBox } from '../../Box.styles';
|
|
21
21
|
import Divider from '@mui/material/Divider';
|
|
@@ -27,9 +27,9 @@ import GridTable from './GridTable';
|
|
|
27
27
|
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
28
28
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
29
29
|
function GridGroup(props) {
|
|
30
|
-
const { qItem, qrItem, groupCardElevation, parentIsReadOnly, onQrItemChange } = props;
|
|
30
|
+
const { qItem, qrItem, groupCardElevation, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
|
|
31
31
|
const qRowItems = qItem.item;
|
|
32
|
-
const qrGroup = qrItem && qrItem.item ? qrItem :
|
|
32
|
+
const qrGroup = qrItem && qrItem.item ? qrItem : createEmptyQrGroup(qItem);
|
|
33
33
|
const qrRowItems = qrGroup.item;
|
|
34
34
|
const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
|
|
35
35
|
const columnLabels = useMemo(() => { var _a, _b; return (_b = (_a = qRowItems === null || qRowItems === void 0 ? void 0 : qRowItems[0].item) === null || _a === void 0 ? void 0 : _a.map((firstItem) => { var _a; return (_a = firstItem.text) !== null && _a !== void 0 ? _a : ' '; })) !== null && _b !== void 0 ? _b : []; }, [qRowItems]);
|
|
@@ -51,13 +51,18 @@ function GridGroup(props) {
|
|
|
51
51
|
updateQrItemsInGroup(newQrItem, null, updatedQrGroup, qItemsIndexMap);
|
|
52
52
|
onQrItemChange(updatedQrGroup);
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py:
|
|
54
|
+
if (showMinimalView) {
|
|
55
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 1 },
|
|
56
|
+
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
57
|
+
React.createElement(GridTable, { qItems: qRowItems, qrItems: qrRowItems, qItemsIndexMap: qItemsIndexMap, columnLabels: columnLabels, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleRowChange }))));
|
|
58
|
+
}
|
|
59
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
|
|
60
|
+
qItem.text ? (React.createElement(React.Fragment, null,
|
|
56
61
|
React.createElement(Typography, { fontSize: 13, variant: "h6", color: readOnly ? 'text.secondary' : 'text.primary' },
|
|
57
62
|
React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
|
|
58
|
-
React.createElement(Divider, { sx: { my: 1 }, light: true }),
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
|
|
64
|
+
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
65
|
+
React.createElement(GridTable, { qItems: qRowItems, qrItems: qrRowItems, qItemsIndexMap: qItemsIndexMap, columnLabels: columnLabels, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleRowChange }))));
|
|
61
66
|
}
|
|
62
67
|
export default GridGroup;
|
|
63
68
|
//# sourceMappingURL=GridGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridGroup.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GridGroup.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAWrD,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAC5F,KAAK,CAAC;IAER,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;IAC7B,MAAM,OAAO,GAAG,MAAM,IAAI,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
|
3
|
-
import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
|
|
5
|
-
interface GridRowProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithParentIsReadOnlyAttribute {
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface GridRowProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
|
|
6
5
|
qItem: QuestionnaireItem;
|
|
7
|
-
qrItem: QuestionnaireResponseItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
8
7
|
columnLabels: string[];
|
|
9
8
|
numOfColumns: number;
|
|
10
9
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React, { useMemo } from 'react';
|
|
18
|
-
import {
|
|
18
|
+
import { createEmptyQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
|
|
19
19
|
import { GridAnswerTableCell, GridTextTableCell } from '../Tables/Table.styles';
|
|
20
20
|
import SingleItem from '../SingleItem/SingleItem';
|
|
21
21
|
import { getQrItemsIndex, mapQItemsIndex } from '../../../utils/mapItem';
|
|
@@ -24,7 +24,7 @@ import useHidden from '../../../hooks/useHidden';
|
|
|
24
24
|
function GridRow(props) {
|
|
25
25
|
const { qItem, qrItem, columnLabels, numOfColumns, parentIsReadOnly, onQrItemChange } = props;
|
|
26
26
|
const rowQItems = qItem.item;
|
|
27
|
-
const row = qrItem && qrItem.item ? qrItem :
|
|
27
|
+
const row = qrItem && qrItem.item ? qrItem : createEmptyQrGroup(qItem);
|
|
28
28
|
const rowQrItems = row.item;
|
|
29
29
|
const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
|
|
30
30
|
const itemIsHidden = useHidden(qItem);
|
|
@@ -53,7 +53,7 @@ function GridRow(props) {
|
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
55
|
return (React.createElement(GridAnswerTableCell, { key: index, numOfColumns: numOfColumns },
|
|
56
|
-
React.createElement(SingleItem, { qItem: cellQItem, qrItem: cellQrItem, isRepeated: true, isTabled: true, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleQrRowItemChange })));
|
|
56
|
+
React.createElement(SingleItem, { qItem: cellQItem, qrItem: cellQrItem !== null && cellQrItem !== void 0 ? cellQrItem : null, isRepeated: true, isTabled: true, showMinimalView: true, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleQrRowItemChange })));
|
|
57
57
|
})));
|
|
58
58
|
}
|
|
59
59
|
export default GridRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GridRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AASjD,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,c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EAAE;gBAC7B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,CACL,oBAAC,mBAAmB,IAAC,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY;gBACzD,oBAAC,UAAU,IACT,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,EAC1B,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,EACd,eAAe,EAAE,IAAI,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,qBAAqB,GACrC,CACkB,CACvB,CAAC;QACJ,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
import type {
|
|
5
|
-
interface GridTableProps extends PropsWithQrItemChangeHandler
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
import type { PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
5
|
+
interface GridTableProps extends PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
6
6
|
qItems: QuestionnaireItem[];
|
|
7
7
|
qrItems: QuestionnaireResponseItem[];
|
|
8
8
|
qItemsIndexMap: Record<string, number>;
|
|
@@ -24,22 +24,27 @@ import { HeaderTableCell } from '../Tables/Table.styles';
|
|
|
24
24
|
import GridRow from './GridRow';
|
|
25
25
|
import { getQrItemsIndex } from '../../../utils/mapItem';
|
|
26
26
|
function GridTable(props) {
|
|
27
|
-
const { qItems, qrItems, qItemsIndexMap, columnLabels, parentIsReadOnly, onQrItemChange } = props;
|
|
27
|
+
const { qItems, qrItems, qItemsIndexMap, columnLabels, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
|
|
28
28
|
const qrItemsByIndex = getQrItemsIndex(qItems, qrItems, qItemsIndexMap);
|
|
29
29
|
const numOfColumns = columnLabels.length;
|
|
30
|
-
|
|
30
|
+
const minimalViewHeaderCellSx = showMinimalView ? { py: 2 } : null;
|
|
31
|
+
return (React.createElement(Table, { size: showMinimalView ? 'small' : 'medium' },
|
|
31
32
|
React.createElement(TableHead, null,
|
|
32
33
|
React.createElement(TableRow, null,
|
|
33
34
|
React.createElement(HeaderTableCell, null),
|
|
34
|
-
columnLabels.map((label) => (React.createElement(HeaderTableCell, { key: label }, label))),
|
|
35
|
+
columnLabels.map((label) => (React.createElement(HeaderTableCell, { key: label, size: "medium", sx: Object.assign({}, minimalViewHeaderCellSx) }, label))),
|
|
35
36
|
React.createElement(TableCell, null))),
|
|
36
37
|
React.createElement(TableBody, null, qItems.map((qItem, index) => {
|
|
37
38
|
const qrItem = qrItemsByIndex[index];
|
|
38
39
|
if (Array.isArray(qrItem)) {
|
|
39
40
|
return null;
|
|
40
41
|
}
|
|
42
|
+
// In minimal view, don't display items with no answers
|
|
43
|
+
if (showMinimalView && !qrItem) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
41
46
|
return (React.createElement(TableRow, { key: qItem.linkId },
|
|
42
|
-
React.createElement(GridRow, { qItem: qItem, qrItem: qrItem, columnLabels: columnLabels, numOfColumns: numOfColumns, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
|
|
47
|
+
React.createElement(GridRow, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, columnLabels: columnLabels, numOfColumns: numOfColumns, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
|
|
43
48
|
}))));
|
|
44
49
|
}
|
|
45
50
|
export default GridTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"GridTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAiBzD,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EACJ,MAAM,EACN,OAAO,EACP,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IAExE,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;IA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roup } from './GridGroup';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 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
|
+
export { default as GridGroup } from './GridGroup';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
3
|
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
4
|
import type { Tabs } from '../../../interfaces/tab.interface';
|
|
5
|
-
interface GroupItemProps extends PropsWithQrItemChangeHandler
|
|
5
|
+
interface GroupItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
6
6
|
qItem: QuestionnaireItem;
|
|
7
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
8
8
|
groupCardElevation: number;
|
|
9
9
|
tabIsMarkedAsComplete?: boolean;
|
|
10
10
|
tabs?: Tabs;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import React, { useMemo } from 'react';
|
|
18
18
|
import { getQrItemsIndex, mapQItemsIndex } from '../../../utils/mapItem';
|
|
19
|
-
import {
|
|
19
|
+
import { createEmptyQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
|
|
20
20
|
import { QGroupContainerBox } from '../../Box.styles';
|
|
21
21
|
import useHidden from '../../../hooks/useHidden';
|
|
22
22
|
import GroupHeading from './GroupHeading';
|
|
@@ -33,7 +33,7 @@ function GroupItem(props) {
|
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
const qItems = qItem.item;
|
|
36
|
-
const qrGroup = qrItem && qrItem.item ? qrItem :
|
|
36
|
+
const qrGroup = qrItem && qrItem.item ? qrItem : createEmptyQrGroup(qItem);
|
|
37
37
|
const qrItems = qrGroup.item;
|
|
38
38
|
// Event Handlers
|
|
39
39
|
function handleQrItemChange(newQrItem) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GroupItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,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IAAI,GAAI,CAC5D,CACO,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const GroupCard: import("@emotion/styled").StyledComponent<import("@mui/material/Card").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
3
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, "style" | "
|
|
4
|
+
}, "style" | "children" | "className" | "sx" | "classes" | "elevation" | "variant" | "square" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
5
|
elevation: number;
|
|
6
6
|
isRepeated: boolean;
|
|
7
7
|
}, {}, {}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface GroupItemSwitcherProps extends PropsWithQrItemChangeHandler
|
|
4
|
+
interface GroupItemSwitcherProps extends PropsWithQrItemChangeHandler, PropsWithQrRepeatGroupChangeHandler, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
|
-
qrItemOrItems: QuestionnaireResponseItem | QuestionnaireResponseItem[];
|
|
6
|
+
qrItemOrItems: QuestionnaireResponseItem | QuestionnaireResponseItem[] | undefined;
|
|
7
7
|
groupCardElevation: number;
|
|
8
8
|
}
|
|
9
9
|
declare function GroupItemSwitcher(props: GroupItemSwitcherProps): React.JSX.Element | null;
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
|
-
import { isSpecificItemControl } from '../../../utils';
|
|
18
|
+
import { isRepeatItemAndNotCheckbox, isSpecificItemControl } from '../../../utils';
|
|
19
19
|
import GroupTable from '../Tables/GroupTable';
|
|
20
20
|
import RepeatGroup from '../RepeatGroup/RepeatGroup';
|
|
21
|
-
import { isRepeatItemAndNotCheckbox } from '../../../utils/qItem';
|
|
22
21
|
import RepeatItem from '../RepeatItem/RepeatItem';
|
|
23
22
|
import SingleItem from '../SingleItem/SingleItem';
|
|
24
23
|
import useHidden from '../../../hooks/useHidden';
|
|
@@ -48,7 +47,7 @@ function GroupItemSwitcher(props) {
|
|
|
48
47
|
const qrItem = qrItemOrItems;
|
|
49
48
|
const itemIsGrid = isSpecificItemControl(qItem, 'grid');
|
|
50
49
|
if (itemIsGrid) {
|
|
51
|
-
return (React.createElement(GridGroup, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
50
|
+
return (React.createElement(GridGroup, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, groupCardElevation: groupCardElevation, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
52
51
|
}
|
|
53
52
|
const itemRepeatsAndIsNotCheckbox = isRepeatItemAndNotCheckbox(qItem);
|
|
54
53
|
if (itemRepeatsAndIsNotCheckbox) {
|
|
@@ -60,14 +59,14 @@ function GroupItemSwitcher(props) {
|
|
|
60
59
|
}
|
|
61
60
|
return (React.createElement(RepeatGroup, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, parentIsReadOnly: parentIsReadOnly, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
62
61
|
}
|
|
63
|
-
return (React.createElement(RepeatItem, { qItem: qItem, qrItem: qrItem, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
62
|
+
return (React.createElement(RepeatItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
64
63
|
}
|
|
65
64
|
// if qItem is not a repeating question or is a checkbox
|
|
66
65
|
if (qItem.type === 'group') {
|
|
67
|
-
return (React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem, isRepeated: false, groupCardElevation: groupCardElevation + 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
66
|
+
return (React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: false, groupCardElevation: groupCardElevation + 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
68
67
|
}
|
|
69
68
|
// Defaults to a single, non-group item
|
|
70
|
-
return (React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem, isRepeated: false, isTabled: false, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
69
|
+
return (React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: false, isTabled: false, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
71
70
|
}
|
|
72
71
|
export default GroupItemSwitcher;
|
|
73
72
|
//# sourceMappingURL=GroupItemSwitcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx"],"names":[],"mappings":"AAAA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cAAN,MAAM,GAAI,IAAI,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,wDAAwD;IACxD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,OAAO,CACL,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,KAAK,EACjB,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,uCAAuC;IACvC,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface IntegerItemProps extends PropsWithQrItemChangeHandler
|
|
4
|
+
interface IntegerItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
8
8
|
declare function IntegerItem(props: IntegerItemProps): React.JSX.Element;
|
|
9
9
|
export default IntegerItem;
|
|
@@ -18,7 +18,7 @@ import React, { useCallback } from 'react';
|
|
|
18
18
|
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
19
19
|
import useValidationError from '../../../hooks/useValidationError';
|
|
20
20
|
import debounce from 'lodash.debounce';
|
|
21
|
-
import {
|
|
21
|
+
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
22
22
|
import { DEBOUNCE_DURATION } from '../../../utils/debounce';
|
|
23
23
|
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
24
24
|
import IntegerField from './IntegerField';
|
|
@@ -48,7 +48,6 @@ function IntegerItem(props) {
|
|
|
48
48
|
const { calcExpUpdated } = useIntegerCalculatedExpression({
|
|
49
49
|
qItem: qItem,
|
|
50
50
|
inputValue: value,
|
|
51
|
-
displayUnit: displayUnit,
|
|
52
51
|
setInputValue: (newValue) => {
|
|
53
52
|
setValue(newValue);
|
|
54
53
|
},
|
|
@@ -62,7 +61,7 @@ function IntegerItem(props) {
|
|
|
62
61
|
}
|
|
63
62
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
63
|
const updateQrItemWithDebounce = useCallback(debounce((newValue) => {
|
|
65
|
-
onQrItemChange(Object.assign(Object.assign({},
|
|
64
|
+
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueInteger: newValue }] }));
|
|
66
65
|
}, DEBOUNCE_DURATION), [onQrItemChange, qItem, displayUnit]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
|
|
67
66
|
if (isRepeated) {
|
|
68
67
|
return (React.createElement(IntegerField, { linkId: qItem.linkId, value: value, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/IntegerItem/IntegerItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"IntegerItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/IntegerItem/IntegerItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAWrD,SAAS,WAAW,CAAC,KAAuB;IAC1C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAExF,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;I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