@aehrc/smart-forms-renderer 0.7.2 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Alert.styles.d.ts +2 -7
- package/lib/components/Box.styles.d.ts +6 -21
- package/lib/components/FormComponents/BooleanItem/BooleanItem.d.ts +2 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js +5 -4
- 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 +6 -6
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +39 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +17 -29
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +13 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +4 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +17 -24
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +3 -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.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +27 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +14 -29
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +14 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +14 -26
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +11 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +41 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +12 -27
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +13 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +13 -22
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/DateItem/DateItem.d.ts +2 -1
- package/lib/components/FormComponents/DateItem/DateItem.js +5 -4
- package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -1
- package/lib/components/FormComponents/DateItem/DatePicker.d.ts +2 -0
- package/lib/components/FormComponents/DateItem/DatePicker.js +42 -0
- package/lib/components/FormComponents/DateItem/DatePicker.js.map +1 -0
- package/lib/components/FormComponents/DateItem/DatePickerField.d.ts +8 -0
- package/{src/components/FormComponents/Typography.styles.ts → lib/components/FormComponents/DateItem/DatePickerField.js} +8 -9
- package/lib/components/FormComponents/DateItem/DatePickerField.js.map +1 -0
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.d.ts +2 -2
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +5 -4
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.d.ts +2 -2
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +5 -4
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.d.ts +1 -0
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +2 -2
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js.map +1 -1
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.d.ts +2 -7
- package/lib/components/FormComponents/DisplayItem/DisplayItem.js +2 -2
- package/lib/components/FormComponents/DisplayItem/DisplayItem.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridGroup.d.ts +2 -2
- package/lib/components/FormComponents/GridGroup/GridGroup.js +6 -4
- package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridRow.d.ts +2 -1
- package/lib/components/FormComponents/GridGroup/GridRow.js +2 -2
- package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridTable.d.ts +2 -1
- package/lib/components/FormComponents/GridGroup/GridTable.js +2 -2
- package/lib/components/FormComponents/GridGroup/GridTable.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupHeading.d.ts +1 -0
- package/lib/components/FormComponents/GroupItem/GroupHeading.js +6 -5
- package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +2 -3
- package/lib/components/FormComponents/GroupItem/GroupItem.js +5 -3
- package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.styles.d.ts +2 -6
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +12 -12
- 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 +5 -4
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/Item.styles.d.ts +2 -6
- package/lib/components/FormComponents/Item.styles.js +2 -6
- package/lib/components/FormComponents/Item.styles.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +3 -3
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js +4 -6
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +2 -2
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js.map +1 -0
- package/lib/components/FormComponents/Lists.styles.d.ts +2 -9
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +21 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +48 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js +2 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +16 -39
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +17 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +42 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +27 -39
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +6 -6
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +15 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +29 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +10 -29
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +12 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +14 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +2 -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 +23 -27
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +13 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +16 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +13 -18
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +8 -6
- 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 +5 -3
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/AddItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatItem/AddItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatItem/AddItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatField.d.ts +2 -2
- package/lib/components/FormComponents/RepeatItem/RepeatField.js +5 -3
- package/lib/components/FormComponents/RepeatItem/RepeatField.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +2 -2
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js +6 -5
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.d.ts +4 -18
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItem.js +4 -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 +12 -12
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringItem.d.ts +2 -2
- package/lib/components/FormComponents/StringItem/StringItem.js +5 -4
- package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
- package/lib/components/FormComponents/Tables/AddItemButton.d.ts +8 -0
- package/lib/components/FormComponents/Tables/AddItemButton.js +28 -0
- package/lib/components/FormComponents/Tables/AddItemButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/AddRowButton.d.ts +9 -0
- package/lib/components/FormComponents/Tables/AddRowButton.js +28 -0
- package/lib/components/FormComponents/Tables/AddRowButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/DeleteRowButton.d.ts +1 -0
- package/lib/components/FormComponents/Tables/DeleteRowButton.js +2 -2
- package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTable.d.ts +10 -0
- package/lib/components/FormComponents/Tables/GroupTable.js +110 -0
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +11 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.js +46 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -0
- package/lib/components/FormComponents/Tables/QItemGroupTable.js +5 -7
- package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +1 -1
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +2 -2
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +1 -1
- package/lib/components/FormComponents/Tables/index.d.ts +1 -1
- package/lib/components/FormComponents/Tables/index.js +1 -1
- package/lib/components/FormComponents/Tables/index.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextItem.d.ts +2 -2
- package/lib/components/FormComponents/TextItem/TextItem.js +5 -4
- 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 +5 -4
- 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 +5 -4
- package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
- package/lib/components/Lists.styles.d.ts +2 -9
- package/lib/components/Renderer/FormBodyTabbed.js +1 -1
- package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
- package/lib/components/Renderer/FormTopLevelItem.js +7 -5
- package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
- package/lib/components/Tabs/FormBodySingleTab.js +1 -1
- package/lib/components/Tabs/FormBodyTabList.d.ts +1 -0
- package/lib/components/Tabs/FormBodyTabList.js +3 -4
- package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
- package/lib/components/Tabs/FormBodyTabListWrapper.d.ts +1 -1
- package/lib/components/Tabs/FormBodyTabListWrapper.js +6 -13
- package/lib/components/Tabs/FormBodyTabListWrapper.js.map +1 -1
- package/lib/components/Tabs/ShowCompletedTabsSection.d.ts +7 -0
- package/lib/components/Tabs/ShowCompletedTabsSection.js +34 -0
- package/lib/components/Tabs/ShowCompletedTabsSection.js.map +1 -0
- package/lib/hooks/useContextDisplayItems.d.ts +6 -0
- package/lib/hooks/useContextDisplayItems.js +30 -0
- package/lib/hooks/useContextDisplayItems.js.map +1 -0
- package/lib/hooks/useInitialiseRenderer.js +2 -2
- package/lib/hooks/useInitialiseRenderer.js.map +1 -1
- package/lib/hooks/useInitialiseRepeatGroups.d.ts +1 -1
- package/lib/hooks/useMinimalStringCalculatedExpression.d.ts +11 -0
- package/lib/hooks/useMinimalStringCalculatedExpression.js +37 -0
- package/lib/hooks/useMinimalStringCalculatedExpression.js.map +1 -0
- package/lib/hooks/useNumberInput.d.ts +1 -1
- package/lib/hooks/useNumberInput.js.map +1 -1
- package/lib/hooks/useReadOnly.d.ts +3 -0
- package/lib/hooks/useReadOnly.js +26 -0
- package/lib/hooks/useReadOnly.js.map +1 -0
- package/lib/hooks/useStringInput.d.ts +1 -1
- package/lib/hooks/useStringInput.js.map +1 -1
- package/lib/hooks/useTerminologyServerQuery.js +3 -6
- package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/interfaces/calculatedExpression.interface.d.ts +1 -1
- package/lib/interfaces/renderProps.interface.d.ts +6 -0
- package/lib/stores/useQuestionnaireResponseStore.d.ts +2 -1
- package/lib/stores/useQuestionnaireResponseStore.js +5 -3
- package/lib/stores/useQuestionnaireResponseStore.js.map +1 -1
- package/lib/theme/overrides/Typography.d.ts +13 -0
- package/lib/theme/overrides/Typography.js +31 -0
- package/lib/theme/overrides/Typography.js.map +1 -0
- package/lib/theme/typography.d.ts +0 -2
- package/lib/theme/typography.js +3 -5
- package/lib/theme/typography.js.map +1 -1
- package/lib/utils/calculatedExpression.d.ts +12 -0
- package/lib/utils/calculatedExpression.js +54 -8
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/qrItem.d.ts +2 -3
- package/lib/utils/qrItem.js +2 -3
- package/lib/utils/qrItem.js.map +1 -1
- package/lib/utils/repopulateIntoResponse.d.ts +2 -2
- package/lib/utils/repopulateItems.js +0 -1
- package/lib/utils/repopulateItems.js.map +1 -1
- package/package.json +15 -15
- package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +8 -5
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +9 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +85 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +48 -60
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +79 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +50 -52
- package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +24 -9
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +48 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +32 -59
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +83 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +37 -56
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +82 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +30 -60
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +98 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +33 -66
- package/src/components/FormComponents/DateItem/DateItem.tsx +8 -6
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +8 -6
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +7 -5
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +6 -2
- package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +2 -2
- package/src/components/FormComponents/GridGroup/GridGroup.tsx +13 -5
- package/src/components/FormComponents/GridGroup/GridRow.tsx +6 -2
- package/src/components/FormComponents/GridGroup/GridTable.tsx +6 -2
- package/src/components/FormComponents/GroupItem/GroupHeading.tsx +12 -6
- package/src/components/FormComponents/GroupItem/GroupItem.tsx +8 -2
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +31 -8
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +7 -5
- package/src/components/FormComponents/Item.styles.ts +2 -7
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +4 -3
- package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +10 -5
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +3 -2
- package/src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx +72 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +137 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +50 -99
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +112 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +72 -80
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +17 -5
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +72 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +23 -67
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +60 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +50 -69
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +69 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +33 -56
- package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +17 -9
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +13 -2
- package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatItem/DeleteItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatItem/RepeatField.tsx +21 -3
- package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +13 -6
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +12 -3
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +21 -3
- package/src/components/FormComponents/StringItem/StringItem.tsx +7 -5
- package/src/components/FormComponents/Tables/AddRowButton.tsx +50 -0
- package/src/components/FormComponents/Tables/DeleteRowButton.tsx +3 -2
- package/src/components/FormComponents/Tables/{QItemGroupTable.tsx → GroupTable.tsx} +22 -22
- package/src/components/FormComponents/Tables/{QItemGroupTableRow.tsx → GroupTableRow.tsx} +8 -4
- package/src/components/FormComponents/Tables/index.ts +1 -1
- package/src/components/FormComponents/TextItem/TextItem.tsx +7 -5
- package/src/components/FormComponents/TimeItem/TimeItem.tsx +8 -6
- package/src/components/FormComponents/UrlItem/UrlItem.tsx +7 -5
- package/src/components/Renderer/FormBodyTabbed.tsx +1 -1
- package/src/components/Renderer/FormTopLevelItem.tsx +9 -4
- package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
- package/src/components/Tabs/FormBodyTabList.tsx +5 -8
- package/src/components/Tabs/FormBodyTabListWrapper.tsx +15 -26
- package/src/components/Tabs/ShowCompletedTabsSection.tsx +52 -0
- package/src/hooks/useContextDisplayItems.ts +40 -0
- package/src/hooks/useInitialiseRenderer.ts +2 -2
- package/src/hooks/useInitialiseRepeatGroups.ts +1 -1
- package/src/hooks/useNumberInput.ts +2 -1
- package/src/hooks/useReadOnly.ts +30 -0
- package/src/hooks/useStringInput.ts +2 -1
- package/src/hooks/useTerminologyServerQuery.ts +3 -6
- package/src/index.ts +2 -2
- package/src/interfaces/calculatedExpression.interface.ts +1 -1
- package/src/interfaces/renderProps.interface.ts +8 -0
- package/src/stores/useQuestionnaireResponseStore.ts +5 -4
- package/src/theme/typography.ts +3 -5
- package/src/utils/calculatedExpression.ts +68 -12
- package/src/utils/qrItem.ts +4 -3
- package/src/utils/repopulateIntoResponse.ts +2 -2
- package/src/utils/repopulateItems.ts +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
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 React, { useMemo, useState } from 'react';
|
|
18
|
+
import Divider from '@mui/material/Divider';
|
|
19
|
+
import Paper from '@mui/material/Paper';
|
|
20
|
+
import Table from '@mui/material/Table';
|
|
21
|
+
import TableBody from '@mui/material/TableBody';
|
|
22
|
+
import TableCell from '@mui/material/TableCell';
|
|
23
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
24
|
+
import TableHead from '@mui/material/TableHead';
|
|
25
|
+
import TableRow from '@mui/material/TableRow';
|
|
26
|
+
import Typography from '@mui/material/Typography';
|
|
27
|
+
import GroupTableRow from './GroupTableRow';
|
|
28
|
+
import { HeaderTableCell } from './Table.styles';
|
|
29
|
+
import { QGroupContainerBox } from '../../Box.styles';
|
|
30
|
+
import { mapQItemsIndex } from '../../../utils/mapItem';
|
|
31
|
+
import useInitialiseGroupTable from '../../../hooks/useInitialiseGroupTable';
|
|
32
|
+
import { nanoid } from 'nanoid';
|
|
33
|
+
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
34
|
+
import DeleteRowButton from './DeleteRowButton';
|
|
35
|
+
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
36
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
37
|
+
import AddRowButton from './AddRowButton';
|
|
38
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
39
|
+
function GroupTable(props) {
|
|
40
|
+
const { qItem, qrItems, groupCardElevation, parentIsReadOnly, onQrRepeatGroupChange } = props;
|
|
41
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
42
|
+
const initialisedGroupTables = useInitialiseGroupTable(qrItems);
|
|
43
|
+
const [tableRows, setTableRows] = useState(initialisedGroupTables);
|
|
44
|
+
// Generate item labels as table headers
|
|
45
|
+
const qItems = qItem.item;
|
|
46
|
+
const itemLabels = useMemo(() => { var _a; return (_a = qItems === null || qItems === void 0 ? void 0 : qItems.map((item) => { var _a; return (_a = item.text) !== null && _a !== void 0 ? _a : ''; })) !== null && _a !== void 0 ? _a : []; }, [qItems]);
|
|
47
|
+
const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
|
|
48
|
+
// Check if there are columns within the group table
|
|
49
|
+
if (!qItems || qItems.length === 0) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
// Event Handlers
|
|
53
|
+
function handleRowChange(newQrRow, index) {
|
|
54
|
+
const updatedTableRows = [...tableRows];
|
|
55
|
+
if (newQrRow.item) {
|
|
56
|
+
updatedTableRows[index].qrItem = {
|
|
57
|
+
linkId: newQrRow.linkId,
|
|
58
|
+
text: newQrRow.text,
|
|
59
|
+
item: newQrRow.item
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
setTableRows(updatedTableRows);
|
|
63
|
+
onQrRepeatGroupChange({
|
|
64
|
+
linkId: qItem.linkId,
|
|
65
|
+
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [cloneDeep(singleRow.qrItem)] : [])
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function handleDeleteRow(index) {
|
|
69
|
+
const updatedTableRows = [...tableRows];
|
|
70
|
+
updatedTableRows.splice(index, 1);
|
|
71
|
+
setTableRows(updatedTableRows);
|
|
72
|
+
onQrRepeatGroupChange({
|
|
73
|
+
linkId: qItem.linkId,
|
|
74
|
+
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [cloneDeep(singleRow.qrItem)] : [])
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function handleAddRow() {
|
|
78
|
+
setTableRows([
|
|
79
|
+
...tableRows,
|
|
80
|
+
{
|
|
81
|
+
nanoId: nanoid(),
|
|
82
|
+
qrItem: null
|
|
83
|
+
}
|
|
84
|
+
]);
|
|
85
|
+
}
|
|
86
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
|
|
87
|
+
groupCardElevation !== 1 ? (React.createElement(React.Fragment, null,
|
|
88
|
+
React.createElement(Typography, { fontSize: 13, variant: "h6", color: readOnly ? 'text.secondary' : 'text.primary' },
|
|
89
|
+
React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
|
|
90
|
+
React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
|
|
91
|
+
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
92
|
+
React.createElement(Table, null,
|
|
93
|
+
React.createElement("caption", null,
|
|
94
|
+
React.createElement(AddRowButton, { repeatGroups: tableRows, readOnly: readOnly, onAddItem: handleAddRow })),
|
|
95
|
+
React.createElement(TableHead, null,
|
|
96
|
+
React.createElement(TableRow, null,
|
|
97
|
+
itemLabels.map((itemLabel) => (React.createElement(HeaderTableCell, { key: itemLabel }, itemLabel))),
|
|
98
|
+
React.createElement(TableCell, null))),
|
|
99
|
+
React.createElement(TableBody, null, tableRows.map(({ nanoId, qrItem: nullableQrItem }, index) => {
|
|
100
|
+
const answeredQrItem = createEmptyQrItem(qItem);
|
|
101
|
+
if (nullableQrItem) {
|
|
102
|
+
answeredQrItem.item = nullableQrItem.item;
|
|
103
|
+
}
|
|
104
|
+
return (React.createElement(TableRow, { key: nanoId },
|
|
105
|
+
React.createElement(GroupTableRow, { qItem: qItem, qrItem: answeredQrItem, qItemsIndexMap: qItemsIndexMap, parentIsReadOnly: parentIsReadOnly, onQrItemChange: (newQrGroup) => handleRowChange(newQrGroup, index) }),
|
|
106
|
+
React.createElement(DeleteRowButton, { nullableQrItem: nullableQrItem, numOfRows: tableRows.length, readOnly: readOnly, onDeleteItem: () => handleDeleteRow(index) })));
|
|
107
|
+
}))))));
|
|
108
|
+
}
|
|
109
|
+
export default GroupTable;
|
|
110
|
+
//# sourceMappingURL=GroupTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,MAAM,qBAAqB,C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AAS;oBACR,oBAAC,QAAQ;wBACN,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAC7B,oBAAC,eAAe,IAAC,GAAG,EAAE,SAAS,IAAG,SAAS,CAAmB,CAC/D,CAAC;wBACF,oBAAC,SAAS,OAAG,CACJ,CACD;gBACZ,oBAAC,SAAS,QACP,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,EAAE;oBAC3D,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;oBAChD,IAAI,cAAc,EAAE;wBAClB,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;qBAC3C;oBAED,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM;wBACnB,oBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,GAClE;wBACF,oBAAC,eAAe,IACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,CAAC,MAAM,EAC3B,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,GAC1C,CACO,CACZ,CAAC;gBACJ,CAAC,CAAC,CACQ,CACN,CACO,CACE,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
import type { PropsWithParentIsReadOnlyAttribute } from '../../../interfaces/renderProps.interface';
|
|
5
|
+
interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithParentIsReadOnlyAttribute {
|
|
6
|
+
qItem: QuestionnaireItem;
|
|
7
|
+
qrItem: QuestionnaireResponseItem;
|
|
8
|
+
qItemsIndexMap: Record<string, number>;
|
|
9
|
+
}
|
|
10
|
+
declare function GroupTableRow(props: Props): React.JSX.Element | null;
|
|
11
|
+
export default GroupTableRow;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 React from 'react';
|
|
18
|
+
import { createQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
|
|
19
|
+
import SingleItem from '../SingleItem/SingleItem';
|
|
20
|
+
import { getQrItemsIndex } from '../../../utils/mapItem';
|
|
21
|
+
import { StandardTableCell } from './Table.styles';
|
|
22
|
+
function GroupTableRow(props) {
|
|
23
|
+
const { qItem, qrItem, qItemsIndexMap, parentIsReadOnly, onQrItemChange } = props;
|
|
24
|
+
const rowItems = qItem.item;
|
|
25
|
+
const row = qrItem && qrItem.item ? qrItem : createQrGroup(qItem);
|
|
26
|
+
const rowQrItems = row.item;
|
|
27
|
+
if (!rowItems || !rowQrItems) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function handleQrRowItemChange(newQrRowItem) {
|
|
31
|
+
const qrRow = Object.assign({}, row);
|
|
32
|
+
updateQrItemsInGroup(newQrRowItem, null, qrRow, qItemsIndexMap);
|
|
33
|
+
onQrItemChange(qrRow);
|
|
34
|
+
}
|
|
35
|
+
const qrItemsByIndex = getQrItemsIndex(rowItems, rowQrItems, qItemsIndexMap);
|
|
36
|
+
return (React.createElement(React.Fragment, null, rowItems.map((rowItem, index) => {
|
|
37
|
+
const qrItem = qrItemsByIndex[index];
|
|
38
|
+
if (Array.isArray(qrItem)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return (React.createElement(StandardTableCell, { key: index, numOfColumns: rowItems.length, isFirst: index === 0 },
|
|
42
|
+
React.createElement(SingleItem, { key: qItem.linkId, qItem: rowItem, qrItem: qrItem, isRepeated: true, isTabled: true, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleQrRowItemChange })));
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
export default GroupTableRow;
|
|
46
|
+
//# sourceMappingURL=GroupTableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAYnD,SAAS,aAAa,CAAC,KAAY;IACjC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,C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CAAC"}
|
|
@@ -36,7 +36,6 @@ import { nanoid } from 'nanoid';
|
|
|
36
36
|
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
37
37
|
import DeleteRowButton from './DeleteRowButton';
|
|
38
38
|
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
39
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
40
39
|
function QItemGroupTable(props) {
|
|
41
40
|
const { qItem, qrItems, groupCardElevation, onQrRepeatGroupChange } = props;
|
|
42
41
|
const initialisedGroupTables = useInitialiseGroupTable(qrItems);
|
|
@@ -62,7 +61,7 @@ function QItemGroupTable(props) {
|
|
|
62
61
|
setTableRows(updatedTableRows);
|
|
63
62
|
onQrRepeatGroupChange({
|
|
64
63
|
linkId: qItem.linkId,
|
|
65
|
-
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [
|
|
64
|
+
qrItems: updatedTableRows.flatMap((singleRow) => (singleRow.qrItem ? [singleRow.qrItem] : []))
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
function handleDeleteRow(index) {
|
|
@@ -71,7 +70,7 @@ function QItemGroupTable(props) {
|
|
|
71
70
|
setTableRows(updatedTableRows);
|
|
72
71
|
onQrRepeatGroupChange({
|
|
73
72
|
linkId: qItem.linkId,
|
|
74
|
-
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [
|
|
73
|
+
qrItems: updatedTableRows.flatMap((singleRow) => (singleRow.qrItem ? [singleRow.qrItem] : []))
|
|
75
74
|
});
|
|
76
75
|
}
|
|
77
76
|
function handleAddRow() {
|
|
@@ -84,10 +83,9 @@ function QItemGroupTable(props) {
|
|
|
84
83
|
]);
|
|
85
84
|
}
|
|
86
85
|
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
|
|
87
|
-
|
|
88
|
-
React.createElement(
|
|
89
|
-
|
|
90
|
-
React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
|
|
86
|
+
React.createElement(Typography, { fontSize: 13, variant: "h6" },
|
|
87
|
+
React.createElement(LabelWrapper, { qItem: qItem })),
|
|
88
|
+
React.createElement(Divider, { sx: { my: 1 }, light: true }),
|
|
91
89
|
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
92
90
|
React.createElement(Table, null,
|
|
93
91
|
React.createElement("caption", null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QItemGroupTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,uBAAuB,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,iBAA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16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
|
-
import { createQrGroup,
|
|
18
|
+
import { createQrGroup, updateQrGroup } from '../../../utils/qrItem';
|
|
19
19
|
import SingleItem from '../SingleItem/SingleItem';
|
|
20
20
|
import { getQrItemsIndex } from '../../../utils/mapItem';
|
|
21
21
|
import { StandardTableCell } from './Table.styles';
|
|
@@ -29,7 +29,7 @@ function QItemGroupTableRow(props) {
|
|
|
29
29
|
}
|
|
30
30
|
function handleQrRowItemChange(newQrRowItem) {
|
|
31
31
|
const qrRow = Object.assign({}, row);
|
|
32
|
-
|
|
32
|
+
updateQrGroup(newQrRowItem, null, qrRow, qItemsIndexMap);
|
|
33
33
|
onQrItemChange(qrRow);
|
|
34
34
|
}
|
|
35
35
|
const qrItemsByIndex = getQrItemsIndex(rowItems, rowQrItems, qItemsIndexMap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QItemGroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"QItemGroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnD,SAAS,kBAAkB,CAAC,KAAY;IACtC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,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@ -1 +1 @@
|
|
|
1
|
-
export { default as GroupTable } from './
|
|
1
|
+
export { default as GroupTable } from './GroupTable';
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
export { default as GroupTable } from './
|
|
17
|
+
export { default as GroupTable } from './GroupTable';
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface TextItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
|
|
4
|
+
interface TextItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem;
|
|
7
7
|
}
|
|
@@ -25,10 +25,11 @@ import TextField from './TextField';
|
|
|
25
25
|
import useStringCalculatedExpression from '../../../hooks/useStringCalculatedExpression';
|
|
26
26
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
27
27
|
import useStringInput from '../../../hooks/useStringInput';
|
|
28
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
28
29
|
function TextItem(props) {
|
|
29
|
-
const { qItem, qrItem, isRepeated, onQrItemChange } = props;
|
|
30
|
-
|
|
31
|
-
const { displayUnit, displayPrompt, displayInstructions,
|
|
30
|
+
const { qItem, qrItem, isRepeated, parentIsReadOnly, onQrItemChange } = props;
|
|
31
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
32
|
+
const { displayUnit, displayPrompt, displayInstructions, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
|
|
32
33
|
// Init input value
|
|
33
34
|
let valueText = '';
|
|
34
35
|
if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueString)) {
|
|
@@ -65,7 +66,7 @@ function TextItem(props) {
|
|
|
65
66
|
return (React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }));
|
|
66
67
|
}
|
|
67
68
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-text-box" },
|
|
68
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
|
|
69
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
69
70
|
React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }))));
|
|
70
71
|
}
|
|
71
72
|
export default TextItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAO3C,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,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,6BAA6B,MAAM,8CAA8C,CAAC;AACzF,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAUrD,SAAS,QAAQ,CAAC,KAAoB;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE9E,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,EACJ,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,SAAS,EACV,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAElC,mBAAmB;IACnB,IAAI,SAAS,GAAG,EAAE,CAAC;I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AoF;IAEvF,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,SAAS,IACR,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,iBAAiB,GAChC,CACH,CAAC;KACH;IACD,OAAO,CACL,oBAAC,yBAAyB,iBAAW,iBAAiB;QACpD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;YACvF,oBAAC,SAAS,IACR,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,iBAAiB,GAChC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface TimeItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
|
|
4
|
+
interface TimeItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem;
|
|
7
7
|
}
|
|
@@ -21,10 +21,11 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
|
21
21
|
import TimeField from './TimeField';
|
|
22
22
|
import dayjs from 'dayjs';
|
|
23
23
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
24
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
24
25
|
function TimeItem(props) {
|
|
25
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
26
|
-
|
|
27
|
-
const { displayPrompt, displayInstructions,
|
|
26
|
+
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
27
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
28
|
+
const { displayPrompt, displayInstructions, entryFormat } = useRenderingExtensions(qItem);
|
|
28
29
|
// Init input value
|
|
29
30
|
let timeString = null;
|
|
30
31
|
if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueTime)) {
|
|
@@ -45,7 +46,7 @@ function TimeItem(props) {
|
|
|
45
46
|
return (React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }));
|
|
46
47
|
}
|
|
47
48
|
return (React.createElement(FullWidthFormComponentBox, null,
|
|
48
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
|
|
49
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
49
50
|
React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }))));
|
|
50
51
|
}
|
|
51
52
|
export default TimeItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAWrD,SAAS,QAAQ,CAAC,KAAoB;IACpC,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;IACtD,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAE1F,mBAAmB;IACnB,IAAI,UAAU,GAAkB,IAAI,CAAC;IACrC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,CAAC,EAAE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../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface UrlItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
|
|
4
|
+
interface UrlItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem;
|
|
7
7
|
}
|
|
@@ -23,10 +23,11 @@ import { DEBOUNCE_DURATION } from '../../../utils/debounce';
|
|
|
23
23
|
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
24
24
|
import UrlField from './UrlField';
|
|
25
25
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
26
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
26
27
|
function UrlItem(props) {
|
|
27
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
28
|
-
|
|
29
|
-
const { displayUnit, displayPrompt, displayInstructions,
|
|
28
|
+
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
29
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
30
|
+
const { displayUnit, displayPrompt, displayInstructions, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
|
|
30
31
|
// Init input value
|
|
31
32
|
let valueUri = '';
|
|
32
33
|
if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueUri)) {
|
|
@@ -54,7 +55,7 @@ function UrlItem(props) {
|
|
|
54
55
|
return (React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }));
|
|
55
56
|
}
|
|
56
57
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-string-box" },
|
|
57
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
|
|
58
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
58
59
|
React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }))));
|
|
59
60
|
}
|
|
60
61
|
export default UrlItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UrlItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQrD,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,C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E,EAAE;YAChB,cAAc,iCAAM,WAAW,KAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,IAAG,CAAC;SACnE;aAAM;YACL,cAAc,CAAC,WAAW,CAAC,CAAC;SAC7B;IACH,CAAC,EAAE,iBAAiB,CAAC,EACrB,CAAC,cAAc,EAAE,KAAK,CAAC,CACxB,CAAC,CAAC,oFAAoF;IAEvF,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,QAAQ,IACP,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,YAAY,EAC3B,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;KACH;IACD,OAAO,CACL,oBAAC,yBAAyB,iBAAW,mBAAmB;QACtD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;YACvF,oBAAC,QAAQ,IACP,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,YAAY,EAC3B,QAAQ,EAAE,QAAQ,GAClB,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const PrimarySelectableList: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
children?: import("react").ReactNode;
|
|
4
|
-
classes?: Partial<import("@mui/material/List").ListClasses> | undefined;
|
|
5
|
-
dense?: boolean | undefined;
|
|
6
|
-
disablePadding?: boolean | undefined;
|
|
7
|
-
subheader?: import("react").ReactNode;
|
|
8
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
9
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & {
|
|
2
|
+
export declare const PrimarySelectableList: import("@emotion/styled").StyledComponent<import("@mui/material/List").ListOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & {
|
|
10
3
|
ref?: ((instance: HTMLUListElement | null) => void) | import("react").RefObject<HTMLUListElement> | null | undefined;
|
|
11
|
-
}, "children" | "sx" | "
|
|
4
|
+
}, "style" | "className" | "children" | "sx" | "classes" | "dense" | "disablePadding" | "subheader"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -41,7 +41,7 @@ function FormBodyTabbed(props) {
|
|
|
41
41
|
return (React.createElement(Grid, { container: true, spacing: 2 },
|
|
42
42
|
React.createElement(TabContext, { value: currentTab.toString() },
|
|
43
43
|
React.createElement(Grid, { item: true, xs: 12, md: 3.5, lg: 3, xl: 2.75 },
|
|
44
|
-
React.createElement(FormBodyTabListWrapper, {
|
|
44
|
+
React.createElement(FormBodyTabListWrapper, { topLevelItems: qItems, currentTabIndex: currentTab, tabs: tabs })),
|
|
45
45
|
React.createElement(Grid, { item: true, xs: 12, md: 8.5, lg: 9, xl: 9.25 }, qItems.map((qItem, i) => {
|
|
46
46
|
var _a, _b;
|
|
47
47
|
const qrItem = qrItemsByIndex[i];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodyTabbed.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyTabbed.tsx"],"names":[],"mappings":"AAAA;;;;;;;;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MAAM,CAAC,CAAC;gBAEnC,IAAI,CAAC,KAAK,IAAI,CAAC,gBAAgB,EAAE;oBAC/B,oCAAoC;oBACpC,OAAO,IAAI,CAAC;iBACb;gBAED,MAAM,UAAU,GAAG,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC;gBAC1C,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,mCAAI,KAAK,CAAC;gBAErE,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,eACT,oBAAoB;oBAC9B,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,UAAU,EAC3B,cAAc,EAAE,mBAAmB,GACnC,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -23,12 +23,14 @@ import FormBodyCollapsible from './FormBodyCollapsible';
|
|
|
23
23
|
import useResponsive from '../../hooks/useResponsive';
|
|
24
24
|
import useHidden from '../../hooks/useHidden';
|
|
25
25
|
import GroupItemSwitcher from '../FormComponents/GroupItem/GroupItemSwitcher';
|
|
26
|
+
import useReadOnly from '../../hooks/useReadOnly';
|
|
26
27
|
function FormTopLevelItem(props) {
|
|
27
28
|
const { topLevelQItem, topLevelQRItemOrItems, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
28
29
|
const itemIsTabContainer = isTabContainer(topLevelQItem);
|
|
29
30
|
const itemContainsTabs = containsTabs(topLevelQItem);
|
|
30
|
-
const
|
|
31
|
+
const isTablet = useResponsive('up', 'md');
|
|
31
32
|
const itemIsGroup = topLevelQItem.type === 'group';
|
|
33
|
+
const readOnly = useReadOnly(topLevelQItem, false);
|
|
32
34
|
const itemIsHidden = useHidden(topLevelQItem);
|
|
33
35
|
if (itemIsHidden) {
|
|
34
36
|
return null;
|
|
@@ -36,23 +38,23 @@ function FormTopLevelItem(props) {
|
|
|
36
38
|
// If item has multiple answers, use a group item switcher to determine how to render it.
|
|
37
39
|
const hasMultipleAnswers = Array.isArray(topLevelQRItemOrItems);
|
|
38
40
|
if (hasMultipleAnswers) {
|
|
39
|
-
return (React.createElement(GroupItemSwitcher, { qItem: topLevelQItem, qrItemOrItems: topLevelQRItemOrItems, groupCardElevation: 1, onQrItemChange: onQrItemChange, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
41
|
+
return (React.createElement(GroupItemSwitcher, { qItem: topLevelQItem, qrItemOrItems: topLevelQRItemOrItems, groupCardElevation: 1, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
40
42
|
}
|
|
41
43
|
// At this point, item only has one answer
|
|
42
44
|
const topLevelQRItem = topLevelQRItemOrItems;
|
|
43
45
|
// If form is tabbed, it is rendered as a tabbed form
|
|
44
46
|
if (itemContainsTabs || itemIsTabContainer) {
|
|
45
|
-
if (
|
|
47
|
+
if (isTablet) {
|
|
46
48
|
return (React.createElement(FormBodyTabbed, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, onQrItemChange: onQrItemChange }));
|
|
47
49
|
}
|
|
48
50
|
return (React.createElement(FormBodyCollapsible, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, onQrItemChange: onQrItemChange }));
|
|
49
51
|
}
|
|
50
52
|
// If form is untabbed, it is rendered as a regular group
|
|
51
53
|
if (itemIsGroup) {
|
|
52
|
-
return (React.createElement(GroupItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, groupCardElevation: 1,
|
|
54
|
+
return (React.createElement(GroupItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, groupCardElevation: 1, isRepeated: false, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
53
55
|
}
|
|
54
56
|
// Otherwise, it is rendered as a non-group item
|
|
55
|
-
return (React.createElement(SingleItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, isTabled: false,
|
|
57
|
+
return (React.createElement(SingleItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, isRepeated: false, isTabled: false, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
56
58
|
}
|
|
57
59
|
export default FormTopLevelItem;
|
|
58
60
|
//# sourceMappingURL=FormTopLevelItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormTopLevelItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTopLevelItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,UAAU,MAAM,yCAAyC,CAAC;AAKjE,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAC9C,OAAO,iBAAiB,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"FormTopLevelItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTopLevelItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AA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,CACH,CAAC;KACH;IAED,0CAA0C;IAC1C,MAAM,cAAc,GAAG,qBAAqB,CAAC;IAE7C,qDAAqD;IACrD,IAAI,gBAAgB,IAAI,kBAAkB,EAAE;QAC1C,IAAI,QAAQ,EAAE;YACZ,OAAO,CACL,oBAAC,cAAc,IACb,GAAG,EAAE,aAAa,CAAC,MAAM,EACzB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;SACH;QAED,OAAO,CACL,oBAAC,mBAAmB,IAClB,GAAG,EAAE,aAAa,CAAC,MAAM,EACzB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,yDAAyD;IACzD,IAAI,WAAW,EAAE;QACf,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,aAAa,CAAC,MAAM,EACzB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,CAAC,EACrB,UAAU,EAAE,KAAK,EACjB,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,gDAAgD;IAChD,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,aAAa,CAAC,MAAM,EACzB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -29,7 +29,7 @@ const FormBodySingleTab = memo(function FormBodySingleTab(props) {
|
|
|
29
29
|
window.scrollTo(0, 0);
|
|
30
30
|
}
|
|
31
31
|
return (React.createElement(React.Fragment, null,
|
|
32
|
-
React.createElement(ListItemButton, { selected: selected, sx: { my: 0.
|
|
32
|
+
React.createElement(ListItemButton, { selected: selected, sx: { my: 0.1, minHeight: '36px' }, onClick: handleTabClick },
|
|
33
33
|
React.createElement(ListItemText, { primary: React.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "space-between" },
|
|
34
34
|
React.createElement(Typography, { variant: "subtitle2" }, tabLabel),
|
|
35
35
|
React.createElement(Box, { display: "flex", minHeight: 24, minWidth: 24, ml: 1 }, contextDisplayItems.map((item) => {
|
|
@@ -6,6 +6,7 @@ interface FormBodyTabListProps {
|
|
|
6
6
|
currentTabIndex: number;
|
|
7
7
|
tabs: Tabs;
|
|
8
8
|
completedTabsCollapsed: boolean;
|
|
9
|
+
allContextDisplayItems: QuestionnaireItem[][];
|
|
9
10
|
}
|
|
10
11
|
declare const FormBodyTabList: React.NamedExoticComponent<FormBodyTabListProps>;
|
|
11
12
|
export default FormBodyTabList;
|
|
@@ -14,19 +14,18 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import React, { memo
|
|
17
|
+
import React, { memo } from 'react';
|
|
18
18
|
import Collapse from '@mui/material/Collapse';
|
|
19
19
|
import { TransitionGroup } from 'react-transition-group';
|
|
20
20
|
import { getShortText } from '../../utils/itemControl';
|
|
21
21
|
import FormBodySingleTab from './FormBodySingleTab';
|
|
22
22
|
import useQuestionnaireStore from '../../stores/useQuestionnaireStore';
|
|
23
|
-
import {
|
|
23
|
+
import { isTabHidden } from '../../utils/tabs';
|
|
24
24
|
const FormBodyTabList = memo(function FormBodyTabList(props) {
|
|
25
|
-
const { topLevelItems, currentTabIndex, tabs, completedTabsCollapsed } = props;
|
|
25
|
+
const { topLevelItems, currentTabIndex, tabs, completedTabsCollapsed, allContextDisplayItems } = props;
|
|
26
26
|
const enableWhenIsActivated = useQuestionnaireStore((state) => state.enableWhenIsActivated);
|
|
27
27
|
const enableWhenItems = useQuestionnaireStore((state) => state.enableWhenItems);
|
|
28
28
|
const enableWhenExpressions = useQuestionnaireStore((state) => state.enableWhenExpressions);
|
|
29
|
-
const allContextDisplayItems = useMemo(() => topLevelItems.map((topLevelItem) => getContextDisplays(topLevelItem)), [topLevelItems]);
|
|
30
29
|
return (React.createElement(TransitionGroup, null, topLevelItems.map((qItem, i) => {
|
|
31
30
|
var _a, _b;
|
|
32
31
|
const contextDisplayItems = allContextDisplayItems[i];
|