@aehrc/smart-forms-renderer 0.12.0 → 0.13.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/Box.styles.d.ts +6 -0
- package/lib/components/Box.styles.js +29 -1
- package/lib/components/Box.styles.js.map +1 -1
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js +2 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +4 -10
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +4 -9
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +4 -9
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +4 -10
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +4 -10
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +4 -10
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +4 -10
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js +2 -2
- package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +1 -1
- package/lib/components/FormComponents/DateItem/DateItem.js +2 -2
- package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +2 -2
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +4 -4
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerField.js +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerField.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js +4 -4
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.d.ts +7 -0
- package/lib/components/FormComponents/{DateItem/DatePickerField.js → ItemParts/ItemExtensionLabels.js} +12 -6
- package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +10 -7
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +4 -10
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +4 -9
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +4 -10
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +4 -10
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +4 -10
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +1 -2
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js +2 -2
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
- package/lib/components/FormComponents/SliderItem/SliderItem.js +2 -2
- package/lib/components/FormComponents/SliderItem/SliderItem.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringItem.js +4 -4
- package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTable.js +0 -1
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTableRow.js +3 -3
- package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTableView.js +1 -1
- package/lib/components/FormComponents/Tables/GroupTableView.js.map +1 -1
- package/lib/components/FormComponents/Tables/SelectRowButton.d.ts +1 -0
- package/lib/components/FormComponents/Tables/SelectRowButton.js +2 -2
- package/lib/components/FormComponents/Tables/SelectRowButton.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextItem.js +4 -4
- package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
- package/lib/components/FormComponents/TimeItem/TimeItem.js +2 -2
- package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
- package/lib/components/FormComponents/UrlItem/UrlItem.js +4 -4
- package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
- package/lib/components/Renderer/BaseRenderer.js +9 -1
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/components/Renderer/FormBodyCollapsible.d.ts +2 -2
- package/lib/components/Renderer/FormBodyCollapsible.js +2 -2
- package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -1
- package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.d.ts +2 -2
- package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js +2 -2
- package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js.map +1 -1
- package/lib/components/Renderer/FormBodyTabbed.d.ts +2 -2
- package/lib/components/Renderer/FormBodyTabbed.js +2 -2
- package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
- package/lib/components/Renderer/FormTopLevelItem.d.ts +2 -2
- package/lib/components/Renderer/FormTopLevelItem.js +4 -4
- package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
- package/lib/components/Renderer/SmartFormsRenderer.d.ts +1 -0
- package/lib/components/Renderer/SmartFormsRenderer.js +2 -2
- package/lib/components/Renderer/SmartFormsRenderer.js.map +1 -1
- package/lib/hooks/useInitialiseRenderer.d.ts +1 -1
- package/lib/hooks/useInitialiseRenderer.js +4 -3
- package/lib/hooks/useInitialiseRenderer.js.map +1 -1
- package/lib/hooks/useRenderingExtensions.d.ts +2 -0
- package/lib/hooks/useRenderingExtensions.js +16 -11
- package/lib/hooks/useRenderingExtensions.js.map +1 -1
- package/lib/hooks/useValidationFeedback.d.ts +3 -0
- package/lib/hooks/useValidationFeedback.js +37 -0
- package/lib/hooks/useValidationFeedback.js.map +1 -0
- package/lib/stores/questionnaireResponseStore.d.ts +8 -1
- package/lib/stores/questionnaireResponseStore.js +22 -0
- package/lib/stores/questionnaireResponseStore.js.map +1 -1
- package/lib/stores/questionnaireStore.d.ts +4 -2
- package/lib/stores/questionnaireStore.js +4 -2
- package/lib/stores/questionnaireStore.js.map +1 -1
- package/lib/utils/itemControl.d.ts +1 -27
- package/lib/utils/itemControl.js +0 -49
- package/lib/utils/itemControl.js.map +1 -1
- package/lib/utils/mapItem.d.ts +2 -0
- package/lib/utils/mapItem.js +2 -0
- package/lib/utils/mapItem.js.map +1 -1
- package/lib/utils/validateQuestionnaire.d.ts +23 -0
- package/lib/utils/validateQuestionnaire.js +183 -0
- package/lib/utils/validateQuestionnaire.js.map +1 -0
- package/package.json +2 -2
- package/src/components/Box.styles.ts +31 -1
- package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +6 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +19 -23
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +15 -18
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +16 -19
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +15 -19
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +17 -21
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +15 -19
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +17 -21
- package/src/components/FormComponents/CustomDateItem/CustomDateItem.tsx +7 -2
- package/src/components/FormComponents/DateItem/DateItem.tsx +7 -2
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +7 -2
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +9 -3
- package/src/components/FormComponents/IntegerItem/IntegerField.tsx +1 -0
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +9 -3
- package/{lib/components/BackToTopButton/BackToTopButton.js → src/components/FormComponents/ItemParts/ItemExtensionLabels.tsx} +23 -15
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +14 -9
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +21 -25
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +20 -23
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +18 -22
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +16 -20
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +17 -21
- package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +8 -4
- package/src/components/FormComponents/SliderItem/SliderItem.tsx +6 -2
- package/src/components/FormComponents/StringItem/StringItem.tsx +9 -3
- package/src/components/FormComponents/Tables/GroupTable.tsx +0 -2
- package/src/components/FormComponents/Tables/GroupTableRow.tsx +6 -2
- package/src/components/FormComponents/Tables/GroupTableView.tsx +1 -0
- package/src/components/FormComponents/Tables/SelectRowButton.tsx +9 -2
- package/src/components/FormComponents/TextItem/TextItem.tsx +9 -3
- package/src/components/FormComponents/TimeItem/TimeItem.tsx +7 -2
- package/src/components/FormComponents/UrlItem/UrlItem.tsx +9 -3
- package/src/components/Renderer/BaseRenderer.tsx +12 -0
- package/src/components/Renderer/FormBodyCollapsible.tsx +9 -3
- package/src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx +10 -3
- package/src/components/Renderer/FormBodyTabbed.tsx +9 -3
- package/src/components/Renderer/FormTopLevelItem.tsx +13 -3
- package/src/components/Renderer/SmartFormsRenderer.tsx +5 -2
- package/src/hooks/useInitialiseRenderer.ts +6 -3
- package/src/hooks/useRenderingExtensions.ts +17 -11
- package/src/hooks/{useValidationError.ts → useValidationFeedback.ts} +23 -21
- package/src/stores/questionnaireResponseStore.ts +36 -1
- package/src/stores/questionnaireStore.ts +8 -3
- package/src/stories/SmartFormsRenderer.stories.ts +16 -0
- package/src/utils/itemControl.ts +1 -67
- package/src/utils/mapItem.ts +2 -0
- package/src/utils/validateQuestionnaire.ts +273 -0
- package/lib/components/BackToTopButton/BackToTopButton.d.ts +0 -7
- package/lib/components/BackToTopButton/BackToTopButton.js.map +0 -1
- package/lib/components/FormComponents/CustomDateItem/CustomDateField2.d.ts +0 -18
- package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js +0 -31
- package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js.map +0 -1
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.d.ts +0 -9
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js +0 -75
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js.map +0 -1
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.d.ts +0 -9
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js +0 -75
- package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js.map +0 -1
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.d.ts +0 -5
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js +0 -27
- package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js.map +0 -1
- package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.d.ts +0 -9
- package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js +0 -71
- package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js.map +0 -1
- package/lib/components/FormComponents/DateItem/DatePicker.d.ts +0 -2
- package/lib/components/FormComponents/DateItem/DatePicker.js +0 -42
- package/lib/components/FormComponents/DateItem/DatePicker.js.map +0 -1
- package/lib/components/FormComponents/DateItem/DatePickerField.d.ts +0 -8
- package/lib/components/FormComponents/DateItem/DatePickerField.js.map +0 -1
- package/lib/components/FormComponents/DisplayItem/DisplayBox.d.ts +0 -0
- package/lib/components/FormComponents/DisplayItem/DisplayBox.js +0 -2
- package/lib/components/FormComponents/DisplayItem/DisplayBox.js.map +0 -1
- package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.d.ts +0 -4
- package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js +0 -35
- package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js.map +0 -1
- package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.d.ts +0 -10
- package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js +0 -73
- package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js.map +0 -1
- package/lib/components/FormComponents/GroupItem/ItemSwitcher.d.ts +0 -10
- package/lib/components/FormComponents/GroupItem/ItemSwitcher.js +0 -81
- package/lib/components/FormComponents/GroupItem/ItemSwitcher.js.map +0 -1
- package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.d.ts +0 -10
- package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js +0 -45
- package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js.map +0 -1
- package/lib/components/FormComponents/IntegerItem/SliderItem.d.ts +0 -9
- package/lib/components/FormComponents/IntegerItem/SliderItem.js +0 -75
- package/lib/components/FormComponents/IntegerItem/SliderItem.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/RadioButtons.d.ts +0 -8
- package/lib/components/FormComponents/ItemParts/RadioButtons.js +0 -37
- package/lib/components/FormComponents/ItemParts/RadioButtons.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.d.ts +0 -8
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js +0 -37
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js +0 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +0 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map +0 -1
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +0 -10
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +0 -30
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +0 -1
- package/lib/components/FormComponents/SliderItem/DisplayBox.styles.d.ts +0 -4
- package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js +0 -35
- package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js.map +0 -1
- package/lib/components/FormComponents/Tables/AddItemButton.d.ts +0 -8
- package/lib/components/FormComponents/Tables/AddItemButton.js +0 -28
- package/lib/components/FormComponents/Tables/AddItemButton.js.map +0 -1
- package/lib/components/FormComponents/Tables/DeleteRowButton.d.ts +0 -10
- package/lib/components/FormComponents/Tables/DeleteRowButton.js +0 -32
- package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +0 -1
- package/lib/components/FormComponents/Tables/GroupTableRows.d.ts +0 -17
- package/lib/components/FormComponents/Tables/GroupTableRows.js +0 -45
- package/lib/components/FormComponents/Tables/GroupTableRows.js.map +0 -1
- package/lib/components/FormComponents/Tables/GroupTableTestRow.d.ts +0 -22
- package/lib/components/FormComponents/Tables/GroupTableTestRow.js +0 -43
- package/lib/components/FormComponents/Tables/GroupTableTestRow.js.map +0 -1
- package/lib/components/FormComponents/Tables/QItemGroupTable.d.ts +0 -10
- package/lib/components/FormComponents/Tables/QItemGroupTable.js +0 -109
- package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +0 -1
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.d.ts +0 -10
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +0 -46
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +0 -1
- package/lib/components/FormComponents/Typography.styles.d.ts +0 -6
- package/lib/components/FormComponents/Typography.styles.js +0 -24
- package/lib/components/FormComponents/Typography.styles.js.map +0 -1
- package/lib/hooks/useBackToTop.d.ts +0 -2
- package/lib/hooks/useBackToTop.js +0 -26
- package/lib/hooks/useBackToTop.js.map +0 -1
- package/lib/hooks/useDateSeparatorValidation.d.ts +0 -2
- package/lib/hooks/useDateSeparatorValidation.js +0 -25
- package/lib/hooks/useDateSeparatorValidation.js.map +0 -1
- package/lib/hooks/useDecimalUpdateFromProp.d.ts +0 -2
- package/lib/hooks/useDecimalUpdateFromProp.js +0 -29
- package/lib/hooks/useDecimalUpdateFromProp.js.map +0 -1
- package/lib/hooks/useIntegerUpdateFromProp.d.ts +0 -2
- package/lib/hooks/useIntegerUpdateFromProp.js +0 -29
- package/lib/hooks/useIntegerUpdateFromProp.js.map +0 -1
- package/lib/hooks/useMinimalStringCalculatedExpression.d.ts +0 -11
- package/lib/hooks/useMinimalStringCalculatedExpression.js +0 -49
- package/lib/hooks/useMinimalStringCalculatedExpression.js.map +0 -1
- package/lib/hooks/useNumberUpdateFromProp.d.ts +0 -2
- package/lib/hooks/useNumberUpdateFromProp.js +0 -29
- package/lib/hooks/useNumberUpdateFromProp.js.map +0 -1
- package/lib/hooks/useRepeatItemState.d.ts +0 -5
- package/lib/hooks/useRepeatItemState.js +0 -35
- package/lib/hooks/useRepeatItemState.js.map +0 -1
- package/lib/hooks/useRepeatItemUpdateFromProp.d.ts +0 -2
- package/lib/hooks/useRepeatItemUpdateFromProp.js +0 -29
- package/lib/hooks/useRepeatItemUpdateFromProp.js.map +0 -1
- package/lib/hooks/useStringField.d.ts +0 -2
- package/lib/hooks/useStringField.js +0 -29
- package/lib/hooks/useStringField.js.map +0 -1
- package/lib/hooks/useStringUpdateFromProp.d.ts +0 -2
- package/lib/hooks/useStringUpdateFromProp.js +0 -29
- package/lib/hooks/useStringUpdateFromProp.js.map +0 -1
- package/lib/hooks/useValidationError.d.ts +0 -3
- package/lib/hooks/useValidationError.js +0 -38
- package/lib/hooks/useValidationError.js.map +0 -1
- package/lib/interfaces/index.d.ts +0 -2
- package/lib/interfaces/index.js +0 -18
- package/lib/interfaces/index.js.map +0 -1
- package/lib/setup-jest.js +0 -1
- package/lib/setup-jest.js.map +0 -1
- package/lib/stores/useQuestionnaireResponseStore.d.ts +0 -27
- package/lib/stores/useQuestionnaireResponseStore.js +0 -49
- package/lib/stores/useQuestionnaireResponseStore.js.map +0 -1
- package/lib/stores/useQuestionnaireStore.d.ts +0 -64
- package/lib/stores/useQuestionnaireStore.js +0 -173
- package/lib/stores/useQuestionnaireStore.js.map +0 -1
- package/lib/stores/useSmartConfigStore.d.ts +0 -14
- package/lib/stores/useSmartConfigStore.js +0 -13
- package/lib/stores/useSmartConfigStore.js.map +0 -1
- package/lib/stores/useTerminologyServerStore.d.ts +0 -7
- package/lib/stores/useTerminologyServerStore.js +0 -25
- package/lib/stores/useTerminologyServerStore.js.map +0 -1
- package/lib/stories/MedicalHistoryTable.stories.js +0 -45
- package/lib/stories/MedicalHistoryTable.stories.js.map +0 -1
- package/lib/stories/SmartFormsRenderer.stories.js +0 -103
- package/lib/stories/SmartFormsRenderer.stories.js.map +0 -1
- package/lib/test.d.ts +0 -4
- package/lib/test.js +0 -18
- package/lib/test.js.map +0 -1
- package/lib/theme/overrides/Backdrop.d.ts +0 -13
- package/lib/theme/overrides/Backdrop.js +0 -32
- package/lib/theme/overrides/Backdrop.js.map +0 -1
- package/lib/theme/overrides/Typography.d.ts +0 -13
- package/lib/theme/overrides/Typography.js +0 -31
- package/lib/theme/overrides/Typography.js.map +0 -1
- package/lib/utils/formChangesOld.d.ts +0 -18
- package/lib/utils/formChangesOld.js +0 -91
- package/lib/utils/formChangesOld.js.map +0 -1
- package/lib/utils/initialiseForm.d.ts +0 -22
- package/lib/utils/initialiseForm.js +0 -53
- package/lib/utils/initialiseForm.js.map +0 -1
- package/lib/utils/launchContext.d.ts +0 -0
- package/lib/utils/launchContext.js +0 -2
- package/lib/utils/launchContext.js.map +0 -1
- package/lib/utils/populateInputParams.d.ts +0 -8
- package/lib/utils/populateInputParams.js +0 -193
- package/lib/utils/populateInputParams.js.map +0 -1
- package/lib/utils/removeHidden.d.ts +0 -16
- package/lib/utils/removeHidden.js +0 -105
- package/lib/utils/removeHidden.js.map +0 -1
- package/lib/utils/repopulate.d.ts +0 -9
- package/lib/utils/repopulate.js +0 -133
- package/lib/utils/repopulate.js.map +0 -1
- package/lib/utils/repopulateGenerateItems.d.ts +0 -9
- package/lib/utils/repopulateGenerateItems.js +0 -133
- package/lib/utils/repopulateGenerateItems.js.map +0 -1
- package/lib/utils/repopulateRepeatGroup.d.ts +0 -4
- package/lib/utils/repopulateRepeatGroup.js +0 -62
- package/lib/utils/repopulateRepeatGroup.js.map +0 -1
|
@@ -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, { useRef } from 'react';
|
|
18
|
-
import { StandardTextField } from '../Textfield.styles';
|
|
19
|
-
import DatePicker from './customDateTimePicker/DatePicker';
|
|
20
|
-
function CustomDateField2(props) {
|
|
21
|
-
const { linkId, valueDate, input, feedback, isFocused, displayPrompt, entryFormat, readOnly, isTabled, setFocused, onInputChange, onSelectDate } = props;
|
|
22
|
-
const anchorRef = useRef(null);
|
|
23
|
-
return (React.createElement(StandardTextField, { id: linkId, ref: anchorRef, fullWidth: true, isTabled: isTabled, value: input, error: !!feedback, onChange: (e) => onInputChange(e.target.value), label: displayPrompt, placeholder: entryFormat !== '' ? entryFormat : 'DD/MM/YYYY', disabled: readOnly, size: "small", focused: isFocused, onFocus: () => setFocused(true), onBlur: () => setFocused(false), InputProps: {
|
|
24
|
-
endAdornment: (React.createElement(React.Fragment, null,
|
|
25
|
-
React.createElement(DatePicker, { valueString: valueDate, anchorEl: anchorRef.current, onSelectDate: (valueDayjs) => {
|
|
26
|
-
onSelectDate(valueDayjs.format('DD/MM/YYYY'));
|
|
27
|
-
}, onFocus: (focus) => setFocused(focus) })))
|
|
28
|
-
}, helperText: feedback }));
|
|
29
|
-
}
|
|
30
|
-
export default CustomDateField2;
|
|
31
|
-
//# sourceMappingURL=CustomDateField2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDateField2.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/CustomDateItem/CustomDateField2.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAgB3D,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,EACb,YAAY,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAA8B,MAAM,CAAC,IAAI,CAAC,CAAC;IAE1D,OAAO,CACL,oBAAC,iBAAiB,IAChB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,SAAS,EACd,SAAS,QACT,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EACjB,QAAQ,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7E,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EAC5D,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAC/B,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAC/B,UAAU,EAAE;YACV,YAAY,EAAE,CACZ;gBACE,oBAAC,UAAU,IACT,WAAW,EAAE,SAAS,EACtB,QAAQ,EAAE,SAAS,CAAC,OAAO,EAC3B,YAAY,EAAE,CAAC,UAAiB,EAAE,EAAE;wBAClC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;oBAChD,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GACrC,CACD,CACJ;SACF,EACD,UAAU,EAAE,QAAQ,GACpB,CACH,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface CustomDateTimePickerTextProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
-
}
|
|
8
|
-
declare function CustomDateTimePickerText(props: CustomDateTimePickerTextProps): React.JSX.Element;
|
|
9
|
-
export default CustomDateTimePickerText;
|
|
@@ -1,75 +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 useReadOnly from '../../../hooks/useReadOnly';
|
|
19
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
20
|
-
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
21
|
-
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
22
|
-
import useParseDates from './customDateTimePicker/hooks/useParseDates';
|
|
23
|
-
import CustomDateField from './customDateTimePicker/CustomDateField';
|
|
24
|
-
import { parseDisplayDateToFhirDate, parseFhirDateToDisplayDate, replaceMonthNameWithNumber } from './customDateTimePicker/utils/parseDates';
|
|
25
|
-
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
26
|
-
function CustomDateTimePickerText(props) {
|
|
27
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
28
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
29
|
-
const { displayPrompt, displayInstructions, entryFormat } = useRenderingExtensions(qItem);
|
|
30
|
-
const qrDate = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
|
|
31
|
-
// Init input value
|
|
32
|
-
let valueDate = '';
|
|
33
|
-
if (qrDate.answer) {
|
|
34
|
-
if (qrDate.answer[0].valueDate) {
|
|
35
|
-
valueDate = qrDate.answer[0].valueDate;
|
|
36
|
-
}
|
|
37
|
-
else if (qrDate.answer[0].valueDateTime) {
|
|
38
|
-
valueDate = qrDate.answer[0].valueDateTime;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
valueDate = parseFhirDateToDisplayDate(valueDate);
|
|
42
|
-
const selectedDateToDisplay = valueDate.length === 0 ? 'N/A' : valueDate;
|
|
43
|
-
const [input, setInput] = useState(valueDate);
|
|
44
|
-
const [focused, setFocused] = useState(false);
|
|
45
|
-
let options = [];
|
|
46
|
-
const { dateOptions, seperator } = useParseDates(input);
|
|
47
|
-
if (dateOptions) {
|
|
48
|
-
options = dateOptions;
|
|
49
|
-
}
|
|
50
|
-
function handleValueChange(newDateString) {
|
|
51
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseDisplayDateToFhirDate(newDateString, seperator) }] }));
|
|
52
|
-
}
|
|
53
|
-
function handleUnfocus() {
|
|
54
|
-
// set answer to current input when text field is unfocused
|
|
55
|
-
if (!valueDate && input !== '') {
|
|
56
|
-
const replacedInput = replaceMonthNameWithNumber(input);
|
|
57
|
-
const matchedOption = options.find((option) => replacedInput === option);
|
|
58
|
-
if (matchedOption) {
|
|
59
|
-
const newDateString = matchedOption.split(seperator).join('/');
|
|
60
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseDisplayDateToFhirDate(newDateString, seperator) }] }));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
setFocused(false);
|
|
64
|
-
}
|
|
65
|
-
if (isRepeated) {
|
|
66
|
-
return (React.createElement(CustomDateField, { valueDate: valueDate, input: input, isFocused: focused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, setFocused: setFocused, onInputChange: (newInput) => setInput(newInput), onValueChange: handleValueChange, onUnfocus: handleUnfocus }));
|
|
67
|
-
}
|
|
68
|
-
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-date-box" },
|
|
69
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions.length > 0 ? (displayInstructions) : (React.createElement(React.Fragment, null,
|
|
70
|
-
"Selected date: ",
|
|
71
|
-
React.createElement("b", null, selectedDateToDisplay))), readOnly: readOnly },
|
|
72
|
-
React.createElement(CustomDateField, { valueDate: valueDate, input: input, isFocused: focused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, setFocused: setFocused, onInputChange: (newInput) => setInput(newInput), onValueChange: handleValueChange, onUnfocus: handleUnfocus }))));
|
|
73
|
-
}
|
|
74
|
-
export default CustomDateTimePickerText;
|
|
75
|
-
//# sourceMappingURL=CustomDateTimeField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDateTimeField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/CustomDateItem/CustomDateTimeField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQxC,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,eAAe,MAAM,wCAAwC,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAW1D,SAAS,wBAAwB,CAAC,KAAoC;IACpE,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,m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ACJ,EAEH,QAAQ,EAAE,QAAQ;YAClB,oBAAC,eAAe,IACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC/C,aAAa,EAAE,iBAAiB,EAChC,SAAS,EAAE,aAAa,GACxB,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface CustomDateTimePickerTextProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
-
}
|
|
8
|
-
declare function CustomDateTimePickerText(props: CustomDateTimePickerTextProps): React.JSX.Element;
|
|
9
|
-
export default CustomDateTimePickerText;
|
|
@@ -1,75 +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 useReadOnly from '../../../hooks/useReadOnly';
|
|
19
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
20
|
-
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
21
|
-
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
22
|
-
import useParseDates from './customDateTimePicker/hooks/useParseDates';
|
|
23
|
-
import CustomDateField from './customDateTimePicker/CustomDateField';
|
|
24
|
-
import { parseDisplayDateToFhirDate, parseFhirDateToDisplayDate, replaceMonthNameWithNumber } from './customDateTimePicker/utils/parseDates';
|
|
25
|
-
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
26
|
-
function CustomDateTimePickerText(props) {
|
|
27
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
28
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
29
|
-
const { displayPrompt, displayInstructions, entryFormat } = useRenderingExtensions(qItem);
|
|
30
|
-
const qrDate = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
|
|
31
|
-
// Init input value
|
|
32
|
-
let valueDate = '';
|
|
33
|
-
if (qrDate.answer) {
|
|
34
|
-
if (qrDate.answer[0].valueDate) {
|
|
35
|
-
valueDate = qrDate.answer[0].valueDate;
|
|
36
|
-
}
|
|
37
|
-
else if (qrDate.answer[0].valueDateTime) {
|
|
38
|
-
valueDate = qrDate.answer[0].valueDateTime;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
valueDate = parseFhirDateToDisplayDate(valueDate);
|
|
42
|
-
const selectedDateToDisplay = valueDate.length === 0 ? 'N/A' : valueDate;
|
|
43
|
-
const [input, setInput] = useState(valueDate);
|
|
44
|
-
const [focused, setFocused] = useState(false);
|
|
45
|
-
let options = [];
|
|
46
|
-
const { dateOptions, seperator } = useParseDates(input);
|
|
47
|
-
if (dateOptions) {
|
|
48
|
-
options = dateOptions;
|
|
49
|
-
}
|
|
50
|
-
function handleValueChange(newDateString) {
|
|
51
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseDisplayDateToFhirDate(newDateString, seperator) }] }));
|
|
52
|
-
}
|
|
53
|
-
function handleUnfocus() {
|
|
54
|
-
// set answer to current input when text field is unfocused
|
|
55
|
-
if (!valueDate && input !== '') {
|
|
56
|
-
const replacedInput = replaceMonthNameWithNumber(input);
|
|
57
|
-
const matchedOption = options.find((option) => replacedInput === option);
|
|
58
|
-
if (matchedOption) {
|
|
59
|
-
const newDateString = matchedOption.split(seperator).join('/');
|
|
60
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseDisplayDateToFhirDate(newDateString, seperator) }] }));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
setFocused(false);
|
|
64
|
-
}
|
|
65
|
-
if (isRepeated) {
|
|
66
|
-
return (React.createElement(CustomDateField, { valueDate: valueDate, input: input, isFocused: focused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, setFocused: setFocused, onInputChange: (newInput) => setInput(newInput), onValueChange: handleValueChange, onUnfocus: handleUnfocus }));
|
|
67
|
-
}
|
|
68
|
-
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-date-box" },
|
|
69
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions.length > 0 ? (displayInstructions) : (React.createElement(React.Fragment, null,
|
|
70
|
-
"Selected date: ",
|
|
71
|
-
React.createElement("b", null, selectedDateToDisplay))), readOnly: readOnly },
|
|
72
|
-
React.createElement(CustomDateField, { valueDate: valueDate, input: input, isFocused: focused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, setFocused: setFocused, onInputChange: (newInput) => setInput(newInput), onValueChange: handleValueChange, onUnfocus: handleUnfocus }))));
|
|
73
|
-
}
|
|
74
|
-
export default CustomDateTimePickerText;
|
|
75
|
-
//# sourceMappingURL=CustomDateTimePickerText2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDateTimePickerText2.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQxC,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,eAAe,MAAM,wCAAwC,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAW1D,SAAS,wBAAwB,CAAC,KAAoC;IACpE,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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;YAClB,oBAAC,eAAe,IACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC/C,aAAa,EAAE,iBAAiB,EAChC,SAAS,EAAE,aAAa,GACxB,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|
package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js
DELETED
|
@@ -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 { parseInputToDateOptions } from '../utils/parseDates';
|
|
18
|
-
function useParseDates(input) {
|
|
19
|
-
// No options displayed when input is empty or search term is less than 2 characters
|
|
20
|
-
if (input.length === 0 || (input.length < 2 && input.length > 0)) {
|
|
21
|
-
return { dateOptions: [], seperator: '' };
|
|
22
|
-
}
|
|
23
|
-
const { dateOptions, seperator } = parseInputToDateOptions(input);
|
|
24
|
-
return { dateOptions, seperator };
|
|
25
|
-
}
|
|
26
|
-
export default useParseDates;
|
|
27
|
-
//# sourceMappingURL=useParseDates.js.map
|
package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useParseDates.js","sourceRoot":"","sources":["../../../../../../src/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,SAAS,aAAa,CAAC,KAAa;IAIlC,oFAAoF;IACpF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;QAChE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KAC3C;IAED,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAElE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AACpC,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface CustomDateTimePickerTextProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
-
}
|
|
8
|
-
declare function CustomDateTimePickerText(props: CustomDateTimePickerTextProps): React.JSX.Element;
|
|
9
|
-
export default CustomDateTimePickerText;
|
|
@@ -1,71 +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 useReadOnly from '../../../hooks/useReadOnly';
|
|
19
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
20
|
-
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
21
|
-
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
22
|
-
import { parseFhirDateToDisplayDate, parseInputDateToFhirDate, validateInput } from './customDateTimePicker/utils/parseDates';
|
|
23
|
-
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
24
|
-
import useDateValidation from '../../../hooks/useDateValidation';
|
|
25
|
-
import CustomDateField2 from './CustomDateField2';
|
|
26
|
-
function CustomDateTimePickerText(props) {
|
|
27
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
28
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
29
|
-
const { displayPrompt, displayInstructions, entryFormat } = useRenderingExtensions(qItem);
|
|
30
|
-
const qrDate = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
|
|
31
|
-
// Init input value
|
|
32
|
-
let valueDate = '';
|
|
33
|
-
if (qrDate.answer) {
|
|
34
|
-
if (qrDate.answer[0].valueDate) {
|
|
35
|
-
valueDate = qrDate.answer[0].valueDate;
|
|
36
|
-
}
|
|
37
|
-
else if (qrDate.answer[0].valueDateTime) {
|
|
38
|
-
valueDate = qrDate.answer[0].valueDateTime;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const { displayDate, parseFail } = parseFhirDateToDisplayDate(valueDate);
|
|
42
|
-
const [input, setInput] = useState(displayDate);
|
|
43
|
-
const [focused, setFocused] = useState(false);
|
|
44
|
-
// Perform validation checks
|
|
45
|
-
const errorFeedback = useDateValidation(input, parseFail);
|
|
46
|
-
function handleSelectDate(selectedDate) {
|
|
47
|
-
setInput(selectedDate);
|
|
48
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseInputDateToFhirDate(selectedDate) }] }));
|
|
49
|
-
}
|
|
50
|
-
function handleInputChange(newInput) {
|
|
51
|
-
setInput(newInput);
|
|
52
|
-
if (newInput === '') {
|
|
53
|
-
onQrItemChange(createEmptyQrItem(qItem));
|
|
54
|
-
}
|
|
55
|
-
if (!validateInput(newInput)) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueDate: parseInputDateToFhirDate(newInput) }] }));
|
|
59
|
-
}
|
|
60
|
-
if (isRepeated) {
|
|
61
|
-
return (React.createElement(CustomDateField2, { linkId: qItem.linkId, valueDate: displayDate, input: input, feedback: errorFeedback !== null && errorFeedback !== void 0 ? errorFeedback : '', isFocused: focused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, setFocused: setFocused, onInputChange: handleInputChange, onSelectDate: handleSelectDate }));
|
|
62
|
-
}
|
|
63
|
-
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-date-box" },
|
|
64
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
65
|
-
React.createElement(CustomDateField2, { linkId: qItem.linkId, valueDate: displayDate, input: input, feedback: errorFeedback !== null && errorFeedback !== void 0 ? errorFeedback : '', isFocused: focused, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, isTabled: isTabled, setFocused: setFocused, onInputChange: handleInputChange, onSelectDate: handleSelectDate }),
|
|
66
|
-
React.createElement(React.Fragment, null,
|
|
67
|
-
"Verify date: ",
|
|
68
|
-
displayDate))));
|
|
69
|
-
}
|
|
70
|
-
export default CustomDateTimePickerText;
|
|
71
|
-
//# sourceMappingURL=CustomDateTimePickerText.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDateTimePickerText.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/CustomDateItem/CustomDateTimePickerText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQxC,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,aAAa,EACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAWlD,SAAS,wBAAwB,CAAC,KAAoC;IACpE,MAAM,EAAE,KAAK,EAAE,MAA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E,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,iBAAiB,EAChC,YAAY,EAAE,gBAAgB,GAC9B;YACF;;gBAAgB,WAAW,CAAI,CACjB,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,42 +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 { DatePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
19
|
-
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
20
|
-
function DateField(props) {
|
|
21
|
-
const { value, displayPrompt, entryFormat, readOnly, isTabled, onDateChange } = props;
|
|
22
|
-
const [name, setName] = useState('');
|
|
23
|
-
function handleInputChange(newValue) {
|
|
24
|
-
setName(newValue);
|
|
25
|
-
}
|
|
26
|
-
return (React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
27
|
-
React.createElement(DatePicker, { format: entryFormat !== '' ? entryFormat : 'DD/MM/YYYY', value: value, disabled: readOnly, label: displayPrompt, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160 }, onChange: onDateChange, slots: { textField: DatePickerField }, slotProps: { textField: { helperText: 'Please enter a valid date' } }, "data-test": "q-item-date-field" })));
|
|
28
|
-
}
|
|
29
|
-
function DatePickerField({ value: string, onChange: }) { }
|
|
30
|
-
() => ;
|
|
31
|
-
{
|
|
32
|
-
// Parse the value for a valid date time
|
|
33
|
-
const parsedValue = new Date(value);
|
|
34
|
-
// Convert the parsed value to the format that is used in the DatePicker
|
|
35
|
-
const formattedValue = parsedValue.toLocaleDateString();
|
|
36
|
-
return (React.createElement(MuiTextField, { value: formattedValue, onChange: () => {
|
|
37
|
-
// Change the value of the DatePicker
|
|
38
|
-
onChange(parsedValue);
|
|
39
|
-
} }));
|
|
40
|
-
}
|
|
41
|
-
export default DatePicker;
|
|
42
|
-
//# sourceMappingURL=DatePicker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DateItem/DatePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAYhE,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAEtF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAErC,SAAS,iBAAiB,CAAC,QAAgB;QACzC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,CACL,oBAAC,oBAAoB,IAAC,WAAW,EAAE,YAAY;QAC7C,oBAAC,UAAU,IACT,MAAM,EAAE,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EACvD,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,EACpB,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EACvD,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,EACrC,SAAS,EAAE,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,2BAA2B,EAAE,EAAE,eAC3D,mBAAmB,GAC7B,CACmB,CACxB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,AAAD,EAAA,IAAC,CAAC,AAAF;AAAC,GAAG,EAAE,CAAE,AAAF,CAAA;AAAK;IAC5D,wCAAwC;IACxC,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAEpC,wEAAwE;IACxE,MAAM,cAAc,GAAG,WAAW,CAAC,kBAAkB,EAAE,CAAC;IACxD,OAAO,CACL,oBAAC,YAAY,IACX,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,GAAG,EAAE;YACb,qCAAqC;YACrC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACxB,CAAC,GACD,CACH,CAAC;CACH;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
|
|
3
|
-
interface DatePickerProps extends PropsWithIsTabledAttribute {
|
|
4
|
-
input: string;
|
|
5
|
-
onInputChange: (newInput: string) => string;
|
|
6
|
-
}
|
|
7
|
-
declare function DatePickerField(props: DatePickerProps): React.JSX.Element;
|
|
8
|
-
export default DatePickerField;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DateItem/DatePickerField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAOpD,SAAS,eAAe,CAAC,KAAsB;IAC7C,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAEvC,OAAO,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,CAAC;AAChG,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayBox.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayBox.tsx"],"names":[],"mappings":""}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const StyledDisplayBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,35 +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 { styled } from '@mui/material/styles';
|
|
18
|
-
import { Box } from '@mui/material';
|
|
19
|
-
export const StyledDisplayBox = styled(Box)(({ theme }) => ({
|
|
20
|
-
display: 'flex',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
padding: theme.spacing(0.5),
|
|
23
|
-
borderRadius: Number(theme.shape.borderRadius) * 1.5
|
|
24
|
-
// backgroundColor: alpha(
|
|
25
|
-
// color === 'error' ? theme.palette.error.light : theme.palette.info.light,
|
|
26
|
-
// 0.12
|
|
27
|
-
// ),
|
|
28
|
-
// [theme.breakpoints.up('sm')]: {
|
|
29
|
-
// padding: theme.spacing(1.5)
|
|
30
|
-
// },
|
|
31
|
-
// [theme.breakpoints.up('md')]: {
|
|
32
|
-
// padding: theme.spacing(2)
|
|
33
|
-
// }
|
|
34
|
-
}));
|
|
35
|
-
//# sourceMappingURL=DisplayBox.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayBox.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayBox.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1D,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,GAAG;IACpD,0BAA0B;IAC1B,8EAA8E;IAC9E,SAAS;IACT,KAAK;IACL,kCAAkC;IAClC,gCAAgC;IAChC,KAAK;IACL,kCAAkC;IAClC,8BAA8B;IAC9B,IAAI;CACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithQrItemChangeHandler, PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface GroupItemSwitcherProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithQrRepeatGroupChangeHandler {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItemOrItems: QuestionnaireResponseItem | QuestionnaireResponseItem[];
|
|
7
|
-
groupCardElevation: number;
|
|
8
|
-
}
|
|
9
|
-
declare function GroupChildItemSwitcher(props: GroupItemSwitcherProps): React.JSX.Element | null;
|
|
10
|
-
export default GroupChildItemSwitcher;
|
|
@@ -1,73 +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 { isSpecificItemControl } from '../../../utils/itemControl';
|
|
19
|
-
import QItemGroupTable from '../Tables/QItemGroupTable';
|
|
20
|
-
import RepeatGroup from '../RepeatGroup/RepeatGroup';
|
|
21
|
-
import { isRepeatItemAndNotCheckbox } from '../../../utils/qItem';
|
|
22
|
-
import RepeatItem from '../RepeatItem/RepeatItem';
|
|
23
|
-
import SingleItem from '../SingleItem/SingleItem';
|
|
24
|
-
import useHidden from '../../../hooks/useHidden';
|
|
25
|
-
import GroupItem from './GroupItem';
|
|
26
|
-
import GridGroup from '../GridGroup/GridGroup';
|
|
27
|
-
function GroupChildItemSwitcher(props) {
|
|
28
|
-
const { qItem, qrItemOrItems, groupCardElevation, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
29
|
-
const itemIsHidden = useHidden(qItem);
|
|
30
|
-
if (itemIsHidden) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
// If there are multiple answers
|
|
34
|
-
const hasMultipleAnswers = Array.isArray(qrItemOrItems);
|
|
35
|
-
if (hasMultipleAnswers) {
|
|
36
|
-
const qrItems = qrItemOrItems;
|
|
37
|
-
// qItem should always be either a repeatGroup or a groupTable item
|
|
38
|
-
// groupTables item have qItem.repeats = true and qItem.type = 'group' as well
|
|
39
|
-
if (!qItem.repeats || qItem.type !== 'group') {
|
|
40
|
-
return React.createElement(React.Fragment, null, "Something went wrong here");
|
|
41
|
-
}
|
|
42
|
-
if (isSpecificItemControl(qItem, 'gtable')) {
|
|
43
|
-
return (React.createElement(QItemGroupTable, { qItem: qItem, qrItems: qrItems, groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
44
|
-
}
|
|
45
|
-
return (React.createElement(RepeatGroup, { qItem: qItem, qrItems: qrItems, groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
46
|
-
}
|
|
47
|
-
// If there is only one answer
|
|
48
|
-
const qrItem = qrItemOrItems;
|
|
49
|
-
const itemIsGrid = isSpecificItemControl(qItem, 'grid');
|
|
50
|
-
if (itemIsGrid) {
|
|
51
|
-
return (React.createElement(GridGroup, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, onQrItemChange: onQrItemChange }));
|
|
52
|
-
}
|
|
53
|
-
const itemRepeatsAndIsNotCheckbox = isRepeatItemAndNotCheckbox(qItem);
|
|
54
|
-
if (itemRepeatsAndIsNotCheckbox) {
|
|
55
|
-
if (qItem.type === 'group') {
|
|
56
|
-
// If qItem is RepeatGroup or a groupTable item in this decision branch,
|
|
57
|
-
// their qrItem array should always be empty
|
|
58
|
-
if (isSpecificItemControl(qItem, 'gtable')) {
|
|
59
|
-
return (React.createElement(QItemGroupTable, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
60
|
-
}
|
|
61
|
-
return (React.createElement(RepeatGroup, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
62
|
-
}
|
|
63
|
-
return React.createElement(RepeatItem, { qItem: qItem, qrItem: qrItem, onQrItemChange: onQrItemChange });
|
|
64
|
-
}
|
|
65
|
-
// if qItem is not a repeating question or is a checkbox
|
|
66
|
-
if (qItem.type === 'group') {
|
|
67
|
-
return (React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem, isRepeated: false, groupCardElevation: groupCardElevation + 1, onQrItemChange: onQrItemChange }));
|
|
68
|
-
}
|
|
69
|
-
// Defaults to a normal QItemSwitcher
|
|
70
|
-
return (React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem, isRepeated: false, isTabled: false, onQrItemChange: onQrItemChange }));
|
|
71
|
-
}
|
|
72
|
-
export default GroupChildItemSwitcher;
|
|
73
|
-
//# sourceMappingURL=GroupChildItemSwitcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupChildItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupChildItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAU/C,SAAS,sBAAsB,CAAC,KAA6B;IAC3D,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAElG,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,YAAY,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,gCAAgC;IAChC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxD,IAAI,kBAAkB,EAAE;QACtB,MAAM,OAAO,GAAG,aAAa,CAAC;QAE9B,mEAAmE;QACnE,8EAA8E;QAC9E,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,O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kB,GAAG,CAAC,EAC1C,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC;SACH;QAED,OAAO,oBAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAI,CAAC;KACrF;IAED,wDAAwD;IACxD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,OAAO,CACL,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,KAAK,EACjB,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,qCAAqC;IACrC,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,EACf,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithQrItemChangeHandler, PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface GroupItemSwitcherProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithQrRepeatGroupChangeHandler {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItemOrItems: QuestionnaireResponseItem | QuestionnaireResponseItem[];
|
|
7
|
-
groupCardElevation: number;
|
|
8
|
-
}
|
|
9
|
-
declare function ItemSwitcher(props: GroupItemSwitcherProps): React.JSX.Element | null;
|
|
10
|
-
export default ItemSwitcher;
|