@aehrc/smart-forms-renderer 0.4.0 → 0.5.0
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/FormRenderer/SmartFormsRenderer.js +4 -2
- package/lib/components/FormRenderer/SmartFormsRenderer.js.map +1 -1
- package/lib/theme/Theme.d.ts +38 -0
- package/lib/theme/Theme.js +39 -0
- package/lib/theme/Theme.js.map +1 -0
- package/lib/theme/globalStyles.d.ts +2 -0
- package/lib/theme/globalStyles.js +64 -0
- package/lib/theme/globalStyles.js.map +1 -0
- package/lib/theme/overrides/Accordion.d.ts +14 -0
- package/{src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js → lib/theme/overrides/Accordion.js} +15 -7
- package/lib/theme/overrides/Accordion.js.map +1 -0
- package/lib/theme/overrides/Autocomplete.d.ts +10 -0
- package/{src/components/FormComponents/DisplayItem/DisplayInstructions.styles.js → lib/theme/overrides/Autocomplete.js} +12 -7
- package/lib/theme/overrides/Autocomplete.js.map +1 -0
- package/lib/theme/overrides/Backdrop.d.ts +13 -0
- package/{src/components/FormComponents/ItemParts/FadingCheckIcon.js → lib/theme/overrides/Backdrop.js} +15 -9
- package/lib/theme/overrides/Backdrop.js.map +1 -0
- package/lib/theme/overrides/Button.d.ts +33 -0
- package/lib/theme/overrides/Button.js +52 -0
- package/lib/theme/overrides/Button.js.map +1 -0
- package/lib/theme/overrides/Card.d.ts +35 -0
- package/lib/theme/overrides/Card.js +49 -0
- package/lib/theme/overrides/Card.js.map +1 -0
- package/lib/theme/overrides/Input.d.ts +64 -0
- package/lib/theme/overrides/Input.js +81 -0
- package/lib/theme/overrides/Input.js.map +1 -0
- package/lib/theme/overrides/Overrides.d.ts +3 -0
- package/{src/components/BackToTopButton/BackToTopButton.js → lib/theme/overrides/Overrides.js} +14 -15
- package/lib/theme/overrides/Overrides.js.map +1 -0
- package/lib/theme/overrides/Paper.d.ts +12 -0
- package/{src/hooks/useQueryClient.js → lib/theme/overrides/Paper.js} +12 -10
- package/lib/theme/overrides/Paper.js.map +1 -0
- package/lib/theme/overrides/SpeedDial.d.ts +16 -0
- package/{src/hooks/useInitialiseRepeatAnswers.js → lib/theme/overrides/SpeedDial.js} +16 -18
- package/lib/theme/overrides/SpeedDial.js.map +1 -0
- package/lib/theme/overrides/Table.d.ts +11 -0
- package/{src/components/FormRenderer/index.js → lib/theme/overrides/Table.js} +13 -2
- package/lib/theme/overrides/Table.js.map +1 -0
- 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/palette.d.ts +28 -0
- package/lib/theme/palette.js +67 -0
- package/lib/theme/palette.js.map +1 -0
- package/lib/theme/shadows.d.ts +2 -0
- package/lib/theme/shadows.js +52 -0
- package/lib/theme/shadows.js.map +1 -0
- package/lib/theme/typography.d.ts +139 -0
- package/lib/theme/typography.js +80 -0
- package/lib/theme/typography.js.map +1 -0
- package/package.json +1 -1
- package/src/components/FormRenderer/SmartFormsRenderer.tsx +6 -3
- package/src/theme/Theme.tsx +107 -0
- package/src/theme/globalStyles.tsx +68 -0
- package/src/{components/FormComponents/Item.styles.js → theme/overrides/Accordion.ts} +18 -11
- package/src/{interfaces/answerExpression.interface.js → theme/overrides/Autocomplete.ts} +14 -2
- package/src/theme/overrides/Backdrop.ts +34 -0
- package/src/theme/overrides/Button.ts +54 -0
- package/src/theme/overrides/Card.ts +51 -0
- package/src/theme/overrides/Input.ts +83 -0
- package/src/theme/overrides/Overrides.ts +45 -0
- package/src/{interfaces/enableWhen.interface.js → theme/overrides/Paper.ts} +15 -2
- package/src/{hooks/useInitialiseGroupTable.js → theme/overrides/SpeedDial.ts} +17 -17
- package/src/{hooks/useBackToTop.js → theme/overrides/Table.ts} +14 -9
- package/src/{components/FormComponents/Typography.styles.js → theme/overrides/Typography.ts} +17 -7
- package/src/theme/palette.ts +100 -0
- package/src/theme/shadows.ts +54 -0
- package/src/theme/typography.ts +114 -0
- package/src/api/populate.js +0 -63
- package/src/api/populate.js.map +0 -1
- package/src/components/Alert.styles.js +0 -40
- package/src/components/Alert.styles.js.map +0 -1
- package/src/components/BackToTopButton/BackToTopButton.js.map +0 -1
- package/src/components/Box.styles.js +0 -30
- package/src/components/Box.styles.js.map +0 -1
- package/src/components/FormComponents/BooleanItem/BooleanField.js +0 -24
- package/src/components/FormComponents/BooleanItem/BooleanField.js.map +0 -1
- package/src/components/FormComponents/BooleanItem/BooleanItem.js +0 -49
- package/src/components/FormComponents/BooleanItem/BooleanItem.js.map +0 -1
- package/src/components/FormComponents/DateItem/DateField.js +0 -31
- package/src/components/FormComponents/DateItem/DateField.js.map +0 -1
- package/src/components/FormComponents/DateItem/DateItem.js +0 -52
- package/src/components/FormComponents/DateItem/DateItem.js.map +0 -1
- package/src/components/FormComponents/DateTimeItem/DateTimeField.js +0 -33
- package/src/components/FormComponents/DateTimeItem/DateTimeField.js.map +0 -1
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.js +0 -52
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.js.map +0 -1
- package/src/components/FormComponents/DecimalItem/DecimalField.js +0 -30
- package/src/components/FormComponents/DecimalItem/DecimalField.js.map +0 -1
- package/src/components/FormComponents/DecimalItem/DecimalItem.js +0 -80
- package/src/components/FormComponents/DecimalItem/DecimalItem.js.map +0 -1
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.js +0 -26
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.js.map +0 -1
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.js.map +0 -1
- package/src/components/FormComponents/DisplayItem/DisplayItem.js +0 -31
- package/src/components/FormComponents/DisplayItem/DisplayItem.js.map +0 -1
- package/src/components/FormComponents/GridGroup/GridGroup.js +0 -58
- package/src/components/FormComponents/GridGroup/GridGroup.js.map +0 -1
- package/src/components/FormComponents/GridGroup/GridRow.js +0 -55
- package/src/components/FormComponents/GridGroup/GridRow.js.map +0 -1
- package/src/components/FormComponents/GridGroup/GridTable.js +0 -42
- package/src/components/FormComponents/GridGroup/GridTable.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupHeading.js +0 -39
- package/src/components/FormComponents/GroupItem/GroupHeading.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupItem.js +0 -62
- package/src/components/FormComponents/GroupItem/GroupItem.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupItem.styles.js +0 -27
- package/src/components/FormComponents/GroupItem/GroupItem.styles.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.js +0 -73
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +0 -1
- package/src/components/FormComponents/GroupItem/NextTabButton.js +0 -25
- package/src/components/FormComponents/GroupItem/NextTabButton.js.map +0 -1
- package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.js +0 -55
- package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.js.map +0 -1
- package/src/components/FormComponents/IntegerItem/IntegerField.js +0 -30
- package/src/components/FormComponents/IntegerItem/IntegerField.js.map +0 -1
- package/src/components/FormComponents/IntegerItem/IntegerItem.js +0 -73
- package/src/components/FormComponents/IntegerItem/IntegerItem.js.map +0 -1
- package/src/components/FormComponents/Item.styles.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ContextDisplayItem.js +0 -29
- package/src/components/FormComponents/ItemParts/ContextDisplayItem.js.map +0 -1
- package/src/components/FormComponents/ItemParts/FadingCheckIcon.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.js +0 -31
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ItemLabelText.js +0 -45
- package/src/components/FormComponents/ItemParts/ItemLabelText.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.js +0 -32
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +0 -1
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingle.js +0 -24
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingle.js.map +0 -1
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js +0 -33
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js.map +0 -1
- package/src/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js +0 -31
- package/src/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js.map +0 -1
- package/src/components/FormComponents/Lists.styles.js +0 -38
- package/src/components/FormComponents/Lists.styles.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoice.js +0 -61
- package/src/components/FormComponents/QItemChoice/QItemChoice.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js +0 -85
- package/src/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js +0 -66
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js +0 -80
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js +0 -49
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js +0 -104
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js +0 -105
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js +0 -116
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js +0 -74
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js +0 -66
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/AddItemButton.js +0 -27
- package/src/components/FormComponents/RepeatGroup/AddItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/DeleteItemButton.js +0 -30
- package/src/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.js +0 -81
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.js +0 -30
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/AddItemButton.js +0 -27
- package/src/components/FormComponents/RepeatItem/AddItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/DeleteItemButton.js +0 -30
- package/src/components/FormComponents/RepeatItem/DeleteItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/RepeatField.js +0 -31
- package/src/components/FormComponents/RepeatItem/RepeatField.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/RepeatItem.js +0 -69
- package/src/components/FormComponents/RepeatItem/RepeatItem.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/RepeatItem.styles.js +0 -29
- package/src/components/FormComponents/RepeatItem/RepeatItem.styles.js.map +0 -1
- package/src/components/FormComponents/SingleItem/SingleItem.js +0 -32
- package/src/components/FormComponents/SingleItem/SingleItem.js.map +0 -1
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.js +0 -63
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +0 -1
- package/src/components/FormComponents/StringItem/StringField.js +0 -30
- package/src/components/FormComponents/StringItem/StringField.js.map +0 -1
- package/src/components/FormComponents/StringItem/StringItem.js +0 -71
- package/src/components/FormComponents/StringItem/StringItem.js.map +0 -1
- package/src/components/FormComponents/Tables/DeleteRowButton.js +0 -31
- package/src/components/FormComponents/Tables/DeleteRowButton.js.map +0 -1
- package/src/components/FormComponents/Tables/QItemGroupTable.js +0 -99
- package/src/components/FormComponents/Tables/QItemGroupTable.js.map +0 -1
- package/src/components/FormComponents/Tables/QItemGroupTableRow.js +0 -46
- package/src/components/FormComponents/Tables/QItemGroupTableRow.js.map +0 -1
- package/src/components/FormComponents/Tables/Table.styles.js +0 -46
- package/src/components/FormComponents/Tables/Table.styles.js.map +0 -1
- package/src/components/FormComponents/TextItem/TextField.js +0 -29
- package/src/components/FormComponents/TextItem/TextField.js.map +0 -1
- package/src/components/FormComponents/TextItem/TextItem.js +0 -71
- package/src/components/FormComponents/TextItem/TextItem.js.map +0 -1
- package/src/components/FormComponents/Textfield.styles.js +0 -27
- package/src/components/FormComponents/Textfield.styles.js.map +0 -1
- package/src/components/FormComponents/TimeItem/TimeField.js +0 -30
- package/src/components/FormComponents/TimeItem/TimeField.js.map +0 -1
- package/src/components/FormComponents/TimeItem/TimeItem.js +0 -52
- package/src/components/FormComponents/TimeItem/TimeItem.js.map +0 -1
- package/src/components/FormComponents/Typography.styles.js.map +0 -1
- package/src/components/FormComponents/UrlItem/UrlField.js +0 -25
- package/src/components/FormComponents/UrlItem/UrlField.js.map +0 -1
- package/src/components/FormComponents/UrlItem/UrlItem.js +0 -61
- package/src/components/FormComponents/UrlItem/UrlItem.js.map +0 -1
- package/src/components/FormRenderer/FormBodyCollapsible.js +0 -57
- package/src/components/FormRenderer/FormBodyCollapsible.js.map +0 -1
- package/src/components/FormRenderer/FormBodySingleCollapsible.js +0 -39
- package/src/components/FormRenderer/FormBodySingleCollapsible.js.map +0 -1
- package/src/components/FormRenderer/FormBodySingleCollapsibleWrapper.js +0 -31
- package/src/components/FormRenderer/FormBodySingleCollapsibleWrapper.js.map +0 -1
- package/src/components/FormRenderer/FormBodyTabbed.js +0 -60
- package/src/components/FormRenderer/FormBodyTabbed.js.map +0 -1
- package/src/components/FormRenderer/FormTitle.js +0 -30
- package/src/components/FormRenderer/FormTitle.js.map +0 -1
- package/src/components/FormRenderer/FormTopLevelItem.js +0 -45
- package/src/components/FormRenderer/FormTopLevelItem.js.map +0 -1
- package/src/components/FormRenderer/SmartFormsRenderer.js +0 -37
- package/src/components/FormRenderer/SmartFormsRenderer.js.map +0 -1
- package/src/components/FormRenderer/index.js.map +0 -1
- package/src/components/Iconify/Iconify.js +0 -26
- package/src/components/Iconify/Iconify.js.map +0 -1
- package/src/components/Lists.styles.js +0 -38
- package/src/components/Lists.styles.js.map +0 -1
- package/src/components/Tabs/CompleteTabButton.js +0 -29
- package/src/components/Tabs/CompleteTabButton.js.map +0 -1
- package/src/components/Tabs/FormBodySingleTab.js +0 -39
- package/src/components/Tabs/FormBodySingleTab.js.map +0 -1
- package/src/components/Tabs/FormBodyTabList.js +0 -52
- package/src/components/Tabs/FormBodyTabList.js.map +0 -1
- package/src/components/index.js +0 -18
- package/src/components/index.js.map +0 -1
- package/src/hooks/useBackToTop.js.map +0 -1
- package/src/hooks/useDebounce.js +0 -38
- package/src/hooks/useDebounce.js.map +0 -1
- package/src/hooks/useDecimalCalculatedExpression.js +0 -50
- package/src/hooks/useDecimalCalculatedExpression.js.map +0 -1
- package/src/hooks/useHidden.js +0 -35
- package/src/hooks/useHidden.js.map +0 -1
- package/src/hooks/useInitialiseGroupTable.js.map +0 -1
- package/src/hooks/useInitialiseRenderer.js +0 -49
- package/src/hooks/useInitialiseRenderer.js.map +0 -1
- package/src/hooks/useInitialiseRepeatAnswers.js.map +0 -1
- package/src/hooks/useInitialiseRepeatGroups.js +0 -36
- package/src/hooks/useInitialiseRepeatGroups.js.map +0 -1
- package/src/hooks/useIntegerCalculatedExpression.js +0 -44
- package/src/hooks/useIntegerCalculatedExpression.js.map +0 -1
- package/src/hooks/useQueryClient.js.map +0 -1
- package/src/hooks/useRenderingExtensions.js +0 -30
- package/src/hooks/useRenderingExtensions.js.map +0 -1
- package/src/hooks/useResponsive.js +0 -37
- package/src/hooks/useResponsive.js.map +0 -1
- package/src/hooks/useStringCalculatedExpression.js +0 -44
- package/src/hooks/useStringCalculatedExpression.js.map +0 -1
- package/src/hooks/useTerminologyServerQuery.js +0 -73
- package/src/hooks/useTerminologyServerQuery.js.map +0 -1
- package/src/hooks/useValidationError.js +0 -38
- package/src/hooks/useValidationError.js.map +0 -1
- package/src/hooks/useValueSetCodings.js +0 -125
- package/src/hooks/useValueSetCodings.js.map +0 -1
- package/src/index.js +0 -2
- package/src/index.js.map +0 -1
- package/src/interfaces/answerExpression.interface.js.map +0 -1
- package/src/interfaces/calculatedExpression.interface.js +0 -2
- package/src/interfaces/calculatedExpression.interface.js.map +0 -1
- package/src/interfaces/choice.enum.js +0 -41
- package/src/interfaces/choice.enum.js.map +0 -1
- package/src/interfaces/enableWhen.interface.js.map +0 -1
- package/src/interfaces/groupTable.interface.js +0 -18
- package/src/interfaces/groupTable.interface.js.map +0 -1
- package/src/interfaces/populate.interface.js +0 -18
- package/src/interfaces/populate.interface.js.map +0 -1
- package/src/interfaces/questionnaireStore.interface.js +0 -18
- package/src/interfaces/questionnaireStore.interface.js.map +0 -1
- package/src/interfaces/regex.interface.js +0 -18
- package/src/interfaces/regex.interface.js.map +0 -1
- package/src/interfaces/renderProps.interface.js +0 -18
- package/src/interfaces/renderProps.interface.js.map +0 -1
- package/src/interfaces/repeatGroup.interface.js +0 -18
- package/src/interfaces/repeatGroup.interface.js.map +0 -1
- package/src/interfaces/repeatItem.interface.js +0 -2
- package/src/interfaces/repeatItem.interface.js.map +0 -1
- package/src/interfaces/tab.interface.js +0 -2
- package/src/interfaces/tab.interface.js.map +0 -1
- package/src/interfaces/valueSet.interface.js +0 -18
- package/src/interfaces/valueSet.interface.js.map +0 -1
- package/src/interfaces/variables.interface.js +0 -18
- package/src/interfaces/variables.interface.js.map +0 -1
- package/src/setup-jest.js +0 -2
- package/src/setup-jest.js.map +0 -1
- package/src/stores/useConfigStore.js +0 -17
- package/src/stores/useConfigStore.js.map +0 -1
- package/src/stores/useQuestionnaireResponseStore.js +0 -39
- package/src/stores/useQuestionnaireResponseStore.js.map +0 -1
- package/src/stores/useQuestionnaireStore.js +0 -151
- package/src/stores/useQuestionnaireStore.js.map +0 -1
- package/src/stories/SmartFormsRenderer.stories.js +0 -90
- package/src/stories/SmartFormsRenderer.stories.js.map +0 -1
- package/src/utils/calculatedExpression.js +0 -180
- package/src/utils/calculatedExpression.js.map +0 -1
- package/src/utils/choice.js +0 -160
- package/src/utils/choice.js.map +0 -1
- package/src/utils/debounce.js +0 -19
- package/src/utils/debounce.js.map +0 -1
- package/src/utils/emptyResource.js +0 -25
- package/src/utils/emptyResource.js.map +0 -1
- package/src/utils/enableWhen.js +0 -228
- package/src/utils/enableWhen.js.map +0 -1
- package/src/utils/enableWhenExpression.js +0 -76
- package/src/utils/enableWhenExpression.js.map +0 -1
- package/src/utils/fhirpath.js +0 -98
- package/src/utils/fhirpath.js.map +0 -1
- package/src/utils/initialiseForm.js +0 -45
- package/src/utils/initialiseForm.js.map +0 -1
- package/src/utils/itemControl.js +0 -299
- package/src/utils/itemControl.js.map +0 -1
- package/src/utils/mapItem.js +0 -80
- package/src/utils/mapItem.js.map +0 -1
- package/src/utils/openChoice.js +0 -150
- package/src/utils/openChoice.js.map +0 -1
- package/src/utils/parseInputs.js +0 -49
- package/src/utils/parseInputs.js.map +0 -1
- package/src/utils/populate.js +0 -78
- package/src/utils/populate.js.map +0 -1
- package/src/utils/populateCallback.js +0 -40
- package/src/utils/populateCallback.js.map +0 -1
- package/src/utils/populateContexts.js +0 -76
- package/src/utils/populateContexts.js.map +0 -1
- package/src/utils/populateInputParams.js +0 -193
- package/src/utils/populateInputParams.js.map +0 -1
- package/src/utils/qItem.js +0 -73
- package/src/utils/qItem.js.map +0 -1
- package/src/utils/qrItem.js +0 -221
- package/src/utils/qrItem.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/addAdditionalVariables.js +0 -47
- package/src/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.js +0 -79
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractContainedValueSets.js +0 -59
- package/src/utils/questionnaireStoreUtils/extractContainedValueSets.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractLaunchContext.js +0 -18
- package/src/utils/questionnaireStoreUtils/extractLaunchContext.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractOtherExtensions.js +0 -174
- package/src/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractTabs.js +0 -31
- package/src/utils/questionnaireStoreUtils/extractTabs.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractVariables.js +0 -63
- package/src/utils/questionnaireStoreUtils/extractVariables.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/resolveValueSets.js +0 -58
- package/src/utils/questionnaireStoreUtils/resolveValueSets.js.map +0 -1
- package/src/utils/tabs.js +0 -190
- package/src/utils/tabs.js.map +0 -1
- package/src/utils/valueSet.js +0 -126
- package/src/utils/valueSet.js.map +0 -1
package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
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 { Autocomplete, Grid, Typography } from '@mui/material';
|
|
19
|
-
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
20
|
-
import { StandardTextField } from '../Textfield.styles';
|
|
21
|
-
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
22
|
-
import useValueSetCodings from '../../../hooks/useValueSetCodings';
|
|
23
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
24
|
-
import DisplayInstructions from '../DisplayItem/DisplayInstructions';
|
|
25
|
-
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
26
|
-
function QItemOpenChoiceSelectAnswerValueSet(props) {
|
|
27
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
28
|
-
// Init input value
|
|
29
|
-
const qrOpenChoice = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
|
|
30
|
-
let valueSelect = undefined;
|
|
31
|
-
if (qrOpenChoice['answer']) {
|
|
32
|
-
valueSelect = qrOpenChoice['answer'][0].valueCoding;
|
|
33
|
-
}
|
|
34
|
-
// Get codings/options from valueSet
|
|
35
|
-
const { codings, serverError } = useValueSetCodings(qItem);
|
|
36
|
-
// Get additional rendering extensions
|
|
37
|
-
const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
|
|
38
|
-
// Event handlers
|
|
39
|
-
function handleValueChange(_, newValue) {
|
|
40
|
-
if (newValue) {
|
|
41
|
-
if (typeof newValue === 'string') {
|
|
42
|
-
onQrItemChange(Object.assign(Object.assign({}, qrOpenChoice), { answer: [{ valueString: newValue }] }));
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
onQrItemChange(Object.assign(Object.assign({}, qrOpenChoice), { answer: [{ valueCoding: newValue }] }));
|
|
46
|
-
}
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
onQrItemChange(createEmptyQrItem(qItem));
|
|
50
|
-
}
|
|
51
|
-
const openChoiceSelectAnswerValueSet = (React.createElement(React.Fragment, null,
|
|
52
|
-
React.createElement(Autocomplete, { id: qItem.id, value: valueSelect !== null && valueSelect !== void 0 ? valueSelect : null, options: codings, getOptionLabel: (option) => (typeof option === 'string' ? option : `${option.display}`), onChange: handleValueChange, onInputChange: (event, newValue) => handleValueChange(event, newValue), freeSolo: true, autoHighlight: true, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160, flexGrow: 1 }, disabled: readOnly, size: "small", placeholder: entryFormat, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({ isTabled: isTabled, label: displayPrompt }, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: (React.createElement(React.Fragment, null,
|
|
53
|
-
params.InputProps.endAdornment,
|
|
54
|
-
displayUnit)) }) }))) }),
|
|
55
|
-
serverError ? (React.createElement(Typography, { variant: "subtitle2" }, "There was an error fetching options from the terminology server.")) : null));
|
|
56
|
-
const renderQItemOpenChoiceSelectAnswerValueSet = isRepeated ? (React.createElement(React.Fragment, null, openChoiceSelectAnswerValueSet)) : (React.createElement(FullWidthFormComponentBox, null,
|
|
57
|
-
React.createElement(Grid, { container: true, columnSpacing: 6 },
|
|
58
|
-
React.createElement(Grid, { item: true, xs: 5 },
|
|
59
|
-
React.createElement(LabelWrapper, { qItem: qItem })),
|
|
60
|
-
React.createElement(Grid, { item: true, xs: 7 },
|
|
61
|
-
openChoiceSelectAnswerValueSet,
|
|
62
|
-
React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
|
|
63
|
-
return React.createElement(React.Fragment, null, renderQItemOpenChoiceSelectAnswerValueSet);
|
|
64
|
-
}
|
|
65
|
-
export default QItemOpenChoiceSelectAnswerValueSet;
|
|
66
|
-
//# sourceMappingURL=QItemOpenChoiceSelectAnswerValueSet.js.map
|
package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QItemOpenChoiceSelectAnswerValueSet.js","sourceRoot":"","sources":["QItemOpenChoiceSelectAnswerValueSet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAM3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,O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KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACb,8BAA8B;gBAC/B,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;IACF,OAAO,0CAAG,yCAAyC,CAAI,CAAC;AAC1D,CAAC;AAED,eAAe,mCAAmC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
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 { Box, Button } from '@mui/material';
|
|
19
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
20
|
-
function AddItemButton(props) {
|
|
21
|
-
const { repeatGroups, onAddItem } = props;
|
|
22
|
-
const isDisabled = repeatGroups[repeatGroups.length - 1].qrItem === null;
|
|
23
|
-
return (React.createElement(Box, { display: "flex", flexDirection: "row-reverse" },
|
|
24
|
-
React.createElement(Button, { variant: "contained", startIcon: React.createElement(AddIcon, null), disabled: isDisabled, onClick: onAddItem, "data-test": "button-add-repeat-item" }, "Add Item")));
|
|
25
|
-
}
|
|
26
|
-
export default AddItemButton;
|
|
27
|
-
//# sourceMappingURL=AddItemButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AddItemButton.js","sourceRoot":"","sources":["AddItemButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAQ9C,SAAS,aAAa,CAAC,KAAyB;IAC9C,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE1C,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC;IAEzE,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,aAAa,EAAC,aAAa;QAC7C,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,SAAS,EAAE,oBAAC,OAAO,OAAG,EACtB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,SAAS,eACR,wBAAwB,eAE3B,CACL,CACP,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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 { RepeatDeleteTooltip } from '../RepeatItem/RepeatItem.styles';
|
|
19
|
-
import { IconButton } from '@mui/material';
|
|
20
|
-
import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline';
|
|
21
|
-
function DeleteItemButton(props) {
|
|
22
|
-
const { nullableQrItem, numOfRepeatGroups, onDeleteItem } = props;
|
|
23
|
-
const isDisabled = nullableQrItem === null || numOfRepeatGroups === 1;
|
|
24
|
-
return (React.createElement(RepeatDeleteTooltip, { className: "repeat-group-delete", title: "Delete item" },
|
|
25
|
-
React.createElement("span", null,
|
|
26
|
-
React.createElement(IconButton, { size: "small", color: "error", disabled: isDisabled, onClick: onDeleteItem },
|
|
27
|
-
React.createElement(RemoveCircleOutlineIcon, null)))));
|
|
28
|
-
}
|
|
29
|
-
export default DeleteItemButton;
|
|
30
|
-
//# sourceMappingURL=DeleteItemButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteItemButton.js","sourceRoot":"","sources":["DeleteItemButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,uBAAuB,MAAM,yCAAyC,CAAC;AAS9E,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAElE,MAAM,UAAU,GAAG,cAAc,KAAK,IAAI,IAAI,iBAAiB,KAAK,CAAC,CAAC;IAEtE,OAAO,CACL,oBAAC,mBAAmB,IAAC,SAAS,EAAC,qBAAqB,EAAC,KAAK,EAAC,aAAa;QACtE;YACE,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY;gBAChF,oBAAC,uBAAuB,OAAG,CAChB,CACR,CACa,CACvB,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
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, { useState } from 'react';
|
|
18
|
-
import useInitialiseRepeatGroups from '../../../hooks/useInitialiseRepeatGroups';
|
|
19
|
-
import { QGroupContainerBox } from '../../Box.styles';
|
|
20
|
-
import { Card, Collapse, Divider } from '@mui/material';
|
|
21
|
-
import { QGroupHeadingTypography } from '../Typography.styles';
|
|
22
|
-
import { TransitionGroup } from 'react-transition-group';
|
|
23
|
-
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
24
|
-
import { nanoid } from 'nanoid';
|
|
25
|
-
import RepeatGroupItem from './RepeatGroupItem';
|
|
26
|
-
import AddItemButton from './AddItemButton';
|
|
27
|
-
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
28
|
-
function RepeatGroup(props) {
|
|
29
|
-
const { qItem, qrItems, groupCardElevation, onQrRepeatGroupChange } = props;
|
|
30
|
-
const initialRepeatGroups = useInitialiseRepeatGroups(qrItems);
|
|
31
|
-
const [repeatGroups, setRepeatGroups] = useState(initialRepeatGroups);
|
|
32
|
-
function handleAnswerChange(newQrItem, index) {
|
|
33
|
-
const updatedRepeatGroups = [...repeatGroups];
|
|
34
|
-
if (newQrItem.item) {
|
|
35
|
-
updatedRepeatGroups[index].qrItem = {
|
|
36
|
-
linkId: newQrItem.linkId,
|
|
37
|
-
text: newQrItem.text,
|
|
38
|
-
item: newQrItem.item
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
setRepeatGroups(updatedRepeatGroups);
|
|
42
|
-
onQrRepeatGroupChange({
|
|
43
|
-
linkId: qItem.linkId,
|
|
44
|
-
qrItems: updatedRepeatGroups.flatMap((singleGroup) => singleGroup.qrItem ? [singleGroup.qrItem] : [])
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function handleDeleteItem(index) {
|
|
48
|
-
const updatedRepeatGroups = [...repeatGroups];
|
|
49
|
-
updatedRepeatGroups.splice(index, 1);
|
|
50
|
-
setRepeatGroups(updatedRepeatGroups);
|
|
51
|
-
onQrRepeatGroupChange({
|
|
52
|
-
linkId: qItem.linkId,
|
|
53
|
-
qrItems: updatedRepeatGroups.flatMap((singleGroup) => singleGroup.qrItem ? [singleGroup.qrItem] : [])
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function handleAddItem() {
|
|
57
|
-
setRepeatGroups([
|
|
58
|
-
...repeatGroups,
|
|
59
|
-
{
|
|
60
|
-
nanoId: nanoid(),
|
|
61
|
-
qrItem: null
|
|
62
|
-
}
|
|
63
|
-
]);
|
|
64
|
-
}
|
|
65
|
-
return (React.createElement(QGroupContainerBox, { key: qItem.linkId, cardElevation: groupCardElevation, isRepeated: true },
|
|
66
|
-
React.createElement(Card, { elevation: groupCardElevation, sx: { p: 3, py: 2.5, mb: 3.5 } },
|
|
67
|
-
React.createElement(QGroupHeadingTypography, { variant: "h6" },
|
|
68
|
-
React.createElement(LabelWrapper, { qItem: qItem })),
|
|
69
|
-
React.createElement(Divider, { sx: { mt: 1, mb: 1.5 }, light: true }),
|
|
70
|
-
React.createElement(TransitionGroup, null, repeatGroups.map(({ nanoId, qrItem: nullableQrItem }, index) => {
|
|
71
|
-
const answeredQrItem = createEmptyQrItem(qItem);
|
|
72
|
-
if (nullableQrItem) {
|
|
73
|
-
answeredQrItem.item = nullableQrItem.item;
|
|
74
|
-
}
|
|
75
|
-
return (React.createElement(Collapse, { key: nanoId, timeout: 200 },
|
|
76
|
-
React.createElement(RepeatGroupItem, { qItem: qItem, answeredQrItem: answeredQrItem, nullableQrItem: nullableQrItem, numOfRepeatGroups: repeatGroups.length, groupCardElevation: groupCardElevation + 1, onDeleteItem: () => handleDeleteItem(index), onQrItemChange: (newQrItem) => handleAnswerChange(newQrItem, index) })));
|
|
77
|
-
})),
|
|
78
|
-
React.createElement(AddItemButton, { repeatGroups: repeatGroups, onAddItem: handleAddItem }))));
|
|
79
|
-
}
|
|
80
|
-
export default RepeatGroup;
|
|
81
|
-
//# sourceMappingURL=RepeatGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatGroup.js","sourceRoot":"","sources":["RepeatGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,E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IACd,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,YAAY,CAAC,MAAM,EACtC,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAC3C,cAAc,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,GACnE,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACc;YAElB,oBAAC,aAAa,IAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,GAAI,CAClE,CACY,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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 { RepeatGroupContainerStack } from '../RepeatItem/RepeatItem.styles';
|
|
19
|
-
import { Box } from '@mui/material';
|
|
20
|
-
import GroupItem from '../GroupItem/GroupItem';
|
|
21
|
-
import DeleteItemButton from './DeleteItemButton';
|
|
22
|
-
function RepeatGroupItem(props) {
|
|
23
|
-
const { qItem, answeredQrItem, nullableQrItem, numOfRepeatGroups, groupCardElevation, onDeleteItem, onQrItemChange } = props;
|
|
24
|
-
return (React.createElement(RepeatGroupContainerStack, { direction: "row", justifyContent: "end" },
|
|
25
|
-
React.createElement(Box, { sx: { flexGrow: 1 } },
|
|
26
|
-
React.createElement(GroupItem, { qItem: qItem, qrItem: answeredQrItem, isRepeated: true, groupCardElevation: groupCardElevation + 1, onQrItemChange: onQrItemChange })),
|
|
27
|
-
React.createElement(DeleteItemButton, { nullableQrItem: nullableQrItem, numOfRepeatGroups: numOfRepeatGroups, onDeleteItem: onDeleteItem })));
|
|
28
|
-
}
|
|
29
|
-
export default RepeatGroupItem;
|
|
30
|
-
//# sourceMappingURL=RepeatGroupItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatGroupItem.js","sourceRoot":"","sources":["RepeatGroupItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAG/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAWlD,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EACJ,KAAK,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,oBAAC,yBAAyB,IAAC,SAAS,EAAC,KAAK,EAAC,cAAc,EAAC,KAAK;QAC7D,oBAAC,GAAG,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;YACtB,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,IAAI,EAChB,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,cAAc,EAAE,cAAc,GAC9B,CACE;QACN,oBAAC,gBAAgB,IACf,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY,GAC1B,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
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 { Box, Button } from '@mui/material';
|
|
19
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
20
|
-
function AddItemButton(props) {
|
|
21
|
-
const { repeatAnswers, onAddItem } = props;
|
|
22
|
-
const isDisabled = repeatAnswers[repeatAnswers.length - 1].answer === null;
|
|
23
|
-
return (React.createElement(Box, { display: "flex", flexDirection: "row-reverse" },
|
|
24
|
-
React.createElement(Button, { variant: "contained", startIcon: React.createElement(AddIcon, null), disabled: isDisabled, onClick: onAddItem, "data-test": "button-add-repeat-item" }, "Add Item")));
|
|
25
|
-
}
|
|
26
|
-
export default AddItemButton;
|
|
27
|
-
//# sourceMappingURL=AddItemButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AddItemButton.js","sourceRoot":"","sources":["AddItemButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAQ9C,SAAS,aAAa,CAAC,KAAyB;IAC9C,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE3C,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC;IAE3E,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,aAAa,EAAC,aAAa;QAC7C,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,SAAS,EAAE,oBAAC,OAAO,OAAG,EACtB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,SAAS,eACR,wBAAwB,eAE3B,CACL,CACP,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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 { RepeatDeleteTooltip } from './RepeatItem.styles';
|
|
19
|
-
import { IconButton } from '@mui/material';
|
|
20
|
-
import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline';
|
|
21
|
-
function DeleteItemButton(props) {
|
|
22
|
-
const { answer, numOfRepeatAnswers, onDeleteAnswer } = props;
|
|
23
|
-
const isDisabled = answer === null || numOfRepeatAnswers === 1;
|
|
24
|
-
return (React.createElement(RepeatDeleteTooltip, { className: "repeat-item-delete", title: "Delete item" },
|
|
25
|
-
React.createElement("span", null,
|
|
26
|
-
React.createElement(IconButton, { size: "small", color: "error", disabled: isDisabled, onClick: onDeleteAnswer },
|
|
27
|
-
React.createElement(RemoveCircleOutlineIcon, { fontSize: "small" })))));
|
|
28
|
-
}
|
|
29
|
-
export default DeleteItemButton;
|
|
30
|
-
//# sourceMappingURL=DeleteItemButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteItemButton.js","sourceRoot":"","sources":["DeleteItemButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,uBAAuB,MAAM,yCAAyC,CAAC;AAS9E,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7D,MAAM,UAAU,GAAG,MAAM,KAAK,IAAI,IAAI,kBAAkB,KAAK,CAAC,CAAC;IAE/D,OAAO,CACL,oBAAC,mBAAmB,IAAC,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAC,aAAa;QACrE;YACE,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc;gBAClF,oBAAC,uBAAuB,IAAC,QAAQ,EAAC,OAAO,GAAG,CACjC,CACR,CACa,CACvB,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
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 { Box } from '@mui/material';
|
|
19
|
-
import { RepeatItemContainerStack } from './RepeatItem.styles';
|
|
20
|
-
import SingleItem from '../SingleItem/SingleItem';
|
|
21
|
-
import DeleteItemButton from './DeleteItemButton';
|
|
22
|
-
function RepeatField(props) {
|
|
23
|
-
var _a;
|
|
24
|
-
const { qItem, qrItem, answer, numOfRepeatAnswers, onDeleteAnswer, onQrItemChange } = props;
|
|
25
|
-
return (React.createElement(RepeatItemContainerStack, { direction: "row" },
|
|
26
|
-
React.createElement(Box, { sx: { flexGrow: 1 } },
|
|
27
|
-
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false, isTabled: false, onQrItemChange: onQrItemChange })),
|
|
28
|
-
React.createElement(DeleteItemButton, { answer: answer, numOfRepeatAnswers: numOfRepeatAnswers, onDeleteAnswer: onDeleteAnswer })));
|
|
29
|
-
}
|
|
30
|
-
export default RepeatField;
|
|
31
|
-
//# sourceMappingURL=RepeatField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatField.js","sourceRoot":"","sources":["RepeatField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAOlD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAUlD,SAAS,WAAW,CAAC,KAAuB;;IAC1C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE5F,OAAO,CACL,oBAAC,wBAAwB,IAAC,SAAS,EAAC,KAAK;QACvC,oBAAC,GAAG,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;YACtB,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,EAClC,QAAQ,EAAE,KAAK,EACf,cAAc,EAAE,cAAc,GAC9B,CACE;QACN,oBAAC,gBAAgB,IACf,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,cAAc,GAC9B,CACuB,CAC5B,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
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, { useState } from 'react';
|
|
18
|
-
import { nanoid } from 'nanoid';
|
|
19
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
20
|
-
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
21
|
-
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
22
|
-
import AddItemButton from './AddItemButton';
|
|
23
|
-
import { TransitionGroup } from 'react-transition-group';
|
|
24
|
-
import RepeatField from './RepeatField';
|
|
25
|
-
import { Collapse } from '@mui/material';
|
|
26
|
-
import useInitialiseRepeatAnswers from '../../../hooks/useInitialiseRepeatAnswers';
|
|
27
|
-
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
28
|
-
function RepeatItem(props) {
|
|
29
|
-
const { qItem, qrItem, onQrItemChange } = props;
|
|
30
|
-
// Get additional rendering extensions
|
|
31
|
-
const { displayInstructions } = useRenderingExtensions(qItem);
|
|
32
|
-
const initialRepeatAnswers = useInitialiseRepeatAnswers(qrItem);
|
|
33
|
-
const [repeatAnswers, setRepeatAnswers] = useState(initialRepeatAnswers);
|
|
34
|
-
// Event Handlers
|
|
35
|
-
function handleAnswerChange(newQrItem, index) {
|
|
36
|
-
const updatedRepeatAnswers = [...repeatAnswers];
|
|
37
|
-
updatedRepeatAnswers[index].answer = newQrItem.answer ? newQrItem.answer[0] : null;
|
|
38
|
-
setRepeatAnswers(updatedRepeatAnswers);
|
|
39
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: updatedRepeatAnswers.flatMap((repeatAnswer) => repeatAnswer.answer ? [repeatAnswer.answer] : []) }));
|
|
40
|
-
}
|
|
41
|
-
function handleDeleteItem(index) {
|
|
42
|
-
const updatedRepeatAnswers = [...repeatAnswers];
|
|
43
|
-
updatedRepeatAnswers.splice(index, 1);
|
|
44
|
-
setRepeatAnswers(updatedRepeatAnswers);
|
|
45
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: updatedRepeatAnswers.flatMap((repeatAnswer) => repeatAnswer.answer ? [repeatAnswer.answer] : []) }));
|
|
46
|
-
}
|
|
47
|
-
function handleAddItem() {
|
|
48
|
-
setRepeatAnswers([
|
|
49
|
-
...repeatAnswers,
|
|
50
|
-
{
|
|
51
|
-
nanoId: nanoid(),
|
|
52
|
-
answer: null
|
|
53
|
-
}
|
|
54
|
-
]);
|
|
55
|
-
}
|
|
56
|
-
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-repeat-box" },
|
|
57
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
|
|
58
|
-
React.createElement(TransitionGroup, null, repeatAnswers.map(({ nanoId, answer }, index) => {
|
|
59
|
-
const repeatAnswerQrItem = createEmptyQrItem(qItem);
|
|
60
|
-
if (answer) {
|
|
61
|
-
repeatAnswerQrItem.answer = [answer];
|
|
62
|
-
}
|
|
63
|
-
return (React.createElement(Collapse, { key: nanoId, timeout: 200 },
|
|
64
|
-
React.createElement(RepeatField, { qItem: qItem, qrItem: repeatAnswerQrItem, answer: answer, numOfRepeatAnswers: repeatAnswers.length, onDeleteAnswer: () => handleDeleteItem(index), onQrItemChange: (newQrItem) => handleAnswerChange(newQrItem, index) })));
|
|
65
|
-
}))),
|
|
66
|
-
React.createElement(AddItemButton, { repeatAnswers: repeatAnswers, onAddItem: handleAddIt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CAAC,KAAK,CAAC,CAAC;gBACpD,IAAI,MAAM,EAAE;oBACV,kBAAkB,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;iBACtC;gBAED,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;oBACjC,oBAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,aAAa,CAAC,MAAM,EACxC,cAAc,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAC7C,cAAc,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,GACnE,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACc,CACJ;QAEhB,oBAAC,aAAa,IAAC,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,GAAI,CAC/C,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
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 { Stack, styled, Tooltip } from '@mui/material';
|
|
18
|
-
export const RepeatDeleteTooltip = styled(Tooltip)(() => ({
|
|
19
|
-
marginLeft: 8
|
|
20
|
-
}));
|
|
21
|
-
export const RepeatItemContainerStack = styled(Stack)(() => ({
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
paddingBottom: 8
|
|
24
|
-
}));
|
|
25
|
-
export const RepeatGroupContainerStack = styled(Stack)(() => ({
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
paddingBottom: 16
|
|
28
|
-
}));
|
|
29
|
-
//# sourceMappingURL=RepeatItem.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatItem.styles.js","sourceRoot":"","sources":["RepeatItem.styles.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACxD,UAAU,EAAE,CAAC;CACd,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3D,UAAU,EAAE,QAAQ;IACpB,aAAa,EAAE,CAAC;CACjB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5D,UAAU,EAAE,QAAQ;IACpB,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
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, { useCallback } from 'react';
|
|
18
|
-
import useQuestionnaireStore from '../../../stores/useQuestionnaireStore';
|
|
19
|
-
import SingleItemSwitcher from './SingleItemSwitcher';
|
|
20
|
-
function SingleItem(props) {
|
|
21
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
22
|
-
const updateEnableWhenItem = useQuestionnaireStore((state) => state.updateEnableWhenItem);
|
|
23
|
-
const handleQrItemChange = useCallback((newQrItem) => {
|
|
24
|
-
if (newQrItem.answer) {
|
|
25
|
-
updateEnableWhenItem(qItem.linkId, newQrItem.answer);
|
|
26
|
-
}
|
|
27
|
-
onQrItemChange(newQrItem);
|
|
28
|
-
}, [updateEnableWhenItem, onQrItemChange, qItem.linkId]);
|
|
29
|
-
return (React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: handleQrItemChange }));
|
|
30
|
-
}
|
|
31
|
-
export default SingleItem;
|
|
32
|
-
//# sourceMappingURL=SingleItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItem.js","sourceRoot":"","sources":["SingleItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,qBAAqB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAUtD,SAAS,UAAU,CAAC,KAAsB;IACxC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEtE,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAE1F,MAAM,kBAAkB,GAAG,WAAW,CACpC,CAAC,SAAoC,EAAE,EAAE;QACvC,IAAI,SAAS,CAAC,MAAM,EAAE;YACpB,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;SACtD;QACD,cAAc,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,EACD,CAAC,oBAAoB,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CACrD,CAAC;IAEF,OAAO,CACL,oBAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,kBAAkB,GAClC,CACH,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
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 QItemChoice from '../QItemChoice/QItemChoice';
|
|
19
|
-
import QItemOpenChoice from '../QItemOpenChoice/QItemOpenChoice';
|
|
20
|
-
import { Typography } from '@mui/material';
|
|
21
|
-
import StringItem from '../StringItem/StringItem';
|
|
22
|
-
import BooleanItem from '../BooleanItem/BooleanItem';
|
|
23
|
-
import TimeItem from '../TimeItem/TimeItem';
|
|
24
|
-
import DateTimeItem from '../DateTimeItem/DateTimeItem';
|
|
25
|
-
import DateItem from '../DateItem/DateItem';
|
|
26
|
-
import TextItem from '../TextItem/TextItem';
|
|
27
|
-
import DisplayItem from '../DisplayItem/DisplayItem';
|
|
28
|
-
import IntegerItem from '../IntegerItem/IntegerItem';
|
|
29
|
-
import DecimalItem from '../DecimalItem/DecimalItem';
|
|
30
|
-
import UrlItem from '../UrlItem/UrlItem';
|
|
31
|
-
function SingleItemSwitcher(props) {
|
|
32
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
33
|
-
switch (qItem.type) {
|
|
34
|
-
case 'string':
|
|
35
|
-
return (React.createElement(StringItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
36
|
-
case 'boolean':
|
|
37
|
-
return (React.createElement(BooleanItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
38
|
-
case 'time':
|
|
39
|
-
return (React.createElement(TimeItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
40
|
-
case 'date':
|
|
41
|
-
return (React.createElement(DateItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
42
|
-
case 'dateTime':
|
|
43
|
-
return (React.createElement(DateTimeItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
44
|
-
case 'text':
|
|
45
|
-
return (React.createElement(TextItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, onQrItemChange: onQrItemChange }));
|
|
46
|
-
case 'display':
|
|
47
|
-
return React.createElement(DisplayItem, { qItem: qItem });
|
|
48
|
-
case 'integer':
|
|
49
|
-
return (React.createElement(IntegerItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
50
|
-
case 'decimal':
|
|
51
|
-
return (React.createElement(DecimalItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
52
|
-
case 'choice':
|
|
53
|
-
return (React.createElement(QItemChoice, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
54
|
-
case 'open-choice':
|
|
55
|
-
return (React.createElement(QItemOpenChoice, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
56
|
-
case 'url':
|
|
57
|
-
return (React.createElement(UrlItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
58
|
-
default:
|
|
59
|
-
return (React.createElement(Typography, null, "Item type not supported yet. Only R4 datatypes are supported at the moment."));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export default SingleItemSwitcher;
|
|
63
|
-
//# sourceMappingURL=SingleItemSwitcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItemSwitcher.js","sourceRoot":"","sources":["SingleItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,WAA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AAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,CACL,oBAAC,OAAO,IACN,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ;YACE,OAAO,CACL,oBAAC,UAAU,sFAEE,CACd,CAAC;KACL;AACH,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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 { InputAdornment } from '@mui/material';
|
|
19
|
-
import { StandardTextField } from '../Textfield.styles';
|
|
20
|
-
import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
|
|
21
|
-
function StringField(props) {
|
|
22
|
-
const { linkId, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, isTabled, calcExpUpdated, onInputChange } = props;
|
|
23
|
-
return (React.createElement(StandardTextField, { fullWidth: true, isTabled: isTabled, id: linkId, value: input, error: !!feedback, onChange: (event) => onInputChange(event.target.value), label: displayPrompt, placeholder: entryFormat, disabled: readOnly, size: "small", InputProps: {
|
|
24
|
-
endAdornment: (React.createElement(InputAdornment, { position: 'end' },
|
|
25
|
-
React.createElement(FadingCheckIcon, { fadeIn: calcExpUpdated }),
|
|
26
|
-
displayUnit))
|
|
27
|
-
}, helperText: feedback, "data-test": "q-item-string-field" }));
|
|
28
|
-
}
|
|
29
|
-
export default StringField;
|
|
30
|
-
//# sourceMappingURL=StringField.js.map
|