@aehrc/smart-forms-renderer 0.12.1 → 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/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 +7 -0
- package/lib/components/Renderer/BaseRenderer.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/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 +1 -1
- 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/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 +9 -0
- 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/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 +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,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AW,iBAAiB;QACpD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;YACvF,oBAAC,gBAAgB,IACf,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,EAC7B,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,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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AAC,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,M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xE,4CAA4C;YAC5C,IAAI,qBAAqB,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE;gBAC1C,OAAO,CACL,oBAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,EAAE,EACX,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC;aACH;YAED,OAAO,CACL,oBAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,EAAE,EACX,kBAAkB,EAAE,kBAAkB,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;
|
|
@@ -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 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 ItemSwitcher(props) {
|
|
28
|
-
const { qItem, qrItemOrItems, groupCardElevation, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
29
|
-
if (qItem.linkId === 'meds') {
|
|
30
|
-
console.log(qItem);
|
|
31
|
-
}
|
|
32
|
-
const itemIsHidden = useHidden(qItem);
|
|
33
|
-
if (itemIsHidden) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
if (qItem.linkId === 'meds') {
|
|
37
|
-
console.log(qItem);
|
|
38
|
-
}
|
|
39
|
-
// If there are multiple answers
|
|
40
|
-
const hasMultipleAnswers = Array.isArray(qrItemOrItems);
|
|
41
|
-
if (hasMultipleAnswers) {
|
|
42
|
-
const qrItems = qrItemOrItems;
|
|
43
|
-
// qItem should always be either a repeatGroup or a groupTable item
|
|
44
|
-
// groupTables item have qItem.repeats = true and qItem.type = 'group' as well
|
|
45
|
-
if (!qItem.repeats || qItem.type !== 'group') {
|
|
46
|
-
return React.createElement(React.Fragment, null, "Something went wrong here");
|
|
47
|
-
}
|
|
48
|
-
if (isSpecificItemControl(qItem, 'gtable')) {
|
|
49
|
-
return (React.createElement(QItemGroupTable, { qItem: qItem, qrItems: qrItems, groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
50
|
-
}
|
|
51
|
-
return (React.createElement(RepeatGroup, { qItem: qItem, qrItems: qrItems, groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
52
|
-
}
|
|
53
|
-
// If there is only one answer
|
|
54
|
-
const qrItem = qrItemOrItems;
|
|
55
|
-
const itemIsGrid = isSpecificItemControl(qItem, 'grid');
|
|
56
|
-
if (itemIsGrid) {
|
|
57
|
-
return (React.createElement(GridGroup, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, onQrItemChange: onQrItemChange }));
|
|
58
|
-
}
|
|
59
|
-
// console.log(qItem);
|
|
60
|
-
const itemRepeatsAndIsNotCheckbox = isRepeatItemAndNotCheckbox(qItem);
|
|
61
|
-
if (itemRepeatsAndIsNotCheckbox) {
|
|
62
|
-
if (qItem.type === 'group') {
|
|
63
|
-
console.log(qItem);
|
|
64
|
-
// If qItem is RepeatGroup or a groupTable item in this decision branch,
|
|
65
|
-
// their qrItem array should always be empty
|
|
66
|
-
if (isSpecificItemControl(qItem, 'gtable')) {
|
|
67
|
-
return (React.createElement(QItemGroupTable, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
68
|
-
}
|
|
69
|
-
return (React.createElement(RepeatGroup, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
70
|
-
}
|
|
71
|
-
return React.createElement(RepeatItem, { qItem: qItem, qrItem: qrItem, onQrItemChange: onQrItemChange });
|
|
72
|
-
}
|
|
73
|
-
// if qItem is not a repeating question or is a checkbox
|
|
74
|
-
if (qItem.type === 'group') {
|
|
75
|
-
return (React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem, isRepeated: false, groupCardElevation: groupCardElevation + 1, onQrItemChange: onQrItemChange }));
|
|
76
|
-
}
|
|
77
|
-
// Defaults to a normal QItemSwitcher
|
|
78
|
-
return (React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem, isRepeated: false, isTabled: false, onQrItemChange: onQrItemChange }));
|
|
79
|
-
}
|
|
80
|
-
export default ItemSwitcher;
|
|
81
|
-
//# sourceMappingURL=ItemSwitcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/ItemSwitcher.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;AAC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AE;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,YAAY,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface TopLevelGroupItemSwitcherProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
-
groupCardElevation: number;
|
|
8
|
-
}
|
|
9
|
-
declare function TopLevelGroupItemSwitcher(props: TopLevelGroupItemSwitcherProps): React.JSX.Element;
|
|
10
|
-
export default TopLevelGroupItemSwitcher;
|
|
@@ -1,45 +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, { useMemo } from 'react';
|
|
18
|
-
import { getQrItemsIndex, mapQItemsIndex } from '../../../utils/mapItem';
|
|
19
|
-
import { createQrGroup, updateQrGroup } from '../../../utils/qrItem';
|
|
20
|
-
import GroupItemSwitcher from './GroupItemSwitcher';
|
|
21
|
-
function TopLevelGroupItemSwitcher(props) {
|
|
22
|
-
const { qItem, qrItem, groupCardElevation, onQrItemChange } = props;
|
|
23
|
-
const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
|
|
24
|
-
const qItems = qItem.item;
|
|
25
|
-
const qrGroup = qrItem && qrItem.item ? qrItem : createQrGroup(qItem);
|
|
26
|
-
const qrItems = qrGroup.item;
|
|
27
|
-
// Event Handlers
|
|
28
|
-
function handleQrItemChange(newQrItem) {
|
|
29
|
-
const updatedQrGroup = Object.assign({}, qrGroup);
|
|
30
|
-
updateQrGroup(newQrItem, null, updatedQrGroup, qItemsIndexMap);
|
|
31
|
-
onQrItemChange(updatedQrGroup);
|
|
32
|
-
}
|
|
33
|
-
function handleQrRepeatGroupChange(qrRepeatGroup) {
|
|
34
|
-
const updatedQrGroup = Object.assign({}, qrGroup);
|
|
35
|
-
updateQrGroup(null, qrRepeatGroup, updatedQrGroup, qItemsIndexMap);
|
|
36
|
-
onQrItemChange(updatedQrGroup);
|
|
37
|
-
}
|
|
38
|
-
if (!qItems || !qrItems) {
|
|
39
|
-
return React.createElement(React.Fragment, null, "Unable to load group, something has gone terribly wrong.");
|
|
40
|
-
}
|
|
41
|
-
const qrItemsByIndex = getQrItemsIndex(qItems, qrItems, qItemsIndexMap);
|
|
42
|
-
return (React.createElement(GroupItemSwitcher, { key: qItem.linkId, qItem: qItem, qrItemOrItems: qrItemsByIndex, groupCardElevation: groupCardElevation, onQrItemChange: handleQrItemChange, onQrRepeatGroupChange: handleQrRepeatGroupChange }));
|
|
43
|
-
}
|
|
44
|
-
export default TopLevelGroupItemSwitcher;
|
|
45
|
-
//# sourceMappingURL=TopLevelGroupItemSwitcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopLevelGroupItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAUpD,SAAS,yBAAyB,CAAC,KAAqC;IACtE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEpE,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAE7B,iBAAiB;IACjB,SAAS,kBAAkB,CAAC,SAAoC;QAC9D,MAAM,cAAc,qBAAmC,OAAO,CAAE,CAAC;QACjE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;QAC/D,cAAc,CAAC,cAAc,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,yBAAyB,CAAC,aAA4B;QAC7D,MAAM,cAAc,qBAAmC,OAAO,CAAE,CAAC;QACjE,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;QACnE,cAAc,CAAC,cAAc,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE;QACvB,OAAO,qGAA6D,CAAC;KACtE;IAED,MAAM,cAAc,GAClB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IAEnD,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,cAAc,EAC7B,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,kBAAkB,EAClC,qBAAqB,EAAE,yBAAyB,GAChD,CACH,CAAC;AACJ,CAAC;AAED,eAAe,yBAAyB,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 IntegerItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
-
}
|
|
8
|
-
declare function IntegerItem(props: IntegerItemProps): React.JSX.Element;
|
|
9
|
-
export default IntegerItem;
|
|
@@ -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, { useCallback } from 'react';
|
|
18
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
19
|
-
import useValidationError from '../../../hooks/useValidationError';
|
|
20
|
-
import debounce from 'lodash.debounce';
|
|
21
|
-
import { createEmptyQrItemWithUnit } from '../../../utils/qrItem';
|
|
22
|
-
import { DEBOUNCE_DURATION } from '../../../utils/debounce';
|
|
23
|
-
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
24
|
-
import IntegerField from './IntegerField';
|
|
25
|
-
import useIntegerCalculatedExpression from '../../../hooks/useIntegerCalculatedExpression';
|
|
26
|
-
import { parseValidInteger } from '../../../utils/parseInputs';
|
|
27
|
-
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
28
|
-
import useNumberInput from '../../../hooks/useNumberInput';
|
|
29
|
-
import useReadOnly from '../../../hooks/useReadOnly';
|
|
30
|
-
function IntegerItem(props) {
|
|
31
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
32
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
33
|
-
const { displayUnit, displayPrompt, displayInstructions, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
|
|
34
|
-
// Init input value
|
|
35
|
-
let valueInteger = 0;
|
|
36
|
-
if (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) {
|
|
37
|
-
if (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueInteger) {
|
|
38
|
-
valueInteger = qrItem.answer[0].valueInteger;
|
|
39
|
-
}
|
|
40
|
-
if (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueDecimal) {
|
|
41
|
-
valueInteger = Math.round(qrItem.answer[0].valueDecimal);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const [value, setValue] = useNumberInput(valueInteger);
|
|
45
|
-
// Perform validation checks
|
|
46
|
-
const feedback = useValidationError(value.toString(), regexValidation, maxLength);
|
|
47
|
-
// Process calculated expressions
|
|
48
|
-
const { calcExpUpdated } = useIntegerCalculatedExpression({
|
|
49
|
-
qItem: qItem,
|
|
50
|
-
inputValue: value,
|
|
51
|
-
displayUnit: displayUnit,
|
|
52
|
-
setInputValue: (newValue) => {
|
|
53
|
-
setValue(newValue);
|
|
54
|
-
},
|
|
55
|
-
onQrItemChange: onQrItemChange
|
|
56
|
-
});
|
|
57
|
-
// Event handlers
|
|
58
|
-
function handleInputChange(newInput) {
|
|
59
|
-
const newValue = parseValidInteger(newInput);
|
|
60
|
-
setValue(newValue);
|
|
61
|
-
updateQrItemWithDebounce(newValue);
|
|
62
|
-
}
|
|
63
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
-
const updateQrItemWithDebounce = useCallback(debounce((newValue) => {
|
|
65
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItemWithUnit(qItem, displayUnit)), { answer: [{ valueInteger: newValue }] }));
|
|
66
|
-
}, DEBOUNCE_DURATION), [onQrItemChange, qItem, displayUnit]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
|
|
67
|
-
if (isRepeated) {
|
|
68
|
-
return (React.createElement(IntegerField, { linkId: qItem.linkId, value: value, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }));
|
|
69
|
-
}
|
|
70
|
-
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-integer-box" },
|
|
71
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
72
|
-
React.createElement(IntegerField, { linkId: qItem.linkId, value: value, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }))));
|
|
73
|
-
}
|
|
74
|
-
export default IntegerItem;
|
|
75
|
-
//# sourceMappingURL=SliderItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SliderItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/IntegerItem/SliderItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAWrD,SAAS,WAAW,C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AQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,iBAAiB,GAChC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem } from 'fhir/r4';
|
|
3
|
-
interface RadioButtonsProps {
|
|
4
|
-
qItem: QuestionnaireItem;
|
|
5
|
-
readOnly: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare function RadioButtons(props: RadioButtonsProps): React.JSX.Element;
|
|
8
|
-
export default RadioButtons;
|
|
@@ -1,37 +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 ChoiceRadioSingle from '../ChoiceItems/ChoiceRadioSingle';
|
|
19
|
-
function RadioButtons(props) {
|
|
20
|
-
var _a;
|
|
21
|
-
const { qItem, readOnly } = props;
|
|
22
|
-
return (React.createElement(React.Fragment, null, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option) => {
|
|
23
|
-
var _a, _b, _c;
|
|
24
|
-
if (option['valueCoding']) {
|
|
25
|
-
return (React.createElement(ChoiceRadioSingle, { key: (_a = option.valueCoding.code) !== null && _a !== void 0 ? _a : '', value: (_b = option.valueCoding.code) !== null && _b !== void 0 ? _b : '', label: (_c = option.valueCoding.display) !== null && _c !== void 0 ? _c : `${option.valueCoding.code}`, readOnly: readOnly }));
|
|
26
|
-
}
|
|
27
|
-
if (option['valueString']) {
|
|
28
|
-
return (React.createElement(ChoiceRadioSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly }));
|
|
29
|
-
}
|
|
30
|
-
if (option['valueInteger']) {
|
|
31
|
-
return (React.createElement(ChoiceRadioSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly }));
|
|
32
|
-
}
|
|
33
|
-
return null;
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
export default RadioButtons;
|
|
37
|
-
//# sourceMappingURL=RadioButtons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtons.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/RadioButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAQjE,SAAS,YAAY,CAAC,KAAwB;;IAC5C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACL,0CACG,MAAA,KAAK,CAAC,YAAY,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QAClC,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EAClC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EACpC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,EACjE,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAM,CAAC,WAAW,EACvB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAM,CAAC,YAAY,EACxB,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem } from 'fhir/r4';
|
|
3
|
-
interface RadioButtonsProps {
|
|
4
|
-
qItem: QuestionnaireItem;
|
|
5
|
-
readOnly: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare function RadioButtonsAnswerOption(props: RadioButtonsProps): React.JSX.Element;
|
|
8
|
-
export default RadioButtonsAnswerOption;
|
|
@@ -1,37 +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 ChoiceRadioSingle from '../ChoiceItems/ChoiceRadioSingle';
|
|
19
|
-
function RadioButtonsAnswerOption(props) {
|
|
20
|
-
var _a;
|
|
21
|
-
const { qItem, readOnly } = props;
|
|
22
|
-
return (React.createElement(React.Fragment, null, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option) => {
|
|
23
|
-
var _a, _b, _c;
|
|
24
|
-
if (option['valueCoding']) {
|
|
25
|
-
return (React.createElement(ChoiceRadioSingle, { key: (_a = option.valueCoding.code) !== null && _a !== void 0 ? _a : '', value: (_b = option.valueCoding.code) !== null && _b !== void 0 ? _b : '', label: (_c = option.valueCoding.display) !== null && _c !== void 0 ? _c : `${option.valueCoding.code}`, readOnly: readOnly }));
|
|
26
|
-
}
|
|
27
|
-
if (option['valueString']) {
|
|
28
|
-
return (React.createElement(ChoiceRadioSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly }));
|
|
29
|
-
}
|
|
30
|
-
if (option['valueInteger']) {
|
|
31
|
-
return (React.createElement(ChoiceRadioSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly }));
|
|
32
|
-
}
|
|
33
|
-
return null;
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
export default RadioButtonsAnswerOption;
|
|
37
|
-
//# sourceMappingURL=RadioButtonsAnswerOption.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtons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CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts
DELETED
|
File without changes
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenChoiceAutocompleteFieldEndAdornment.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.tsx"],"names":[],"mappings":""}
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts
DELETED
|
File without changes
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenChoiceSelectAnswerOptionFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.tsx"],"names":[],"mappings":""}
|