@aehrc/smart-forms-renderer 0.44.3 → 1.0.0-alpha.10
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/.storybook/main.ts +6 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentField.js +3 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentField.js.map +1 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js +2 -5
- package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js.map +1 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.js +3 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.js.map +1 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.d.ts +1 -0
- package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.js +3 -4
- package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.js.map +1 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentItem.d.ts +2 -2
- package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js.map +1 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentUrlField.js +3 -1
- package/lib/components/FormComponents/AttachmentItem/AttachmentUrlField.js.map +1 -1
- package/lib/components/FormComponents/BooleanItem/BooleanField.js +27 -17
- package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
- package/lib/components/FormComponents/BooleanItem/BooleanItem.d.ts +2 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js +2 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
- package/lib/components/FormComponents/BooleanItem/index.d.ts +1 -0
- package/lib/components/FormComponents/BooleanItem/index.js +18 -0
- package/lib/components/FormComponents/BooleanItem/index.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.js +8 -6
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +4 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +4 -5
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +4 -5
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +8 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +7 -13
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +7 -13
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.js +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingle.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +8 -6
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js +4 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +7 -6
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +4 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/index.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/index.js +18 -0
- package/lib/components/FormComponents/ChoiceItems/index.js.map +1 -0
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.js +3 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.d.ts +2 -2
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js +4 -5
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.d.ts +2 -2
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js +4 -5
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js +3 -2
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalField.js +5 -2
- package/lib/components/FormComponents/DecimalItem/DecimalField.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.d.ts +2 -2
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +4 -5
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/DisplayItem/DisplayItem.d.ts +2 -1
- package/lib/components/FormComponents/DisplayItem/DisplayItem.js +13 -2
- package/lib/components/FormComponents/DisplayItem/DisplayItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupAccordion.styles.d.ts +1 -1
- package/lib/components/FormComponents/GroupItem/GroupHeading.js +10 -2
- package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +1 -0
- package/lib/components/FormComponents/GroupItem/GroupItem.js +2 -2
- package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +10 -0
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemView.d.ts +1 -0
- package/lib/components/FormComponents/GroupItem/GroupItemView.js +12 -2
- package/lib/components/FormComponents/GroupItem/GroupItemView.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/PageButtonWrapper.js +7 -0
- package/lib/components/FormComponents/GroupItem/PageButtonWrapper.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/index.d.ts +1 -0
- package/lib/components/FormComponents/GroupItem/index.js +18 -0
- package/lib/components/FormComponents/GroupItem/index.js.map +1 -0
- package/lib/components/FormComponents/IntegerItem/IntegerField.js +5 -2
- package/lib/components/FormComponents/IntegerItem/IntegerField.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerItem.d.ts +2 -2
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js +4 -5
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/CheckboxSingle.js +2 -2
- package/lib/components/FormComponents/ItemParts/CheckboxSingle.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.js +4 -2
- package/lib/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ClearInputButton.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/ClearInputButton.js +33 -0
- package/lib/components/FormComponents/ItemParts/ClearInputButton.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/ContextDisplayItem.js +1 -1
- package/lib/components/FormComponents/ItemParts/ContextDisplayItem.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/FlyoverItem.d.ts +2 -1
- package/lib/components/FormComponents/ItemParts/FlyoverItem.js +2 -2
- package/lib/components/FormComponents/ItemParts/FlyoverItem.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +2 -1
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +9 -8
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js +31 -13
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +7 -21
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.js +4 -2
- package/lib/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/RadioOptionList.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/RadioOptionList.js +4 -4
- package/lib/components/FormComponents/ItemParts/RadioOptionList.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/RequiredAsterisk.d.ts +7 -0
- package/lib/components/FormComponents/ItemParts/RequiredAsterisk.js +35 -0
- package/lib/components/FormComponents/ItemParts/RequiredAsterisk.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/index.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/index.js +1 -0
- package/lib/components/FormComponents/ItemParts/index.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +8 -6
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +4 -4
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +4 -5
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js +4 -5
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +8 -8
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +4 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.js +4 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.js +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +8 -6
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +4 -4
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +7 -6
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +4 -4
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityComparatorField.d.ts +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityComparatorField.js +5 -0
- package/lib/components/FormComponents/QuantityItem/QuantityComparatorField.js.map +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityField.js +5 -2
- package/lib/components/FormComponents/QuantityItem/QuantityField.js.map +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityItem.d.ts +2 -2
- package/lib/components/FormComponents/QuantityItem/QuantityItem.js +15 -11
- package/lib/components/FormComponents/QuantityItem/QuantityItem.js.map +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityUnitField.js +4 -2
- package/lib/components/FormComponents/QuantityItem/QuantityUnitField.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js +3 -3
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/NestedSingleItemAccordion.styles.d.ts +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItem.js +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +26 -18
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItemView.js +5 -4
- package/lib/components/FormComponents/SingleItem/SingleItemView.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleNestedItems.js +1 -0
- package/lib/components/FormComponents/SingleItem/SingleNestedItems.js.map +1 -1
- package/lib/components/FormComponents/SliderItem/SliderField.js +3 -2
- package/lib/components/FormComponents/SliderItem/SliderField.js.map +1 -1
- package/lib/components/FormComponents/SliderItem/SliderItem.d.ts +2 -2
- package/lib/components/FormComponents/SliderItem/SliderItem.js +3 -3
- package/lib/components/FormComponents/SliderItem/SliderItem.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringField.js +5 -2
- package/lib/components/FormComponents/StringItem/StringField.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringItem.d.ts +2 -2
- package/lib/components/FormComponents/StringItem/StringItem.js +4 -5
- package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextField.js +3 -2
- package/lib/components/FormComponents/TextItem/TextField.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextItem.d.ts +2 -2
- package/lib/components/FormComponents/TextItem/TextItem.js +4 -5
- package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
- package/lib/components/FormComponents/Textfield.styles.d.ts +1 -1
- package/lib/components/FormComponents/Textfield.styles.js +5 -6
- package/lib/components/FormComponents/Textfield.styles.js.map +1 -1
- package/lib/components/FormComponents/TimeItem/TimeField.js +3 -2
- package/lib/components/FormComponents/TimeItem/TimeField.js.map +1 -1
- package/lib/components/FormComponents/TimeItem/TimeItem.d.ts +2 -2
- package/lib/components/FormComponents/TimeItem/TimeItem.js +4 -5
- package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
- package/lib/components/FormComponents/UrlItem/UrlField.js +7 -1
- package/lib/components/FormComponents/UrlItem/UrlField.js.map +1 -1
- package/lib/components/FormComponents/UrlItem/UrlItem.d.ts +2 -2
- package/lib/components/FormComponents/UrlItem/UrlItem.js +4 -5
- package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
- package/lib/components/FormComponents/index.d.ts +6 -0
- package/lib/components/FormComponents/index.js +7 -0
- package/lib/components/FormComponents/index.js.map +1 -1
- package/lib/components/Renderer/BaseRenderer.js +5 -5
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/components/Renderer/FormTopLevelItem.js +0 -7
- package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -1
- package/lib/components/index.js.map +1 -1
- package/lib/hooks/index.d.ts +7 -0
- package/lib/hooks/index.js +8 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useBuildForm.d.ts +8 -1
- package/lib/hooks/useBuildForm.js +23 -3
- package/lib/hooks/useBuildForm.js.map +1 -1
- package/lib/hooks/useCodingCalculatedExpression.d.ts +2 -1
- package/lib/hooks/useCodingCalculatedExpression.js +1 -1
- package/lib/hooks/useCodingCalculatedExpression.js.map +1 -1
- package/lib/hooks/useHidden.js +8 -0
- package/lib/hooks/useHidden.js.map +1 -1
- package/lib/hooks/useParseXhtml.d.ts +3 -0
- package/lib/hooks/useParseXhtml.js +60 -0
- package/lib/hooks/useParseXhtml.js.map +1 -0
- package/lib/hooks/useReadOnly.d.ts +1 -1
- package/lib/hooks/useReadOnly.js +22 -1
- package/lib/hooks/useReadOnly.js.map +1 -1
- package/lib/hooks/useRenderingExtensions.d.ts +3 -2
- package/lib/hooks/useValidationFeedback.js +5 -3
- package/lib/hooks/useValidationFeedback.js.map +1 -1
- package/lib/hooks/useValueSetCodings.js +7 -1
- package/lib/hooks/useValueSetCodings.js.map +1 -1
- package/lib/hooks/useXhtmlParse.d.ts +4 -0
- package/lib/hooks/useXhtmlParse.js +63 -0
- package/lib/hooks/useXhtmlParse.js.map +1 -0
- package/lib/index.d.ts +6 -6
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/interfaces/overrideComponent.interface.d.ts +12 -3
- package/lib/interfaces/qItemOverrideComponent.interface.d.ts +7 -6
- package/lib/interfaces/renderProps.interface.d.ts +4 -0
- package/lib/stores/index.d.ts +2 -0
- package/lib/stores/index.js +1 -0
- package/lib/stores/index.js.map +1 -1
- package/lib/stores/questionnaireStore.d.ts +17 -9
- package/lib/stores/questionnaireStore.js +47 -22
- package/lib/stores/questionnaireStore.js.map +1 -1
- package/lib/stores/rendererStylingStore.d.ts +35 -3
- package/lib/stores/rendererStylingStore.js +20 -4
- package/lib/stores/rendererStylingStore.js.map +1 -1
- package/lib/utils/calculatedExpression.d.ts +5 -4
- package/lib/utils/calculatedExpression.js +76 -55
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/enableWhenExpression.d.ts +10 -8
- package/lib/utils/enableWhenExpression.js +153 -118
- package/lib/utils/enableWhenExpression.js.map +1 -1
- package/lib/utils/fhirpath.d.ts +7 -5
- package/lib/utils/fhirpath.js +105 -72
- package/lib/utils/fhirpath.js.map +1 -1
- package/lib/utils/getExpressionsFromItem.d.ts +2 -1
- package/lib/utils/getExpressionsFromItem.js +1 -1
- package/lib/utils/getExpressionsFromItem.js.map +1 -1
- package/lib/utils/index.d.ts +6 -2
- package/lib/utils/index.js +6 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/initialise.d.ts +3 -2
- package/lib/utils/initialise.js +49 -36
- package/lib/utils/initialise.js.map +1 -1
- package/lib/utils/itemControl.d.ts +4 -1
- package/lib/utils/itemControl.js +27 -0
- package/lib/utils/itemControl.js.map +1 -1
- package/lib/utils/manageForm.d.ts +5 -1
- package/lib/utils/manageForm.js +4 -2
- package/lib/utils/manageForm.js.map +1 -1
- package/lib/utils/misc.d.ts +0 -1
- package/lib/utils/misc.js +1 -1
- package/lib/utils/misc.js.map +1 -1
- package/lib/utils/openChoice.js +2 -10
- package/lib/utils/openChoice.js.map +1 -1
- package/lib/utils/page.d.ts +3 -3
- package/lib/utils/page.js +2 -5
- package/lib/utils/page.js.map +1 -1
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +1 -1
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
- package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.d.ts +1 -1
- package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js +166 -150
- package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +1 -1
- package/lib/utils/questionnaireStoreUtils/extractPages.js +5 -11
- package/lib/utils/questionnaireStoreUtils/extractPages.js.map +1 -1
- package/lib/utils/repopulateItems.js +0 -8
- package/lib/utils/repopulateItems.js.map +1 -1
- package/lib/utils/validateQuestionnaire.js +8 -4
- package/lib/utils/validateQuestionnaire.js.map +1 -1
- package/package.json +3 -3
- package/src/components/FormComponents/AttachmentItem/AttachmentField.tsx +4 -0
- package/src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx +17 -15
- package/src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.ts +12 -10
- package/src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.tsx +4 -0
- package/src/components/FormComponents/AttachmentItem/AttachmentItem.tsx +3 -1
- package/src/components/FormComponents/AttachmentItem/AttachmentUrlField.tsx +4 -0
- package/src/components/FormComponents/BooleanItem/BooleanField.tsx +87 -30
- package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +20 -11
- package/src/components/FormComponents/BooleanItem/index.ts +18 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.tsx +16 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +34 -16
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +19 -11
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +20 -12
- package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +19 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +10 -20
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +13 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.tsx +17 -11
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +11 -20
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +21 -13
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioSingle.tsx +5 -4
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +28 -8
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +13 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.tsx +24 -13
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +18 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +32 -14
- package/src/components/FormComponents/ChoiceItems/index.ts +18 -0
- package/src/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateField.tsx +4 -0
- package/src/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.tsx +36 -21
- package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx +40 -25
- package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomTimeField.tsx +4 -19
- package/src/components/FormComponents/DecimalItem/DecimalField.tsx +8 -1
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +33 -18
- package/src/components/FormComponents/DecimalItem/index.ts +18 -0
- package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +18 -3
- package/src/components/FormComponents/GroupItem/GroupHeading.tsx +27 -6
- package/src/components/FormComponents/GroupItem/GroupItem.tsx +3 -0
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +26 -0
- package/src/components/FormComponents/GroupItem/GroupItemView.tsx +34 -1
- package/src/components/FormComponents/GroupItem/PageButtonWrapper.tsx +8 -0
- package/src/components/FormComponents/GroupItem/index.ts +18 -0
- package/src/components/FormComponents/IntegerItem/IntegerField.tsx +8 -1
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +33 -18
- package/src/components/FormComponents/ItemParts/CheckboxSingle.tsx +2 -3
- package/src/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.tsx +4 -1
- package/src/components/FormComponents/ItemParts/ClearInputButton.tsx +52 -0
- package/src/components/FormComponents/ItemParts/ContextDisplayItem.tsx +1 -1
- package/src/components/FormComponents/ItemParts/FlyoverItem.tsx +62 -0
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +23 -9
- package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +64 -13
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +15 -36
- package/src/components/FormComponents/ItemParts/RadioButtonWithOpenLabel.tsx +11 -1
- package/src/components/FormComponents/ItemParts/RadioOptionList.tsx +5 -1
- package/src/components/FormComponents/ItemParts/RequiredAsterisk.tsx +36 -0
- package/src/components/FormComponents/ItemParts/index.ts +19 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +16 -7
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +35 -17
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +25 -17
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.tsx +26 -18
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +19 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +5 -1
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +22 -14
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.tsx +5 -1
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.tsx +23 -15
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +16 -8
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +30 -12
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +24 -9
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +31 -13
- package/src/components/FormComponents/QuantityItem/QuantityComparatorField.tsx +6 -0
- package/src/components/FormComponents/QuantityItem/QuantityField.tsx +8 -1
- package/src/components/FormComponents/QuantityItem/QuantityItem.tsx +56 -35
- package/src/components/FormComponents/QuantityItem/QuantityUnitField.tsx +8 -3
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +1 -1
- package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +34 -28
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +1 -1
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +50 -4
- package/src/components/FormComponents/SingleItem/SingleItemView.tsx +14 -11
- package/src/components/FormComponents/SingleItem/SingleNestedItems.tsx +1 -0
- package/src/components/FormComponents/SliderItem/SliderField.tsx +4 -2
- package/src/components/FormComponents/SliderItem/SliderItem.tsx +26 -18
- package/src/components/FormComponents/StringItem/StringField.tsx +8 -1
- package/src/components/FormComponents/StringItem/StringItem.tsx +33 -18
- package/src/components/FormComponents/StringItem/index.ts +18 -0
- package/src/components/FormComponents/TextItem/TextField.tsx +5 -2
- package/src/components/FormComponents/TextItem/TextItem.tsx +25 -17
- package/src/components/FormComponents/Textfield.styles.ts +5 -7
- package/src/components/FormComponents/TimeItem/TimeField.tsx +4 -2
- package/src/components/FormComponents/TimeItem/TimeItem.tsx +29 -14
- package/src/components/FormComponents/UrlItem/UrlField.tsx +14 -1
- package/src/components/FormComponents/UrlItem/UrlItem.tsx +32 -17
- package/src/components/FormComponents/index.ts +8 -0
- package/src/components/Renderer/BaseRenderer.tsx +5 -5
- package/src/components/Renderer/FormBodyPaginated.tsx +127 -0
- package/src/components/Renderer/FormTopLevelItem.tsx +0 -17
- package/src/components/index.ts +11 -1
- package/src/hooks/index.ts +12 -0
- package/src/hooks/useBuildForm.ts +33 -3
- package/src/hooks/useCodingCalculatedExpression.ts +1 -1
- package/src/hooks/useHidden.ts +12 -0
- package/src/hooks/useParseXhtml.tsx +73 -0
- package/src/hooks/useReadOnly.ts +32 -1
- package/src/hooks/useRenderingExtensions.ts +2 -2
- package/src/hooks/useValidationFeedback.ts +11 -3
- package/src/hooks/useValueSetCodings.ts +10 -6
- package/src/index.ts +49 -6
- package/src/interfaces/index.ts +5 -0
- package/src/interfaces/overrideComponent.interface.ts +39 -0
- package/src/interfaces/renderProps.interface.ts +5 -0
- package/src/stores/index.ts +3 -0
- package/src/stores/questionnaireStore.ts +73 -31
- package/src/stores/rendererStylingStore.ts +120 -0
- package/src/stories/assets/questionnaires/QQuantity.ts +45 -6
- package/src/stories/itemTypes/Attachment.stories.tsx +1 -1
- package/src/stories/itemTypes/Boolean.stories.tsx +1 -1
- package/src/stories/itemTypes/Choice.stories.tsx +1 -1
- package/src/stories/itemTypes/Date.stories.tsx +1 -1
- package/src/stories/itemTypes/DateTime.stories.tsx +1 -1
- package/src/stories/itemTypes/Decimal.stories.tsx +1 -1
- package/src/stories/itemTypes/Display.stories.tsx +1 -1
- package/src/stories/itemTypes/Group.stories.tsx +1 -1
- package/src/stories/itemTypes/Integer.stories.tsx +1 -1
- package/src/stories/itemTypes/OpenChoice.stories.tsx +1 -1
- package/src/stories/itemTypes/Quantity.stories.tsx +1 -1
- package/src/stories/itemTypes/Reference.stories.tsx +1 -1
- package/src/stories/itemTypes/String.stories.tsx +1 -1
- package/src/stories/itemTypes/Text.stories.tsx +1 -1
- package/src/stories/itemTypes/Time.stories.tsx +1 -1
- package/src/stories/itemTypes/Url.stories.tsx +1 -1
- package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +1 -1
- package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +1 -1
- package/src/stories/sdc/AdvancedOther.stories.tsx +1 -1
- package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +1 -1
- package/src/stories/sdc/BehaviorCalculations.stories.tsx +1 -1
- package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +1 -1
- package/src/stories/sdc/BehaviorOther.stories.tsx +1 -1
- package/src/stories/sdc/BehaviorValueConstraints.stories.tsx +1 -1
- package/src/stories/sdc/FormPopulation.stories.tsx +1 -1
- package/src/stories/sdc/ItemControlDisplay.stories.tsx +1 -1
- package/src/stories/sdc/ItemControlGroup.stories.tsx +1 -1
- package/src/stories/sdc/ItemControlQuestion.stories.tsx +1 -1
- package/src/stories/sdc/OtherExtensions.stories.tsx +1 -1
- package/src/stories/testing/AuCoreTester.stories.tsx +1 -1
- package/src/stories/testing/BuildFormButtonTesterWrapper.stories.tsx +1 -1
- package/src/stories/testing/GroupTableTester.stories.tsx +1 -1
- package/src/stories/testing/IdRemoverDebuggerWrapper.stories.tsx +1 -1
- package/src/stories/testing/Mbs715Tester.stories.tsx +1 -1
- package/src/stories/testing/PrePopButtonTesterWrapper.stories.tsx +1 -1
- package/src/stories/testing/ValidateFormTesterWrapper.stories.tsx +1 -1
- package/src/utils/calculatedExpression.ts +29 -15
- package/src/utils/enableWhenExpression.ts +91 -48
- package/src/utils/fhirpath.ts +64 -27
- package/src/utils/getExpressionsFromItem.ts +1 -1
- package/src/utils/index.ts +8 -2
- package/src/utils/initialise.ts +11 -7
- package/src/utils/itemControl.ts +38 -1
- package/src/utils/manageForm.ts +16 -2
- package/src/utils/misc.ts +1 -1
- package/src/utils/openChoice.ts +2 -13
- package/src/utils/page.ts +4 -11
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +1 -1
- package/src/utils/questionnaireStoreUtils/extractOtherExtensions.ts +20 -18
- package/src/utils/questionnaireStoreUtils/extractPages.ts +5 -12
- package/src/utils/repopulateItems.ts +0 -11
- package/src/utils/validateQuestionnaire.ts +6 -1
- package/vite.config.ts +2 -2
- package/src/components/Renderer/FormBodyPage.tsx +0 -93
- package/src/components/Renderer/FormTopLevelPage.tsx +0 -70
|
@@ -23,12 +23,22 @@ import SingleItem from '../SingleItem/SingleItem';
|
|
|
23
23
|
import useHidden from '../../../hooks/useHidden';
|
|
24
24
|
import GroupItem from './GroupItem';
|
|
25
25
|
import GridGroup from '../GridGroup/GridGroup';
|
|
26
|
+
import { useQuestionnaireStore } from '../../../stores';
|
|
26
27
|
function GroupItemSwitcher(props) {
|
|
27
28
|
const { qItem, qrItemOrItems, groupCardElevation, parentIsReadOnly, parentIsRepeatGroup, parentRepeatGroupIndex, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
29
|
+
const qItemOverrideComponents = useQuestionnaireStore.use.qItemOverrideComponents();
|
|
30
|
+
const QItemOverrideComponent = qItemOverrideComponents[qItem.linkId];
|
|
28
31
|
const itemIsHidden = useHidden(qItem, parentRepeatGroupIndex);
|
|
29
32
|
if (itemIsHidden) {
|
|
30
33
|
return null;
|
|
31
34
|
}
|
|
35
|
+
// If a qItem (type=group) override component is defined for this item, render it
|
|
36
|
+
// Don't get too strict with the "typeof" checks for now
|
|
37
|
+
if (qItem.type === 'group' &&
|
|
38
|
+
QItemOverrideComponent &&
|
|
39
|
+
typeof QItemOverrideComponent === 'function') {
|
|
40
|
+
return (React.createElement(QItemOverrideComponent, { qItem: qItem, qrItem: qrItemOrItems !== null && qrItemOrItems !== void 0 ? qrItemOrItems : null, isRepeated: !!qItem.repeats, groupCardElevation: groupCardElevation, parentIsReadOnly: parentIsReadOnly, parentIsRepeatGroup: parentIsRepeatGroup, parentRepeatGroupIndex: parentRepeatGroupIndex, onQrItemChange: onQrItemChange, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
41
|
+
}
|
|
32
42
|
// If there are multiple answers
|
|
33
43
|
const hasMultipleAnswers = Array.isArray(qrItemOrItems);
|
|
34
44
|
if (hasMultipleAnswers) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,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;
|
|
1
|
+
{"version":3,"file":"GroupItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,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aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,KAAK,EACjB,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,sBAAsB,EAAE,sBAAsB,EAC9C,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,uCAAuC;IACvC,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,EACf,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,sBAAsB,EAAE,sBAAsB,EAC9C,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -8,6 +8,7 @@ interface GroupItemViewProps extends PropsWithQrItemChangeHandler, PropsWithQrRe
|
|
|
8
8
|
childQItems: QuestionnaireItem[];
|
|
9
9
|
qrItemsByIndex: (QuestionnaireResponseItem | QuestionnaireResponseItem[] | undefined)[];
|
|
10
10
|
groupCardElevation: number;
|
|
11
|
+
disableCardView?: boolean;
|
|
11
12
|
tabIsMarkedAsComplete?: boolean;
|
|
12
13
|
tabs?: Tabs;
|
|
13
14
|
currentTabIndex?: number;
|
|
@@ -29,8 +29,8 @@ import useReadOnly from '../../../hooks/useReadOnly';
|
|
|
29
29
|
import { GroupAccordion } from './GroupAccordion.styles';
|
|
30
30
|
import PageButtonsWrapper from './PageButtonWrapper';
|
|
31
31
|
function GroupItemView(props) {
|
|
32
|
-
const { qItem, childQItems, qrItemsByIndex, isRepeated, groupCardElevation, tabIsMarkedAsComplete, tabs, currentTabIndex, pageIsMarkedAsComplete, pages, currentPageIndex, parentIsReadOnly, parentIsRepeatGroup, parentRepeatGroupIndex, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
33
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
32
|
+
const { qItem, childQItems, qrItemsByIndex, isRepeated, groupCardElevation, disableCardView, tabIsMarkedAsComplete, tabs, currentTabIndex, pageIsMarkedAsComplete, pages, currentPageIndex, parentIsReadOnly, parentIsRepeatGroup, parentRepeatGroupIndex, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
33
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly, parentRepeatGroupIndex);
|
|
34
34
|
// Render collapsible group item
|
|
35
35
|
// If group item is a repeating instance, do not render group item as collapsible
|
|
36
36
|
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
@@ -51,6 +51,16 @@ function GroupItemView(props) {
|
|
|
51
51
|
React.createElement(TabButtonsWrapper, { currentTabIndex: currentTabIndex, tabs: tabs }),
|
|
52
52
|
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPageIndex, pages: pages })))));
|
|
53
53
|
}
|
|
54
|
+
// Disable card view - currently only available via disablePageCardView API
|
|
55
|
+
if (disableCardView) {
|
|
56
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: isRepeated, "data-test": "q-item-group-box" },
|
|
57
|
+
childQItems.map((qItem, i) => {
|
|
58
|
+
const qrItemOrItems = qrItemsByIndex[i];
|
|
59
|
+
return (React.createElement(GroupItemSwitcher, { key: qItem.linkId, qItem: qItem, qrItemOrItems: qrItemOrItems, groupCardElevation: groupCardElevation, parentIsReadOnly: readOnly, parentIsRepeatGroup: parentIsRepeatGroup, parentRepeatGroupIndex: parentRepeatGroupIndex, onQrItemChange: onQrItemChange, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
60
|
+
}),
|
|
61
|
+
React.createElement(TabButtonsWrapper, { currentTabIndex: currentTabIndex, tabs: tabs }),
|
|
62
|
+
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPageIndex, pages: pages })));
|
|
63
|
+
}
|
|
54
64
|
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: isRepeated, "data-test": "q-item-group-box" },
|
|
55
65
|
React.createElement(GroupCard, { elevation: groupCardElevation, isRepeated: isRepeated },
|
|
56
66
|
React.createElement(GroupHeading, { qItem: qItem, readOnly: readOnly, tabIsMarkedAsComplete: tabIsMarkedAsComplete, pageIsMarkedAsComplete: pageIsMarkedAsComplete, isRepeated: isRepeated }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupItemView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAUtD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,kBAAkB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupItemView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAA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CAAC;gBAExC,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,QAAQ,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,sBAAsB,EAAE,sBAAsB,EAC9C,cAAc,EAAE,cAAc,EAC9B,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC;YACJ,CAAC,CAAC;YAGF,oBAAC,iBAAiB,IAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,GAAI;YACnE,oBAAC,kBAAkB,IAAC,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAI,CAC9D,CACO,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -5,9 +5,11 @@ import { useQuestionnaireStore } from '../../../stores';
|
|
|
5
5
|
import NextPageButton from './NextPageButton';
|
|
6
6
|
import PreviousPageButton from './PreviousPageButton';
|
|
7
7
|
import useNextAndPreviousVisiblePages from '../../../hooks/useNextAndPreviousVisiblePages';
|
|
8
|
+
import { useRendererStylingStore } from '../../../stores/rendererStylingStore';
|
|
8
9
|
const PageButtonsWrapper = memo(function PageButtonsWrapper(props) {
|
|
9
10
|
const { currentPageIndex, pages } = props;
|
|
10
11
|
const switchPage = useQuestionnaireStore.use.switchPage();
|
|
12
|
+
const disablePageButtons = useRendererStylingStore.use.disablePageButtons();
|
|
11
13
|
const { previousPageIndex, nextPageIndex, numOfVisiblePages } = useNextAndPreviousVisiblePages(currentPageIndex, pages);
|
|
12
14
|
const pagesNotDefined = currentPageIndex === undefined || pages === undefined;
|
|
13
15
|
// Event handlers
|
|
@@ -27,9 +29,14 @@ const PageButtonsWrapper = memo(function PageButtonsWrapper(props) {
|
|
|
27
29
|
// Scroll to top of page
|
|
28
30
|
window.scrollTo(0, 0);
|
|
29
31
|
}
|
|
32
|
+
// No pages defined, do not render page buttons
|
|
30
33
|
if (pagesNotDefined) {
|
|
31
34
|
return null;
|
|
32
35
|
}
|
|
36
|
+
// Disable page buttons - currently only available via disableTabButtons API
|
|
37
|
+
if (disablePageButtons) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
33
40
|
const previousPageButtonHidden = previousPageIndex === null;
|
|
34
41
|
const nextPageButtonHidden = nextPageIndex === null;
|
|
35
42
|
// This is more of a fallback check to prevent the user from navigating to an invisble page if buttons are visble for some reason
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageButtonWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/PageButtonWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"PageButtonWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/PageButtonWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,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,IAAC,OAAO,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAC,QAAQ;QACpD,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,GAAI;QACpB,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,gBAAgB;;YAC9C,GAAG,gBAAgB,GAAG,CAAC,MAAM,iBAAiB,EAAE,CAC3C;QACb,oBAAC,kBAAkB,IACjB,UAAU,EAAE,mBAAmB,IAAI,wBAAwB,EAC3D,mBAAmB,EAAE,6BAA6B,GAClD;QACF,oBAAC,cAAc,IACb,UAAU,EAAE,mBAAmB,IAAI,oBAAoB,EACvD,eAAe,EAAE,yBAAyB,GAC1C,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GroupItem } from './GroupItem';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { default as GroupItem } from './GroupItem';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -18,12 +18,15 @@ import React from 'react';
|
|
|
18
18
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
19
19
|
import { StandardTextField } from '../Textfield.styles';
|
|
20
20
|
import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
|
|
21
|
+
import { useRendererStylingStore } from '../../../stores';
|
|
22
|
+
import Typography from '@mui/material/Typography';
|
|
21
23
|
function IntegerField(props) {
|
|
22
24
|
const { linkId, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, calcExpUpdated, isTabled, onInputChange } = props;
|
|
23
|
-
|
|
25
|
+
const textFieldWidth = useRendererStylingStore.use.textFieldWidth();
|
|
26
|
+
return (React.createElement(StandardTextField, { id: linkId, value: input, error: !!feedback, helperText: feedback, onChange: (event) => onInputChange(event.target.value), disabled: readOnly, label: displayPrompt, placeholder: entryFormat === '' ? '0' : entryFormat, fullWidth: true, textFieldWidth: textFieldWidth, isTabled: isTabled, size: "small", inputProps: { inputMode: 'numeric', pattern: '[0-9]*' }, InputProps: {
|
|
24
27
|
endAdornment: (React.createElement(InputAdornment, { position: 'end' },
|
|
25
28
|
React.createElement(FadingCheckIcon, { fadeIn: calcExpUpdated, disabled: readOnly }),
|
|
26
|
-
displayUnit))
|
|
29
|
+
React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.secondary' }, displayUnit)))
|
|
27
30
|
}, "data-test": "q-item-integer-field" }));
|
|
28
31
|
}
|
|
29
32
|
export default IntegerField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/IntegerItem/IntegerField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KA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,EAClB,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EACvD,UAAU,EAAE;YACV,YAAY,EAAE,CACZ,oBAAC,cAAc,IAAC,QAAQ,EAAE,KAAK;gBAC7B,oBAAC,eAAe,IAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAI;gBAC/D,oBAAC,UAAU,IAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,IAC7D,WAAW,CACD,CACE,CAClB;SACF,eACS,sBAAsB,GAChC,CACH,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface IntegerItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
4
|
+
interface IntegerItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React, { useCallback, useState } from 'react';
|
|
18
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
19
18
|
import useValidationFeedback from '../../../hooks/useValidationFeedback';
|
|
20
19
|
import debounce from 'lodash.debounce';
|
|
21
20
|
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
@@ -27,12 +26,13 @@ import { parseIntegerString } from '../../../utils/parseInputs';
|
|
|
27
26
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
28
27
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
29
28
|
import { useQuestionnaireStore } from '../../../stores';
|
|
29
|
+
import { ItemLabelWrapper } from '../ItemParts';
|
|
30
30
|
function IntegerItem(props) {
|
|
31
31
|
var _a;
|
|
32
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
32
|
+
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, parentIsReadOnly, onQrItemChange } = props;
|
|
33
33
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
34
34
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
35
|
-
const { displayUnit, displayPrompt, entryFormat } =
|
|
35
|
+
const { displayUnit, displayPrompt, entryFormat } = renderingExtensions;
|
|
36
36
|
// Init input value
|
|
37
37
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
38
38
|
let valueInteger = 0;
|
|
@@ -81,8 +81,7 @@ function IntegerItem(props) {
|
|
|
81
81
|
return (React.createElement(IntegerField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }));
|
|
82
82
|
}
|
|
83
83
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-integer-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
84
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
85
|
-
React.createElement(IntegerField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }))));
|
|
84
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(IntegerField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }) })));
|
|
86
85
|
}
|
|
87
86
|
export default IntegerItem;
|
|
88
87
|
//# sourceMappingURL=IntegerItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/IntegerItem/IntegerItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IntegerItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/IntegerItem/IntegerItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASrD,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AACzE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EA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,EAAE,iBAAiB,GAChC,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import Checkbox from '@mui/material/Checkbox';
|
|
19
|
-
import
|
|
19
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
20
20
|
function CheckboxSingle(props) {
|
|
21
21
|
const { value, label, readOnly, isChecked, onCheckedChange } = props;
|
|
22
|
-
return (React.createElement(
|
|
22
|
+
return (React.createElement(FormControlLabel, { disabled: readOnly, control: React.createElement(Checkbox, { size: "small", checked: isChecked, onChange: () => onCheckedChange(value) }), label: label }));
|
|
23
23
|
}
|
|
24
24
|
export default CheckboxSingle;
|
|
25
25
|
//# sourceMappingURL=CheckboxSingle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxSingle.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/CheckboxSingle.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"CheckboxSingle.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/CheckboxSingle.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAU9D,SAAS,cAAc,CAAC,KAAY;IAClC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAErE,OAAO,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EACL,oBAAC,QAAQ,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,GAAI,EAEvF,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -19,8 +19,10 @@ import Box from '@mui/material/Box';
|
|
|
19
19
|
import Checkbox from '@mui/material/Checkbox';
|
|
20
20
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
21
21
|
import { StandardTextField } from '../Textfield.styles';
|
|
22
|
+
import { useRendererStylingStore } from '../../../stores';
|
|
22
23
|
function CheckboxSingleWithOpenLabel(props) {
|
|
23
24
|
const { value, label, isChecked, onCheckedChange, onInputChange } = props;
|
|
25
|
+
const textFieldWidth = useRendererStylingStore.use.textFieldWidth();
|
|
24
26
|
function handleCheckedChange(event) {
|
|
25
27
|
onCheckedChange(event.target.checked);
|
|
26
28
|
}
|
|
@@ -28,8 +30,8 @@ function CheckboxSingleWithOpenLabel(props) {
|
|
|
28
30
|
onInputChange(event.target.value);
|
|
29
31
|
}
|
|
30
32
|
return (React.createElement(Box, { "data-test": "q-item-checkbox-open-label-box" },
|
|
31
|
-
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { size: "small", checked: isChecked, onChange: handleCheckedChange }), label: label + ':'
|
|
32
|
-
React.createElement(StandardTextField, { disabled: !isChecked, value: value, onChange: handleInputChange, fullWidth: true, isTabled: false, size: "small", "data-test": "q-item-checkbox-open-label-field" })));
|
|
33
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { size: "small", checked: isChecked, onChange: handleCheckedChange }), label: label + ':' }),
|
|
34
|
+
React.createElement(StandardTextField, { disabled: !isChecked, value: value, onChange: handleInputChange, fullWidth: true, textFieldWidth: textFieldWidth, isTabled: false, size: "small", "data-test": "q-item-checkbox-open-label-field" })));
|
|
33
35
|
}
|
|
34
36
|
export default CheckboxSingleWithOpenLabel;
|
|
35
37
|
//# sourceMappingURL=CheckboxSingleWithOpenLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxSingleWithOpenLabel.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxSingleWithOpenLabel.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/CheckboxSingleWithOpenLabel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAU1D,SAAS,2BAA2B,CAAC,KAAY;IAC/C,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAE1E,MAAM,cAAc,GAAG,uBAAuB,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IAEpE,SAAS,mBAAmB,CAAC,KAAoC;QAC/D,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,iBAAiB,CAAC,KAAoC;QAC7D,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CACL,oBAAC,GAAG,iBAAW,gCAAgC;QAC7C,oBAAC,gBAAgB,IACf,OAAO,EAAE,oBAAC,QAAQ,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,GAAI,EACrF,KAAK,EAAE,KAAK,GAAG,GAAG,GAClB;QACF,oBAAC,iBAAiB,IAChB,QAAQ,EAAE,CAAC,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,QACT,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,KAAK,EACf,IAAI,EAAC,OAAO,eACF,kCAAkC,GAC5C,CACE,CACP,CAAC;AACJ,CAAC;AAED,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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 Tooltip from '@mui/material/Tooltip';
|
|
19
|
+
import Button from '@mui/material/Button';
|
|
20
|
+
import { grey } from '@mui/material/colors';
|
|
21
|
+
import Fade from '@mui/material/Fade';
|
|
22
|
+
function ClearInputButton(props) {
|
|
23
|
+
const { buttonShown, readOnly, onClear } = props;
|
|
24
|
+
return (React.createElement(Fade, { in: buttonShown, timeout: 100 },
|
|
25
|
+
React.createElement(Tooltip, { title: "Set question as unanswered" },
|
|
26
|
+
React.createElement("span", null,
|
|
27
|
+
React.createElement(Button, { sx: {
|
|
28
|
+
color: grey['500'],
|
|
29
|
+
'&:hover': { backgroundColor: grey['200'] }
|
|
30
|
+
}, disabled: readOnly, onClick: onClear }, "Clear")))));
|
|
31
|
+
}
|
|
32
|
+
export default ClearInputButton;
|
|
33
|
+
//# sourceMappingURL=ClearInputButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClearInputButton.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ClearInputButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAQtC,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEjD,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG;QACjC,oBAAC,OAAO,IAAC,KAAK,EAAC,4BAA4B;YACzC;gBACE,oBAAC,MAAM,IACL,EAAE,EAAE;wBACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC;wBAClB,SAAS,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;qBAC5C,EACD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,YAET,CACJ,CACC,CACL,CACR,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -23,7 +23,7 @@ const ContextDisplayItem = memo(function GroupHeadingIcon(props) {
|
|
|
23
23
|
if (itemIsHidden) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
return React.createElement(ItemLabelText, { qItem: displayItem });
|
|
26
|
+
return React.createElement(ItemLabelText, { qItem: displayItem, readOnly: false });
|
|
27
27
|
});
|
|
28
28
|
export default ContextDisplayItem;
|
|
29
29
|
//# sourceMappingURL=ContextDisplayItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextDisplayItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ContextDisplayItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAM5C,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,gBAAgB,CAAC,KAA4B;IACpF,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,YAAY,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IAC5C,IAAI,YAAY,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,oBAAC,aAAa,IAAC,KAAK,EAAE,WAAW,GAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextDisplayItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ContextDisplayItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAM5C,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,gBAAgB,CAAC,KAA4B;IACpF,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,YAAY,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IAC5C,IAAI,YAAY,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,oBAAC,aAAa,IAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,GAAI,CAAC;AAChE,CAAC,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface FlyoverItemProps {
|
|
3
|
-
displayFlyover: string;
|
|
3
|
+
displayFlyover: string | JSX.Element | JSX.Element[];
|
|
4
|
+
readOnly: boolean;
|
|
4
5
|
}
|
|
5
6
|
declare function FlyoverItem(props: FlyoverItemProps): React.JSX.Element;
|
|
6
7
|
export default FlyoverItem;
|
|
@@ -19,12 +19,12 @@ import Tooltip from '@mui/material/Tooltip';
|
|
|
19
19
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
20
20
|
import { useQuestionnaireStore } from '../../../stores';
|
|
21
21
|
function FlyoverItem(props) {
|
|
22
|
-
const { displayFlyover } = props;
|
|
22
|
+
const { displayFlyover, readOnly } = props;
|
|
23
23
|
const sdcUiOverrideComponents = useQuestionnaireStore.use.sdcUiOverrideComponents();
|
|
24
24
|
const FlyoverOverrideComponent = sdcUiOverrideComponents['flyover'];
|
|
25
25
|
// If a flyover override component is defined for this item, render it
|
|
26
26
|
if (FlyoverOverrideComponent && typeof FlyoverOverrideComponent === 'function') {
|
|
27
|
-
return React.createElement(FlyoverOverrideComponent, { displayText: displayFlyover });
|
|
27
|
+
return React.createElement(FlyoverOverrideComponent, { displayText: displayFlyover, readOnly: readOnly });
|
|
28
28
|
}
|
|
29
29
|
return (React.createElement(Tooltip, { title: displayFlyover, placement: "top", slotProps: {
|
|
30
30
|
popper: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlyoverItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/FlyoverItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"FlyoverItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/FlyoverItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAOxD,SAAS,WAAW,CAAC,KAAuB;IAC1C,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE3C,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC;IACpF,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAEpE,sEAAsE;IACtE,IAAI,wBAAwB,IAAI,OAAO,wBAAwB,KAAK,UAAU,EAAE;QAC9E,OAAO,oBAAC,wBAAwB,IAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;KACtF;IAED,OAAO,CACL,oBAAC,OAAO,IACN,KAAK,EAAE,cAAc,EACrB,SAAS,EAAC,KAAK,EACf,SAAS,EAAE;YACT,MAAM,EAAE;gBACN,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE;4BACP,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;yBAChB;qBACF;iBACF;aACF;SACF;QACD;YACE,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,QAAQ,EAAC,OAAO,GAAG,CACjE,CACC,CACX,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -2,9 +2,10 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { QuestionnaireItem } from 'fhir/r4';
|
|
4
4
|
interface ItemFieldGridProps {
|
|
5
|
-
children: ReactNode;
|
|
6
5
|
qItem: QuestionnaireItem;
|
|
7
6
|
readOnly: boolean;
|
|
7
|
+
labelChildren?: ReactNode;
|
|
8
|
+
fieldChildren?: ReactNode;
|
|
8
9
|
}
|
|
9
10
|
declare function ItemFieldGrid(props: ItemFieldGridProps): React.JSX.Element;
|
|
10
11
|
export default ItemFieldGrid;
|
|
@@ -15,22 +15,23 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
|
-
import Grid from '@mui/material/
|
|
19
|
-
import DisplayInstructions from '../DisplayItem/DisplayInstructions';
|
|
20
|
-
import LabelWrapper from './ItemLabelWrapper';
|
|
18
|
+
import Grid from '@mui/material/Unstable_Grid2';
|
|
21
19
|
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
22
20
|
import Box from '@mui/material/Box';
|
|
21
|
+
import { useRendererStylingStore } from '../../../stores';
|
|
22
|
+
import DisplayInstructions from '../DisplayItem/DisplayInstructions';
|
|
23
23
|
function ItemFieldGrid(props) {
|
|
24
|
-
const {
|
|
24
|
+
const { qItem, readOnly, labelChildren, fieldChildren } = props;
|
|
25
|
+
const itemLabelGridBreakpoints = useRendererStylingStore.use.itemLabelGridBreakpoints();
|
|
26
|
+
const itemFieldGridBreakpoints = useRendererStylingStore.use.itemFieldGridBreakpoints();
|
|
25
27
|
const { displayInstructions } = useRenderingExtensions(qItem);
|
|
26
28
|
return (React.createElement(Grid, { container: true, columnSpacing: 4 },
|
|
27
|
-
React.createElement(Grid, {
|
|
28
|
-
React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
|
|
29
|
+
React.createElement(Grid, { xs: itemLabelGridBreakpoints.xs, sm: itemLabelGridBreakpoints.sm, md: itemLabelGridBreakpoints.md, lg: itemLabelGridBreakpoints.lg, xl: itemLabelGridBreakpoints.xl }, labelChildren),
|
|
29
30
|
React.createElement(Box, { sx: {
|
|
30
31
|
my: { xs: 1.5, md: 0 } // Adds padding for `xs` breakpoint and removes it for `md` and up
|
|
31
32
|
} }),
|
|
32
|
-
React.createElement(Grid, {
|
|
33
|
-
|
|
33
|
+
React.createElement(Grid, { xs: itemFieldGridBreakpoints.xs, sm: itemFieldGridBreakpoints.sm, md: itemFieldGridBreakpoints.md, lg: itemFieldGridBreakpoints.lg, xl: itemFieldGridBreakpoints.xl },
|
|
34
|
+
fieldChildren,
|
|
34
35
|
React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly }))));
|
|
35
36
|
}
|
|
36
37
|
export default ItemFieldGrid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemFieldGrid.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ItemFieldGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"ItemFieldGrid.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ItemFieldGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,8BAA8B,CAAC;AAEhD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,GAAG,MAAM,mBAAmB,C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CAAC"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { QuestionnaireItem } from 'fhir/r4';
|
|
3
3
|
interface ItemLabelTextProps {
|
|
4
4
|
qItem: QuestionnaireItem;
|
|
5
|
-
readOnly
|
|
5
|
+
readOnly: boolean;
|
|
6
6
|
}
|
|
7
7
|
declare const ItemLabelText: React.NamedExoticComponent<ItemLabelTextProps>;
|
|
8
8
|
export default ItemLabelText;
|
|
@@ -15,33 +15,45 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React, { memo } from 'react';
|
|
18
|
-
import { getMarkdownString
|
|
19
|
-
import { default as htmlParse } from 'html-react-parser';
|
|
18
|
+
import { getMarkdownString } from '../../../utils/itemControl';
|
|
20
19
|
import Box from '@mui/material/Box';
|
|
21
20
|
import ReactMarkdown from 'react-markdown';
|
|
22
21
|
import Typography from '@mui/material/Typography';
|
|
23
22
|
import useDisplayCqfAndCalculatedExpression from '../../../hooks/useDisplayCqfAndCalculatedExpression';
|
|
24
23
|
import { structuredDataCapture } from 'fhir-sdc-helpers';
|
|
25
24
|
import { default as styleParse } from 'style-to-js';
|
|
25
|
+
import { useRendererStylingStore } from '../../../stores/rendererStylingStore';
|
|
26
|
+
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
27
|
+
import FlyoverItem from './FlyoverItem';
|
|
28
|
+
import { useParseXhtml } from '../../../hooks/useParseXhtml';
|
|
29
|
+
import RequiredAsterisk from './RequiredAsterisk';
|
|
26
30
|
const ItemLabelText = memo(function ItemLabelText(props) {
|
|
27
31
|
var _a, _b;
|
|
28
32
|
const { qItem, readOnly } = props;
|
|
33
|
+
const itemLabelFontWeight = useRendererStylingStore.use.itemLabelFontWeight();
|
|
34
|
+
const requiredIndicatorPosition = useRendererStylingStore.use.requiredIndicatorPosition();
|
|
35
|
+
const { required, displayFlyover } = useRenderingExtensions(qItem);
|
|
29
36
|
let labelText = (_a = qItem.text) !== null && _a !== void 0 ? _a : '';
|
|
30
37
|
// Use calculatedExpressionString if available
|
|
31
38
|
const calculatedExpressionString = (_b = useDisplayCqfAndCalculatedExpression(qItem)) !== null && _b !== void 0 ? _b : '';
|
|
32
39
|
if (calculatedExpressionString) {
|
|
33
40
|
labelText = calculatedExpressionString;
|
|
34
41
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
const parsedXhtml = useParseXhtml(qItem);
|
|
43
|
+
if (parsedXhtml) {
|
|
44
|
+
return (React.createElement(Box, { display: "flex", flexGrow: 1 },
|
|
45
|
+
parsedXhtml,
|
|
46
|
+
required && requiredIndicatorPosition === 'end' ? (React.createElement(RequiredAsterisk, null, "*")) : null,
|
|
47
|
+
displayFlyover !== '' ? (React.createElement(FlyoverItem, { displayFlyover: displayFlyover, readOnly: readOnly })) : null));
|
|
39
48
|
}
|
|
40
49
|
// parse markdown if found
|
|
41
50
|
const markdownString = getMarkdownString(qItem);
|
|
42
51
|
if (markdownString) {
|
|
43
|
-
return (React.createElement(Box,
|
|
44
|
-
React.createElement(ReactMarkdown, null, markdownString)
|
|
52
|
+
return (React.createElement(Box, { display: "flex" },
|
|
53
|
+
React.createElement(ReactMarkdown, null, markdownString),
|
|
54
|
+
required && requiredIndicatorPosition === 'end' ? (React.createElement(RequiredAsterisk, null, "*")) : null,
|
|
55
|
+
React.createElement(FlyoverItem, { displayFlyover: displayFlyover, readOnly: readOnly }),
|
|
56
|
+
displayFlyover !== '' ? (React.createElement(FlyoverItem, { displayFlyover: displayFlyover, readOnly: readOnly })) : null));
|
|
45
57
|
}
|
|
46
58
|
// labelText is empty, return null
|
|
47
59
|
if (!labelText) {
|
|
@@ -51,13 +63,19 @@ const ItemLabelText = memo(function ItemLabelText(props) {
|
|
|
51
63
|
const stylesString = structuredDataCapture.getStyle(qItem._text);
|
|
52
64
|
if (stylesString) {
|
|
53
65
|
const styles = styleParse(stylesString);
|
|
54
|
-
return React.createElement(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
return (React.createElement(Box, { display: "flex" },
|
|
67
|
+
React.createElement("div", { style: styles }, labelText),
|
|
68
|
+
required && requiredIndicatorPosition === 'end' ? (React.createElement(RequiredAsterisk, null, "*")) : null,
|
|
69
|
+
displayFlyover !== '' ? (React.createElement(FlyoverItem, { displayFlyover: displayFlyover, readOnly: readOnly })) : null));
|
|
58
70
|
}
|
|
71
|
+
const textFontWeight = itemLabelFontWeight != 'default' ? itemLabelFontWeight : 'normal';
|
|
59
72
|
// parse regular text
|
|
60
|
-
return (React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.primary', sx: { mt: 0.25 } },
|
|
73
|
+
return (React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.primary', fontWeight: itemLabelFontWeight ? itemLabelFontWeight : 'normal', sx: { mt: 0.25 } },
|
|
74
|
+
labelText,
|
|
75
|
+
required && requiredIndicatorPosition === 'end' ? (React.createElement(RequiredAsterisk, { readOnly: readOnly, component: "span", fontWeight: itemLabelFontWeight ? itemLabelFontWeight : 'normal', sx: { verticalAlign: 'middle' } }, "*")) : null,
|
|
76
|
+
React.createElement(Typography, { component: "span", sx: { mr: 0.75 } }),
|
|
77
|
+
displayFlyover !== '' ? (React.createElement(Typography, { component: "span" },
|
|
78
|
+
React.createElement(FlyoverItem, { displayFlyover: displayFlyover, readOnly: readOnly }))) : null));
|
|
61
79
|
});
|
|
62
80
|
export default ItemLabelText;
|
|
63
81
|
//# sourceMappingURL=ItemLabelText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemLabelText.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ItemLabelText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"ItemLabelText.js","sour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