@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
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import { LocalizationProvider, TimePicker as MuiTimePicker } from '@mui/x-date-pickers';
|
|
19
19
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
20
|
-
import {
|
|
20
|
+
import { useRendererStylingStore } from '../../../stores';
|
|
21
21
|
function TimeField(props) {
|
|
22
22
|
const { value, displayPrompt, entryFormat, readOnly, isTabled, onTimeChange } = props;
|
|
23
|
+
const textFieldWidth = useRendererStylingStore.use.textFieldWidth();
|
|
23
24
|
return (React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
24
|
-
React.createElement(MuiTimePicker, { format: entryFormat !== '' ? entryFormat : 'hh:mm a', value: value, disabled: readOnly, label: displayPrompt, sx: { maxWidth: !isTabled ?
|
|
25
|
+
React.createElement(MuiTimePicker, { format: entryFormat !== '' ? entryFormat : 'hh:mm a', value: value, disabled: readOnly, label: displayPrompt, sx: { maxWidth: !isTabled ? textFieldWidth : 3000, minWidth: 160 }, slotProps: {
|
|
25
26
|
textField: {
|
|
26
27
|
fullWidth: true
|
|
27
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TimeField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAU1D,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAEtF,MAAM,cAAc,GAAG,uBAAuB,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IAEpE,OAAO,CACL,oBAAC,oBAAoB,IAAC,WAAW,EAAE,YAAY;QAC7C,oBAAC,aAAa,IACZ,MAAM,EAAE,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACpD,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,EACpB,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EAClE,SAAS,EAAE;gBACT,SAAS,EAAE;oBACT,SAAS,EAAE,IAAI;iBAChB;aACF,EACD,QAAQ,EAAE,YAAY,GACtB,CACmB,CACxB,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,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 TimeItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
4
|
+
interface TimeItemProps 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 from 'react';
|
|
18
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
19
18
|
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
20
19
|
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
21
20
|
import TimeField from './TimeField';
|
|
@@ -23,12 +22,13 @@ import dayjs from 'dayjs';
|
|
|
23
22
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
24
23
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
25
24
|
import { useQuestionnaireStore } from '../../../stores';
|
|
25
|
+
import { ItemLabelWrapper } from '../ItemParts';
|
|
26
26
|
function TimeItem(props) {
|
|
27
27
|
var _a;
|
|
28
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
28
|
+
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, parentIsReadOnly, onQrItemChange } = props;
|
|
29
29
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
30
30
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
31
|
-
const { displayPrompt, entryFormat } =
|
|
31
|
+
const { displayPrompt, entryFormat } = renderingExtensions;
|
|
32
32
|
// Init input value
|
|
33
33
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
34
34
|
let timeString = null;
|
|
@@ -50,8 +50,7 @@ function TimeItem(props) {
|
|
|
50
50
|
return (React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }));
|
|
51
51
|
}
|
|
52
52
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-time-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
53
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
54
|
-
React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }))));
|
|
53
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }) })));
|
|
55
54
|
}
|
|
56
55
|
export default TimeItem;
|
|
57
56
|
//# sourceMappingURL=TimeItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TimeItem/TimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAYhD,SAAS,QAAQ,CAAC,KAAoB;;IACpC,MAAM,EACJ,KAAK,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,mBAAmB,CAAC;IAE3D,mBAAmB;IACnB,MAAM,SAAS,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,M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B,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,EACrE,aAAa,EACX,oBAAC,SAAS,IACR,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,QAAQ,GAClB,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -17,9 +17,15 @@
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
19
19
|
import { StandardTextField } from '../Textfield.styles';
|
|
20
|
+
import { useRendererStylingStore } from '../../../stores';
|
|
21
|
+
import Typography from '@mui/material/Typography';
|
|
20
22
|
function UrlField(props) {
|
|
21
23
|
const { linkId, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, isTabled, onInputChange } = props;
|
|
22
|
-
|
|
24
|
+
const textFieldWidth = useRendererStylingStore.use.textFieldWidth();
|
|
25
|
+
return (React.createElement(StandardTextField, { fullWidth: true, textFieldWidth: textFieldWidth, isTabled: isTabled, id: linkId, value: input, error: !!feedback, onChange: (event) => onInputChange(event.target.value), label: displayPrompt, placeholder: entryFormat, disabled: readOnly, size: "small", InputProps: {
|
|
26
|
+
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
27
|
+
React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.secondary' }, displayUnit)))
|
|
28
|
+
}, helperText: feedback, "data-test": "q-item-url-field" }));
|
|
23
29
|
}
|
|
24
30
|
export default UrlField;
|
|
25
31
|
//# sourceMappingURL=UrlField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAA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AC,CAAC,gBAAgB,IAC7D,WAAW,CACD,CACE,CAClB;SACF,EACD,UAAU,EAAE,QAAQ,eACV,kBAAkB,GAC5B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,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 UrlItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
4
|
+
interface UrlItemProps 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';
|
|
@@ -25,12 +24,13 @@ import UrlField from './UrlField';
|
|
|
25
24
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
26
25
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
27
26
|
import { useQuestionnaireStore } from '../../../stores';
|
|
27
|
+
import { ItemLabelWrapper } from '../ItemParts';
|
|
28
28
|
function UrlItem(props) {
|
|
29
29
|
var _a;
|
|
30
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
30
|
+
const { qItem, qrItem, renderingExtensions, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
31
31
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
32
32
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
33
|
-
const { displayUnit, displayPrompt, entryFormat } =
|
|
33
|
+
const { displayUnit, displayPrompt, entryFormat } = renderingExtensions;
|
|
34
34
|
// Init input value
|
|
35
35
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
36
36
|
let valueUri = '';
|
|
@@ -59,8 +59,7 @@ function UrlItem(props) {
|
|
|
59
59
|
return (React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }));
|
|
60
60
|
}
|
|
61
61
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-url-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
62
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
63
|
-
React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }))));
|
|
62
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }) })));
|
|
64
63
|
}
|
|
65
64
|
export default UrlItem;
|
|
66
65
|
//# sourceMappingURL=UrlItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UrlItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/UrlItem/UrlItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;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,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWhD,SAAS,OAAO,CAAC,KAAmB;;IAClC,MAAM,EACJ,KAAK,EACL,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAA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,CAAC,CAAC;SAC7B;IACH,CAAC,EAAE,iBAAiB,CAAC,EACrB,CAAC,cAAc,EAAE,KAAK,CAAC,CACxB,CAAC,CAAC,oFAAoF;IAEvF,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,QAAQ,IACP,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,YAAY,EAC3B,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;KACH;IACD,OAAO,CACL,oBAAC,yBAAyB,iBACd,gBAAgB,iBACb,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,oBAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,EACrE,aAAa,EACX,oBAAC,QAAQ,IACP,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,YAAY,EAC3B,QAAQ,EAAE,QAAQ,GAClB,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export { SingleItem } from './SingleItem';
|
|
2
|
+
export { GroupItem } from './GroupItem';
|
|
2
3
|
export { RepeatItem } from './RepeatItem';
|
|
3
4
|
export { RepeatGroup } from './RepeatGroup';
|
|
4
5
|
export { GroupTable } from './Tables';
|
|
5
6
|
export { GridGroup } from './GridGroup';
|
|
6
7
|
export { parseFhirDateToDisplayDate } from './DateTimeItems';
|
|
8
|
+
export { ItemFieldGrid, ItemLabelWrapper } from './ItemParts';
|
|
9
|
+
export { BooleanField } from './BooleanItem';
|
|
10
|
+
export { StringField } from './StringItem';
|
|
11
|
+
export { DecimalField } from './DecimalItem';
|
|
12
|
+
export { ChoiceRadioSingle } from './ChoiceItems';
|
|
@@ -15,9 +15,16 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
export { SingleItem } from './SingleItem';
|
|
18
|
+
export { GroupItem } from './GroupItem';
|
|
18
19
|
export { RepeatItem } from './RepeatItem';
|
|
19
20
|
export { RepeatGroup } from './RepeatGroup';
|
|
20
21
|
export { GroupTable } from './Tables';
|
|
21
22
|
export { GridGroup } from './GridGroup';
|
|
22
23
|
export { parseFhirDateToDisplayDate } from './DateTimeItems';
|
|
24
|
+
export { ItemFieldGrid, ItemLabelWrapper } from './ItemParts';
|
|
25
|
+
// item type components
|
|
26
|
+
export { BooleanField } from './BooleanItem';
|
|
27
|
+
export { StringField } from './StringItem';
|
|
28
|
+
export { DecimalField } from './DecimalItem';
|
|
29
|
+
export { ChoiceRadioSingle } from './ChoiceItems';
|
|
23
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FormComponents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FormComponents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE9D,uBAAuB;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -20,8 +20,8 @@ import FormTopLevelItem from './FormTopLevelItem';
|
|
|
20
20
|
import { useQuestionnaireResponseStore, useQuestionnaireStore } from '../../stores';
|
|
21
21
|
import { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
|
|
22
22
|
import { updateQrItemsInGroup } from '../../utils/qrItem';
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
23
|
+
import { isPage } from '../../utils/page';
|
|
24
|
+
import FormBodyPaginated from './FormBodyPaginated';
|
|
25
25
|
import { Container } from '@mui/material';
|
|
26
26
|
/**
|
|
27
27
|
* Main component of the form-rendering engine.
|
|
@@ -61,11 +61,11 @@ function BaseRenderer() {
|
|
|
61
61
|
}
|
|
62
62
|
// If an item has multiple answers, it is a repeat group
|
|
63
63
|
const topLevelQRItemsByIndex = getQrItemsIndex(topLevelQItems, topLevelQRItems, qItemsIndexMap);
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
64
|
+
const formIsPaginated = topLevelQItems.some((i) => isPage(i));
|
|
65
|
+
if (formIsPaginated) {
|
|
66
66
|
return (React.createElement(Fade, { in: true, timeout: 500 },
|
|
67
67
|
React.createElement(Container, { disableGutters: true, maxWidth: "xl", key: responseKey },
|
|
68
|
-
React.createElement(
|
|
68
|
+
React.createElement(FormBodyPaginated, { topLevelQItems: topLevelQItems, topLevelQRItems: topLevelQRItemsByIndex, parentIsReadOnly: readOnly, onQrItemChange: (newTopLevelQRItem) => handleTopLevelQRItemSingleChange(newTopLevelQRItem) }))));
|
|
69
69
|
}
|
|
70
70
|
return (React.createElement(Fade, { in: true, timeout: 500 },
|
|
71
71
|
React.createElement(Container, { disableGutters: true, maxWidth: "xl", key: responseKey }, topLevelQItems.map((qItem, index) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseRenderer.js","sourceRoot":"","sources":["../../../src/components/Renderer/BaseRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BaseRenderer.js","sourceRoot":"","sources":["../../../src/components/Renderer/BaseRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH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AC,iBAAiB,EAAE,EAAE,CACpC,gCAAgC,CAAC,iBAAiB,CAAC,GAErD,CACQ,CACP,CACR,CAAC;KACH;IAED,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG;QAC1B,oBAAC,SAAS,IAAC,cAAc,QAAC,QAAQ,EAAC,IAAI,EAAC,GAAG,EAAE,WAAW,IACrD,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACnC,MAAM,aAAa,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAEpD,OAAO,CACL,oBAAC,gBAAgB,IACf,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,aAAa,EAAE,KAAK,EACpB,qBAAqB,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,IAAI,EAC5C,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,CAAC,iBAAiB,EAAE,EAAE,CACpC,gCAAgC,CAAC,iBAAiB,CAAC,EAErD,qBAAqB,EAAE,CAAC,kBAAkB,EAAE,EAAE,CAC5C,kCAAkC,CAAC,kBAAkB,CAAC,GAExD,CACH,CAAC;QACJ,CAAC,CAAC,CACQ,CACP,CACR,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import FormBodyTabbed from './FormBodyTabbed';
|
|
19
|
-
import FormBodyPage from './FormBodyPage';
|
|
20
19
|
import { containsTabs, isTabContainer } from '../../utils/tabs';
|
|
21
|
-
import { containsPages, isPage } from '../../utils/page';
|
|
22
20
|
import GroupItem from '../FormComponents/GroupItem/GroupItem';
|
|
23
21
|
import SingleItem from '../FormComponents/SingleItem/SingleItem';
|
|
24
22
|
import FormBodyCollapsible from './FormBodyCollapsible';
|
|
@@ -35,8 +33,6 @@ function FormTopLevelItem(props) {
|
|
|
35
33
|
const { topLevelQItem, topLevelQRItemOrItems, parentIsReadOnly, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
36
34
|
const itemIsTabContainer = isTabContainer(topLevelQItem);
|
|
37
35
|
const itemContainsTabs = containsTabs(topLevelQItem);
|
|
38
|
-
const itemIsPageContainer = isPage(topLevelQItem);
|
|
39
|
-
const itemContainsPages = containsPages(topLevelQItem);
|
|
40
36
|
const isTablet = useResponsive('up', 'md');
|
|
41
37
|
const itemIsGroup = topLevelQItem.type === 'group';
|
|
42
38
|
const readOnly = useReadOnly(topLevelQItem, parentIsReadOnly);
|
|
@@ -58,9 +54,6 @@ function FormTopLevelItem(props) {
|
|
|
58
54
|
}
|
|
59
55
|
return (React.createElement(FormBodyCollapsible, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
60
56
|
}
|
|
61
|
-
if (itemContainsPages || itemIsPageContainer) {
|
|
62
|
-
return (React.createElement(FormBodyPage, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
63
|
-
}
|
|
64
57
|
// If form is untabbed, it is rendered as a regular group
|
|
65
58
|
if (itemIsGroup) {
|
|
66
59
|
// Item is 'grid'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormTopLevelItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTopLevelItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"FormTopLevelItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTopLevelItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,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export type { SmartFormsRendererProps } from './Renderer';
|
|
2
2
|
export { SmartFormsRenderer, BaseRenderer } from './Renderer';
|
|
3
|
-
export { SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate } from './FormComponents';
|
|
3
|
+
export { SingleItem, GroupItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate, ItemFieldGrid, ItemLabelWrapper, BooleanField, DecimalField, StringField, ChoiceRadioSingle } from './FormComponents';
|
|
4
|
+
export { FullWidthFormComponentBox } from './Box.styles';
|
package/lib/components/index.js
CHANGED
|
@@ -15,5 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
export { SmartFormsRenderer, BaseRenderer } from './Renderer';
|
|
18
|
-
export { SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate } from './FormComponents';
|
|
18
|
+
export { SingleItem, GroupItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate, ItemFieldGrid, ItemLabelWrapper, BooleanField, DecimalField, StringField, ChoiceRadioSingle } from './FormComponents';
|
|
19
|
+
// Styled MUI components
|
|
20
|
+
export { FullWidthFormComponentBox } from './Box.styles';
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,wBAAwB;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC"}
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export { default as useHidden } from './useHidden';
|
|
2
|
+
export { default as useReadOnly } from './useReadOnly';
|
|
2
3
|
export { default as useBuildForm } from './useBuildForm';
|
|
3
4
|
export { default as useRendererQueryClient } from './useRendererQueryClient';
|
|
5
|
+
export { default as useRenderingExtensions } from './useRenderingExtensions';
|
|
6
|
+
export { default as useValidationFeedback } from './useValidationFeedback';
|
|
7
|
+
export { default as useValueSetCodings } from './useValueSetCodings';
|
|
8
|
+
export { default as useStringCalculatedExpression } from './useStringCalculatedExpression';
|
|
9
|
+
export { default as useDisplayCqfAndCalculatedExpression } from './useDisplayCqfAndCalculatedExpression';
|
|
10
|
+
export { default as useCodingCalculatedExpression, objectIsCoding } from './useCodingCalculatedExpression';
|
package/lib/hooks/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export { default as useHidden } from './useHidden';
|
|
2
|
+
export { default as useReadOnly } from './useReadOnly';
|
|
2
3
|
export { default as useBuildForm } from './useBuildForm';
|
|
3
4
|
export { default as useRendererQueryClient } from './useRendererQueryClient';
|
|
5
|
+
export { default as useRenderingExtensions } from './useRenderingExtensions';
|
|
6
|
+
export { default as useValidationFeedback } from './useValidationFeedback';
|
|
7
|
+
export { default as useValueSetCodings } from './useValueSetCodings';
|
|
8
|
+
// CalculatedExpression hooks
|
|
9
|
+
export { default as useStringCalculatedExpression } from './useStringCalculatedExpression';
|
|
10
|
+
export { default as useDisplayCqfAndCalculatedExpression } from './useDisplayCqfAndCalculatedExpression';
|
|
11
|
+
export { default as useCodingCalculatedExpression, objectIsCoding } from './useCodingCalculatedExpression';
|
|
4
12
|
//# sourceMappingURL=index.js.map
|
package/lib/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErE,6BAA6B;AAC7B,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AACzG,OAAO,EACL,OAAO,IAAI,6BAA6B,EACxC,cAAc,EACf,MAAM,iCAAiC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
1
2
|
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
3
|
+
import type { RendererStyling } from '../stores/rendererStylingStore';
|
|
4
|
+
import type { QItemOverrideComponentProps, SdcUiOverrideComponentProps } from '../interfaces';
|
|
2
5
|
/**
|
|
3
6
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
4
7
|
* @see buildForm() for more information.
|
|
@@ -8,8 +11,12 @@ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
|
8
11
|
* @param readOnly - Applies read-only mode to all items in the form view
|
|
9
12
|
* @param terminologyServerUrl - Terminology server url to fetch terminology. If not provided, the default terminology server will be used. (optional)
|
|
10
13
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
14
|
+
* @param rendererStylingOptions - Renderer styling to be applied to the form. See docs for styling options. (optional)
|
|
15
|
+
* @param qItemOverrideComponents - FIXME add comment
|
|
16
|
+
* @param sdcUiOverrideComponents - FIXME add comment
|
|
17
|
+
*
|
|
11
18
|
*
|
|
12
19
|
* @author Sean Fong
|
|
13
20
|
*/
|
|
14
|
-
declare function useBuildForm(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, readOnly?: boolean, terminologyServerUrl?: string, additionalVariables?: Record<string, object
|
|
21
|
+
declare function useBuildForm(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, readOnly?: boolean, terminologyServerUrl?: string, additionalVariables?: Record<string, object>, rendererStylingOptions?: RendererStyling, qItemOverrideComponents?: Record<string, ComponentType<QItemOverrideComponentProps>>, sdcUiOverrideComponents?: Record<string, ComponentType<SdcUiOverrideComponentProps>>): boolean;
|
|
15
22
|
export default useBuildForm;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { useLayoutEffect, useState } from 'react';
|
|
18
18
|
import { buildForm } from '../utils';
|
|
19
|
+
import { useRendererStylingStore } from '../stores/rendererStylingStore';
|
|
19
20
|
/**
|
|
20
21
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
21
22
|
* @see buildForm() for more information.
|
|
@@ -25,16 +26,35 @@ import { buildForm } from '../utils';
|
|
|
25
26
|
* @param readOnly - Applies read-only mode to all items in the form view
|
|
26
27
|
* @param terminologyServerUrl - Terminology server url to fetch terminology. If not provided, the default terminology server will be used. (optional)
|
|
27
28
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
29
|
+
* @param rendererStylingOptions - Renderer styling to be applied to the form. See docs for styling options. (optional)
|
|
30
|
+
* @param qItemOverrideComponents - FIXME add comment
|
|
31
|
+
* @param sdcUiOverrideComponents - FIXME add comment
|
|
32
|
+
*
|
|
28
33
|
*
|
|
29
34
|
* @author Sean Fong
|
|
30
35
|
*/
|
|
31
|
-
function useBuildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables) {
|
|
36
|
+
function useBuildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, rendererStylingOptions, qItemOverrideComponents, sdcUiOverrideComponents) {
|
|
32
37
|
const [isBuilding, setIsBuilding] = useState(true);
|
|
38
|
+
const setRendererStyling = useRendererStylingStore.use.setRendererStyling();
|
|
33
39
|
useLayoutEffect(() => {
|
|
34
|
-
|
|
40
|
+
// Set optional renderer styling
|
|
41
|
+
if (rendererStylingOptions) {
|
|
42
|
+
setRendererStyling(rendererStylingOptions);
|
|
43
|
+
}
|
|
44
|
+
buildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, qItemOverrideComponents, sdcUiOverrideComponents).then(() => {
|
|
35
45
|
setIsBuilding(false);
|
|
36
46
|
});
|
|
37
|
-
}, [
|
|
47
|
+
}, [
|
|
48
|
+
questionnaire,
|
|
49
|
+
questionnaireResponse,
|
|
50
|
+
readOnly,
|
|
51
|
+
terminologyServerUrl,
|
|
52
|
+
additionalVariables,
|
|
53
|
+
rendererStylingOptions,
|
|
54
|
+
qItemOverrideComponents,
|
|
55
|
+
sdcUiOverrideComponents,
|
|
56
|
+
setRendererStyling
|
|
57
|
+
]);
|
|
38
58
|
return isBuilding;
|
|
39
59
|
}
|
|
40
60
|
export default useBuildForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuildForm.js","sourceRoot":"","sources":["../../src/hooks/useBuildForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"useBuildForm.js","sourceRoot":"","sources":["../../src/hooks/useBuildForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAGzE;;;;;;;;;;;;;;;GAeG;AACH,SAAS,YAAY,CACnB,aAA4B,EAC5B,qBAA6C,EAC7C,QAAkB,EAClB,oBAA6B,EAC7B,mBAA4C,EAC5C,sBAAwC,EACxC,uBAAoF,EACpF,uBAAoF;IAEpF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IAE5E,eAAe,CAAC,GAAG,EAAE;QACnB,gCAAgC;QAChC,IAAI,sBAAsB,EAAE;YAC1B,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;SAC5C;QAED,SAAS,CACP,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,CACxB,CAAC,IAAI,CAAC,GAAG,EAAE;YACV,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE;QACD,aAAa;QACb,qBAAqB;QACrB,QAAQ;QACR,oBAAoB;QACpB,mBAAmB;QACnB,sBAAsB;QACtB,uBAAuB;QACvB,uBAAuB;QACvB,kBAAkB;KACnB,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QuestionnaireItem } from 'fhir/r4';
|
|
1
|
+
import type { Coding, QuestionnaireItem } from 'fhir/r4';
|
|
2
2
|
interface UseCodingCalculatedExpression {
|
|
3
3
|
calcExpUpdated: boolean;
|
|
4
4
|
}
|
|
@@ -9,4 +9,5 @@ interface UseCodingCalculatedExpressionProps {
|
|
|
9
9
|
onChangeByCalcExpressionNull: () => void;
|
|
10
10
|
}
|
|
11
11
|
declare function useCodingCalculatedExpression(props: UseCodingCalculatedExpressionProps): UseCodingCalculatedExpression;
|
|
12
|
+
export declare function objectIsCoding(obj: any): obj is Coding;
|
|
12
13
|
export default useCodingCalculatedExpression;
|
|
@@ -63,7 +63,7 @@ function useCodingCalculatedExpression(props) {
|
|
|
63
63
|
[calculatedExpressions]);
|
|
64
64
|
return { calcExpUpdated: calcExpUpdated };
|
|
65
65
|
}
|
|
66
|
-
function objectIsCoding(obj) {
|
|
66
|
+
export function objectIsCoding(obj) {
|
|
67
67
|
return obj && obj.code && typeof obj.code === 'string';
|
|
68
68
|
}
|
|
69
69
|
export default useCodingCalculatedExpression;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCodingCalculatedExpression.js","sourceRoot":"","sources":["../../src/hooks/useCodingCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAalD,gEAAgE;AAChE,SAAS,6BAA6B,CACpC,KAAyC;IA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C,SAAS,CAAC,CAAC;SACtC;IACH,CAAC;IACD,mEAAmE;IACnE,uDAAuD;IACvD,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AACzD,CAAC;AAED,eAAe,6BAA6B,CAAC"}
|
package/lib/hooks/useHidden.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import { useQuestionnaireStore } from '../stores';
|
|
18
18
|
import { isHiddenByEnableWhen } from '../utils/qItem';
|
|
19
19
|
import { structuredDataCapture } from 'fhir-sdc-helpers';
|
|
20
|
+
import { useRendererStylingStore } from '../stores/rendererStylingStore';
|
|
20
21
|
/**
|
|
21
22
|
* React hook to determine if a QuestionnaireItem is hidden via item.hidden, enableWhens, enableWhenExpressions.
|
|
22
23
|
* When checking for repeating group enableWhen items, the parentRepeatGroupIndex should be provided.
|
|
@@ -27,9 +28,16 @@ function useHidden(qItem, parentRepeatGroupIndex) {
|
|
|
27
28
|
const enableWhenIsActivated = useQuestionnaireStore.use.enableWhenIsActivated();
|
|
28
29
|
const enableWhenItems = useQuestionnaireStore.use.enableWhenItems();
|
|
29
30
|
const enableWhenExpressions = useQuestionnaireStore.use.enableWhenExpressions();
|
|
31
|
+
const enableWhenAsReadOnly = useRendererStylingStore.use.enableWhenAsReadOnly();
|
|
30
32
|
if (structuredDataCapture.getHidden(qItem)) {
|
|
31
33
|
return true;
|
|
32
34
|
}
|
|
35
|
+
// If enableWhenAsReadOnly is true, then items hidden by enableWhen should be displayed, but set as readOnly
|
|
36
|
+
// If enableWhenAsReadOnly is a Set, all item types in the set should be displayed, but set as readOnly
|
|
37
|
+
if (enableWhenAsReadOnly === true ||
|
|
38
|
+
(enableWhenAsReadOnly instanceof Set && enableWhenAsReadOnly.has(qItem.type))) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
33
41
|
return isHiddenByEnableWhen({
|
|
34
42
|
linkId: qItem.linkId,
|
|
35
43
|
enableWhenIsActivated,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHidden.js","sourceRoot":"","sources":["../../src/hooks/useHidden.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useHidden.js","sourceRoot":"","sources":["../../src/hooks/useHidden.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;GAKG;AACH,SAAS,SAAS,CAAC,KAAwB,EAAE,sBAA+B;IAC1E,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAChF,MAAM,eAAe,GAAG,qBAAqB,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC;IACpE,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAEhF,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;IAEhF,IAAI,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QAC1C,OAAO,IAAI,CAAC;KACb;IAED,4GAA4G;IAC5G,uGAAuG;IACvG,IACE,oBAAoB,KAAK,IAAI;QAC7B,CAAC,oBAAoB,YAAY,GAAG,IAAI,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAC7E;QACA,OAAO,KAAK,CAAC;KACd;IAED,OAAO,oBAAoB,CAAC;QAC1B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,qBAAqB;QACrB,eAAe;QACf,qBAAqB;QACrB,sBAAsB;KACvB,CAAC,CAAC;AACL,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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, { useMemo } from 'react';
|
|
18
|
+
import { getXHtmlString } from '../utils/itemControl';
|
|
19
|
+
import { attributesToProps, default as htmlParse, domToReact } from 'html-react-parser';
|
|
20
|
+
export function useParseXhtml(qItem) {
|
|
21
|
+
return useMemo(() => {
|
|
22
|
+
const xHtmlString = getXHtmlString(qItem);
|
|
23
|
+
if (xHtmlString === null || xHtmlString === '') {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const htmlParseOptions = {
|
|
27
|
+
// Limited to work with document.getElementById manipulation only
|
|
28
|
+
replace: (domNode) => {
|
|
29
|
+
if (domNode.attribs) {
|
|
30
|
+
if (domNode.name === 'button') {
|
|
31
|
+
// Extract the onclick attribute
|
|
32
|
+
const { onclick } = domNode.attribs;
|
|
33
|
+
let clickHandler;
|
|
34
|
+
if (onclick) {
|
|
35
|
+
clickHandler = () => {
|
|
36
|
+
try {
|
|
37
|
+
// Check if it starts with 'document.getElementById' and safely execute it
|
|
38
|
+
if (onclick.trim().startsWith('document.getElementById')) {
|
|
39
|
+
const fn = new Function(onclick);
|
|
40
|
+
fn();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
console.warn('Unhandled onclick:', onclick);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error('Error executing onclick:', error);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
delete domNode.attribs.onclick;
|
|
52
|
+
return (React.createElement("button", Object.assign({}, attributesToProps(domNode.attribs), { onClick: clickHandler || (() => console.log('No specific handler defined')) }), domToReact(domNode.children, htmlParseOptions)));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return htmlParse(xHtmlString, htmlParseOptions);
|
|
58
|
+
}, [qItem]);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=useParseXhtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParseXhtml.js","sourceRoot":"","sources":["../../src/hooks/useParseXhtml.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAE,OAAO,IAAI,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxF,MAAM,UAAU,aAAa,CAAC,KAAwB;IACpD,OAAO,OAAO,CAAC,GAAG,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AW,EAAE,gBAA0C,CAAC,CAAC;IAC5E,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { QuestionnaireItem } from 'fhir/r4';
|
|
2
|
-
declare function useReadOnly(qItem: QuestionnaireItem, parentIsReadOnly: boolean | undefined): boolean;
|
|
2
|
+
declare function useReadOnly(qItem: QuestionnaireItem, parentIsReadOnly: boolean | undefined, parentRepeatGroupIndex?: number): boolean;
|
|
3
3
|
export default useReadOnly;
|