@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
|
@@ -26,6 +26,7 @@ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
|
26
26
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
27
27
|
import { useQuestionnaireStore } from '../../../stores';
|
|
28
28
|
import { generateExistingRepeatId, generateNewRepeatId } from '../../../utils/repeatId';
|
|
29
|
+
import { ItemLabelWrapper } from '../ItemParts';
|
|
29
30
|
/**
|
|
30
31
|
* Main component to render a repeating, non-group Questionnaire item.
|
|
31
32
|
*
|
|
@@ -62,8 +63,7 @@ function RepeatItem(props) {
|
|
|
62
63
|
})));
|
|
63
64
|
}
|
|
64
65
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-repeat-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
65
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
66
|
-
React.createElement(TransitionGroup, null, repeatAnswers.map((answer, index) => {
|
|
66
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(TransitionGroup, null, repeatAnswers.map((answer, index) => {
|
|
67
67
|
var _a;
|
|
68
68
|
const repeatAnswerQrItem = createEmptyQrItem(qItem, answer === null || answer === void 0 ? void 0 : answer.id);
|
|
69
69
|
if (answer) {
|
|
@@ -71,7 +71,7 @@ function RepeatItem(props) {
|
|
|
71
71
|
}
|
|
72
72
|
return (React.createElement(Collapse, { key: (_a = answer === null || answer === void 0 ? void 0 : answer.id) !== null && _a !== void 0 ? _a : generateExistingRepeatId(qItem.linkId, index), timeout: 200 },
|
|
73
73
|
React.createElement(RepeatField, { qItem: qItem, qrItem: repeatAnswerQrItem, answer: answer, numOfRepeatAnswers: repeatAnswers.length, groupCardElevation: groupCardElevation, parentIsReadOnly: parentIsReadOnly, showMinimalView: showMinimalView, onDeleteAnswer: () => handleDeleteItem(index), onQrItemChange: (newQrItem) => handleAnswerChange(newQrItem, index) })));
|
|
74
|
-
}))),
|
|
74
|
+
})) }),
|
|
75
75
|
React.createElement(AddItemButton, { repeatAnswers: repeatAnswers, readOnly: readOnly, onAddItem: handleAddItem })));
|
|
76
76
|
}
|
|
77
77
|
export default RepeatItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/RepeatItem/RepeatItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,0BAA0B,MAAM,2CAA2C,CAAC;AACnF,OAAO,aAAa,MAAM,4BAA4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AQ,EAAE,QAAQ,GAAI,EACrE,aAAa,EACX,oBAAC,eAAe,QACb,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;;gBACnC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,CAAC,CAAC;gBAChE,IAAI,MAAM,EAAE;oBACV,kBAAkB,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;iBACtC;gBAED,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,mCAAI,wBAAwB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAChE,OAAO,EAAE,GAAG;oBACZ,oBAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,aAAa,CAAC,MAAM,EACxC,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAC7C,cAAc,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,GACnE,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACc,GAEpB;QAEF,oBAAC,aAAa,IAAC,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,GAAI,CACnE,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -19,7 +19,7 @@ export declare const NestedSingleItemAccordion: import("@emotion/styled").Styled
|
|
|
19
19
|
TransitionProps?: import("@mui/material/transitions").TransitionProps | undefined;
|
|
20
20
|
} & import("@mui/material").AccordionSlotsAndSlotProps & Omit<import("@mui/material").PaperOwnProps, "onChange" | "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
21
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
22
|
-
}, "disabled" | "children" | "onChange" | "sx" |
|
|
22
|
+
}, "disabled" | "children" | "onChange" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "elevation" | "variant" | "square" | "expanded" | "disableGutters" | "defaultExpanded" | "TransitionComponent" | "TransitionProps" | keyof import("@mui/material").AccordionSlotsAndSlotProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
23
23
|
elevation: number;
|
|
24
24
|
}, {}, {}>;
|
|
25
25
|
export declare const NestedSingleItemAccordionSummary: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionSummaryOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -50,7 +50,7 @@ function SingleItem(props) {
|
|
|
50
50
|
onQrItemChange(updatedQrItem);
|
|
51
51
|
}, [qrItem, onQrItemChange]);
|
|
52
52
|
const itemHasNestedItems = useMemo(() => !!qItem.item && qItem.item.length > 0 && shouldRenderNestedItems(qItem), [qItem]);
|
|
53
|
-
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
53
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly, parentRepeatGroupIndex);
|
|
54
54
|
const itemIsHidden = useHidden(qItem, parentRepeatGroupIndex);
|
|
55
55
|
return (React.createElement(SingleItemView, { qItem: qItem, qrItem: qrItem, itemIsHidden: itemIsHidden, itemHasNestedItems: itemHasNestedItems, isRepeated: isRepeated, isTabled: isTabled, groupCardElevation: groupCardElevation, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: handleQrItemChange, onQrItemChangeWithNestedItems: handleQrItemChangeWithNestedItems }));
|
|
56
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAUpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAc9C;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAAsB;IACxC,MAAM,EACJ,KAAK,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;IAE9E,MAAM,kBAAkB,GAAG,WAAW,CACpC,CAAC,SAAoC,EAAE,EAAE;QACvC,oBAAoB,CAClB,KAAK,CAAC,MAAM,EACZ,SAAS,CAAC,MAAM,EAChB,mBAAmB,CAAC,CAAC,CAAC,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAC5D,CAAC;QAEF,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACnD,cAAc,iCAAM,SAAS,KAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAG,CAAC;SACrD;aAAM;YACL,cAAc,CAAC,SAAS,CAAC,CAAC;SAC3B;IACH,CAAC,EACD;QACE,MAAM;QACN,oBAAoB;QACpB,KAAK,CAAC,MAAM;QACZ,mBAAmB;QACnB,sBAAsB;QACtB,cAAc;KACf,CACF,CAAC;IAEF,MAAM,iCAAiC,GAAG,WAAW,CACnD,CAAC,SAAoC,EAAE,EAAE;QACvC,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,iCAAM,MAAM,KAAE,IAAI,EAAE,SAAS,CAAC,IAAI,IAAG,CAAC,CAAC,SAAS,CAAC;QAC/E,cAAc,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC,EACD,CAAC,MAAM,EAAE,cAAc,CAAC,CACzB,CAAC;IAEF,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAC7E,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"SingleItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAUpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAc9C;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAAsB;IACxC,MA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C,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAC7E,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,CAAC,CAAC;IAC9E,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;IAE9D,OAAO,CACL,oBAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,kBAAkB,EAClC,6BAA6B,EAAE,iCAAiC,GAChE,CACH,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface SingleItemSwitcherProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
3
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface SingleItemSwitcherProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
@@ -32,44 +32,52 @@ import IntegerItem from '../IntegerItem/IntegerItem';
|
|
|
32
32
|
import AttachmentItem from '../AttachmentItem/AttachmentItem';
|
|
33
33
|
import CustomDateTimeItem from '../DateTimeItems/CustomDateTimeItem/CustomDateTimeItem';
|
|
34
34
|
import QuantityItem from '../QuantityItem/QuantityItem';
|
|
35
|
+
import { useQuestionnaireStore } from '../../../stores';
|
|
35
36
|
function SingleItemSwitcher(props) {
|
|
36
|
-
const { qItem, qrItem, isRepeated, isTabled, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
|
|
37
|
+
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
|
|
38
|
+
const qItemOverrideComponents = useQuestionnaireStore.use.qItemOverrideComponents();
|
|
39
|
+
const QItemOverrideComponent = qItemOverrideComponents[qItem.linkId];
|
|
40
|
+
// If a qItem override component is defined for this item, render it
|
|
41
|
+
// Don't get too strict with the "typeof" checks for now
|
|
42
|
+
if (QItemOverrideComponent && typeof QItemOverrideComponent === 'function') {
|
|
43
|
+
return (React.createElement(QItemOverrideComponent, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, onQrRepeatGroupChange: () => { } }));
|
|
44
|
+
}
|
|
45
|
+
// Otherwise, render the default form component based on the item type
|
|
37
46
|
switch (qItem.type) {
|
|
38
47
|
case 'display':
|
|
39
|
-
return React.createElement(DisplayItem, { qItem: qItem });
|
|
48
|
+
return React.createElement(DisplayItem, { qItem: qItem, parentIsReadOnly: parentIsReadOnly });
|
|
40
49
|
case 'boolean':
|
|
41
|
-
return (React.createElement(BooleanItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
50
|
+
return (React.createElement(BooleanItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
42
51
|
case 'decimal':
|
|
43
|
-
return (React.createElement(DecimalItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
52
|
+
return (React.createElement(DecimalItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
44
53
|
case 'integer':
|
|
45
54
|
if (isSpecificItemControl(qItem, 'slider')) {
|
|
46
|
-
return (React.createElement(SliderItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
55
|
+
return (React.createElement(SliderItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
47
56
|
}
|
|
48
|
-
return (React.createElement(IntegerItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
57
|
+
return (React.createElement(IntegerItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
49
58
|
case 'date':
|
|
50
|
-
return (React.createElement(CustomDateItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
59
|
+
return (React.createElement(CustomDateItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
51
60
|
case 'dateTime':
|
|
52
|
-
return (React.createElement(CustomDateTimeItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
61
|
+
return (React.createElement(CustomDateTimeItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
53
62
|
case 'time':
|
|
54
|
-
return (React.createElement(TimeItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
63
|
+
return (React.createElement(TimeItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
55
64
|
case 'string':
|
|
56
|
-
return (React.createElement(StringItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
65
|
+
return (React.createElement(StringItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
57
66
|
case 'text':
|
|
58
|
-
return (React.createElement(TextItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
67
|
+
return (React.createElement(TextItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
59
68
|
case 'url':
|
|
60
|
-
return (React.createElement(UrlItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
69
|
+
return (React.createElement(UrlItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
61
70
|
case 'choice':
|
|
62
|
-
return (React.createElement(ChoiceItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
71
|
+
return (React.createElement(ChoiceItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
63
72
|
case 'open-choice':
|
|
64
|
-
return (React.createElement(OpenChoiceItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
73
|
+
return (React.createElement(OpenChoiceItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
65
74
|
case 'attachment':
|
|
66
|
-
return (React.createElement(AttachmentItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
75
|
+
return (React.createElement(AttachmentItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
67
76
|
case 'reference':
|
|
68
77
|
// FIXME reference item uses the same component as string item currently
|
|
69
|
-
return (React.createElement(StringItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
78
|
+
return (React.createElement(StringItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
70
79
|
case 'quantity':
|
|
71
|
-
|
|
72
|
-
return (React.createElement(QuantityItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
80
|
+
return (React.createElement(QuantityItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
73
81
|
default:
|
|
74
82
|
return (React.createElement(Typography, null,
|
|
75
83
|
"Item type ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAEnE,OAAO,sBAAsB,MAAM,2CAA2C,CAAC;AAC/E,OAAO,UAAU,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"SingleItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleIt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QACJ,KAAK,WAAW;YACd,wEAAwE;YACxE,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ,KAAK,UAAU;YACb,OAAO,CACL,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ;YACE,OAAO,CACL,oBAAC,UAAU;;gBACC,+BAAI,KAAK,CAAC,IAAI,CAAK;yJAElB,CACd,CAAC;KACL;AACH,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -26,9 +26,11 @@ import StopPropagationWrapper from './StopPropagationWrapper';
|
|
|
26
26
|
import { NestedSingleItemAccordion, NestedSingleItemAccordionSummary, NestedSingleItemAccordionWrapper } from './NestedSingleItemAccordion.styles';
|
|
27
27
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
28
28
|
import Box from '@mui/material/Box';
|
|
29
|
+
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
29
30
|
function SingleItemView(props) {
|
|
30
31
|
const { qItem, qrItem, itemIsHidden, itemHasNestedItems, isRepeated, isTabled, groupCardElevation, showMinimalView, parentIsReadOnly, onQrItemChange, onQrItemChangeWithNestedItems } = props;
|
|
31
32
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
33
|
+
const renderingExtensions = useRenderingExtensions(qItem);
|
|
32
34
|
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
33
35
|
// Item hidden, do not render
|
|
34
36
|
if (itemIsHidden) {
|
|
@@ -44,7 +46,7 @@ function SingleItemView(props) {
|
|
|
44
46
|
React.createElement(NestedSingleItemAccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null) },
|
|
45
47
|
React.createElement(Box, { width: "100%" },
|
|
46
48
|
React.createElement(StopPropagationWrapper, null,
|
|
47
|
-
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange })))),
|
|
49
|
+
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange })))),
|
|
48
50
|
React.createElement(AccordionDetails, { sx: { pt: 0 } },
|
|
49
51
|
React.createElement(Box, { mr: 3 },
|
|
50
52
|
React.createElement(SingleNestedItems, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChangeWithNestedItems }))))));
|
|
@@ -53,11 +55,10 @@ function SingleItemView(props) {
|
|
|
53
55
|
if (itemHasNestedItems) {
|
|
54
56
|
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: isRepeated, "data-test": "q-item-group-box" },
|
|
55
57
|
React.createElement(GroupCard, { elevation: groupCardElevation, isRepeated: isRepeated },
|
|
56
|
-
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }),
|
|
58
|
+
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }),
|
|
57
59
|
React.createElement(SingleNestedItems, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChangeWithNestedItems }))));
|
|
58
60
|
}
|
|
59
|
-
return (React.createElement(
|
|
60
|
-
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange })));
|
|
61
|
+
return (React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, renderingExtensions: renderingExtensions, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
61
62
|
}
|
|
62
63
|
export default SingleItemView;
|
|
63
64
|
//# sourceMappingURL=SingleItemView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItemView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItemView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,GAAG,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"SingleItemView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItemView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAgB3E,SAAS,cAAc,CAAC,KAA0B;IAChD,MAAM,EACJ,KAAK,EACL,MAAM,EACN,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,6BAA6B,EAC9B,GAAG,KAAK,CAAC;IAEV,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAEzD,6BAA6B;IAC7B,IAAI,YAAY,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,2CAA2C;IAC3C,IAAI,kBAAkB,IAAI,qBAAqB,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AAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B;gBACF,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,6BAA6B,GAC7C,CACQ,CACO,CACtB,CAAC;KACH;IAED,OAAO,CACL,oBAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -40,6 +40,7 @@ function SingleNestedItems(props) {
|
|
|
40
40
|
return React.createElement(React.Fragment, null, "Unable to load group, something has gone terribly wrong.");
|
|
41
41
|
}
|
|
42
42
|
const qrItemsByIndex = getQrItemsIndex(qItems, qrItems, qItemsIndexMap);
|
|
43
|
+
// TODO - Add support for horizontal "row" layout
|
|
43
44
|
return (React.createElement(Box, { display: "flex" },
|
|
44
45
|
React.createElement(Box, { ml: 1.5 }),
|
|
45
46
|
React.createElement(Box, { flexGrow: 1 }, qItems.map((qItem, i) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleNestedItems.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleNestedItems.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,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C,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IAExE,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM;QACjB,oBAAC,GAAG,IAAC,EAAE,EAAE,GAAG,GAAI;QAChB,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,IACb,MAAM,CAAC,GAAG,CAAC,CAAC,KAAwB,EAAE,CAAC,EAAE,EAAE;YAC1C,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YAExC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;gBAC5B,OAAO,IAAI,CAAC;aACb;YAED,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,gBAAgB,EAClC,cAAc,EAAE,kBAAkB,EAClC,qBAAqB,EAAE,yBAAyB,GAChD,CACH,CAAC;QACJ,CAAC,CAAC,CACE;QACN,oBAAC,GAAG,IAAC,EAAE,EAAE,IAAI,GAAQ,CACjB,CACP,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"SingleNestedItems.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleNestedItems.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAMjF,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAUpC,SAAS,iBAAiB,CAAC,KAA6B;IACtD,MAAM,EAAE,K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YAC1C,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YAExC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;gBAC5B,OAAO,IAAI,CAAC;aACb;YAED,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,gBAAgB,EAClC,cAAc,EAAE,kBAAkB,EAClC,qBAAqB,EAAE,yBAAyB,GAChD,CACH,CAAC;QACJ,CAAC,CAAC,CACE;QACN,oBAAC,GAAG,IAAC,EAAE,EAAE,IAAI,GAAQ,CACjB,CACP,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -20,12 +20,13 @@ import { getSliderMarks } from '../../../utils/slider';
|
|
|
20
20
|
import Stack from '@mui/material/Stack';
|
|
21
21
|
import SliderLabels from './SliderLabels';
|
|
22
22
|
import SliderDisplayValue from './SliderDisplayValue';
|
|
23
|
-
import {
|
|
23
|
+
import { useRendererStylingStore } from '../../../stores';
|
|
24
24
|
function SliderField(props) {
|
|
25
25
|
const { linkId, value, minValue, maxValue, stepValue, minLabel, maxLabel, isInteracted, readOnly, isTabled, onValueChange } = props;
|
|
26
|
+
const textFieldWidth = useRendererStylingStore.use.textFieldWidth();
|
|
26
27
|
const sliderMarks = getSliderMarks(minValue, maxValue, minLabel, maxLabel, stepValue);
|
|
27
28
|
const sliderSx = {
|
|
28
|
-
maxWidth: !isTabled ?
|
|
29
|
+
maxWidth: !isTabled ? textFieldWidth : 3000,
|
|
29
30
|
minWidth: 160
|
|
30
31
|
};
|
|
31
32
|
const hasLabels = !!(minLabel || maxLabel);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SliderItem/SliderField.tsx"],"names":[],"mappings":"AAAA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;IAEF,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC;IAE3C,OAAO,CACL,oBAAC,KAAK,IAAC,EAAE,oBAAO,QAAQ;QACtB,oBAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,GAAI;QACrF,SAAS,CAAC,CAAC,CAAC,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC,CAAC,CAAC,IAAI;QAC5E,oBAAC,MAAM,IACL,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,WAAW,EAClB,EAAE,oBAAO,QAAQ,GACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE;gBACxB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;oBAChC,aAAa,CAAC,QAAQ,CAAC,CAAC;iBACzB;YACH,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAC,MAAM,eACd,qBAAqB,GAC/B,CACI,CACT,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,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 SliderItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
4
|
+
interface SliderItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem | null;
|
|
7
7
|
}
|
|
@@ -23,6 +23,7 @@ import SliderField from './SliderField';
|
|
|
23
23
|
import useSliderExtensions from '../../../hooks/useSliderExtensions';
|
|
24
24
|
import Box from '@mui/material/Box';
|
|
25
25
|
import { useQuestionnaireStore } from '../../../stores';
|
|
26
|
+
import { ItemLabelWrapper } from '../ItemParts';
|
|
26
27
|
function SliderItem(props) {
|
|
27
28
|
var _a;
|
|
28
29
|
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
@@ -50,9 +51,8 @@ function SliderItem(props) {
|
|
|
50
51
|
React.createElement(SliderField, { linkId: qItem.linkId, value: valueInteger, minValue: minValue, maxValue: maxValue, stepValue: stepValue, minLabel: minLabel, maxLabel: maxLabel, isInteracted: isInteracted, readOnly: readOnly, isTabled: isTabled, onValueChange: handleValueChange })));
|
|
51
52
|
}
|
|
52
53
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-slider-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
53
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
54
|
-
|
|
55
|
-
React.createElement(SliderField, { linkId: qItem.linkId, value: valueInteger, minValue: minValue, maxValue: maxValue, stepValue: stepValue, minLabel: minLabel, maxLabel: maxLabel, isInteracted: isInteracted, readOnly: readOnly, isTabled: isTabled, onValueChange: handleValueChange })))));
|
|
54
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(Box, { px: 4 },
|
|
55
|
+
React.createElement(SliderField, { linkId: qItem.linkId, value: valueInteger, minValue: minValue, maxValue: maxValue, stepValue: stepValue, minLabel: minLabel, maxLabel: maxLabel, isInteracted: isInteracted, readOnly: readOnly, isTabled: isTabled, onValueChange: handleValueChange })) })));
|
|
56
56
|
}
|
|
57
57
|
export default SliderItem;
|
|
58
58
|
//# sourceMappingURL=SliderItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SliderItem/SliderItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SliderItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SliderItem/SliderItem.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,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAYhD,SAAS,UAAU,CAAC,KAAsB;;IACxC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAExF,MAAM,aAAa,GAAG,qB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AAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,iBAAiB,GAChC,CACE,CACP,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd,mBAAmB,iBAChB,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,GAAG,IAAC,EAAE,EAAE,CAAC;gBACR,oBAAC,WAAW,IACV,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,iBAAiB,GAChC,CACE,GAER,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,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 StringField(props) {
|
|
22
24
|
const { linkId, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, isTabled, calcExpUpdated, onInputChange } = props;
|
|
23
|
-
|
|
25
|
+
const textFieldWidth = useRendererStylingStore.use.textFieldWidth();
|
|
26
|
+
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: {
|
|
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
|
}, helperText: feedback, "data-test": "q-item-string-field" }));
|
|
28
31
|
}
|
|
29
32
|
export default StringField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/StringField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,eAAe,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"StringField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/StringField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACx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Attribute, 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 StringItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
4
|
+
interface StringItemProps 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';
|
|
@@ -26,12 +25,13 @@ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
|
26
25
|
import useStringCalculatedExpression from '../../../hooks/useStringCalculatedExpression';
|
|
27
26
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
28
27
|
import { useQuestionnaireStore } from '../../../stores';
|
|
28
|
+
import { ItemLabelWrapper } from '../ItemParts';
|
|
29
29
|
function StringItem(props) {
|
|
30
30
|
var _a;
|
|
31
|
-
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
31
|
+
const { qItem, qrItem, isRepeated, isTabled, renderingExtensions, parentIsReadOnly, onQrItemChange } = props;
|
|
32
32
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
33
33
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
34
|
-
const { displayUnit, displayPrompt, entryFormat } =
|
|
34
|
+
const { displayUnit, displayPrompt, entryFormat } = renderingExtensions;
|
|
35
35
|
// Init input value
|
|
36
36
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
37
37
|
let valueString = '';
|
|
@@ -73,8 +73,7 @@ function StringItem(props) {
|
|
|
73
73
|
return (React.createElement(StringField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleChange, isTabled: isTabled }));
|
|
74
74
|
}
|
|
75
75
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-string-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
76
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
77
|
-
React.createElement(StringField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleChange, isTabled: isTabled }))));
|
|
76
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(StringField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleChange, isTabled: isTabled }) })));
|
|
78
77
|
}
|
|
79
78
|
export default StringItem;
|
|
80
79
|
//# sourceMappingURL=StringItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/StringItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StringItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/StringItem.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,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,6BAA6B,MAAM,8CAA8C,CAAC;AACzF,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWhD,SAAS,UAAU,CAAC,KAAsB;;IACxC,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,E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,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,YAAY,EAC3B,QAAQ,EAAE,QAAQ,GAClB,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -18,12 +18,13 @@ import React from 'react';
|
|
|
18
18
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
19
19
|
import MuiTextField from './MuiTextField';
|
|
20
20
|
import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
|
|
21
|
+
import Typography from '@mui/material/Typography';
|
|
21
22
|
function TextField(props) {
|
|
22
23
|
const { linkId, input, feedback, displayPrompt, displayUnit, entryFormat, readOnly, calcExpUpdated, onInputChange } = props;
|
|
23
24
|
return (React.createElement(MuiTextField, { id: linkId, value: input, error: !!feedback, onChange: (event) => onInputChange(event.target.value), disabled: readOnly, label: displayPrompt, placeholder: entryFormat, fullWidth: true, multiline: true, size: "small", minRows: 3, InputProps: {
|
|
24
|
-
endAdornment: (React.createElement(InputAdornment, { position:
|
|
25
|
+
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
25
26
|
React.createElement(FadingCheckIcon, { fadeIn: calcExpUpdated, disabled: readOnly }),
|
|
26
|
-
displayUnit))
|
|
27
|
+
React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.secondary' }, displayUnit)))
|
|
27
28
|
}, helperText: feedback, "data-test": "q-item-text-field" }));
|
|
28
29
|
}
|
|
29
30
|
export default TextField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,eAAe,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAclD,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EACJ,MAAM,EACN,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACd,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,oBAAC,YAAY,IACX,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACtD,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,QACT,SAAS,QACT,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,CAAC,EACV,UAAU,EAAE;YACV,YAAY,EAAE,CACZ,oBAAC,cAAc,IAAC,QAAQ,EAAC,KAAK;gBAC5B,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,EACD,UAAU,EAAE,QAAQ,eACV,mBAAmB,GAC7B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithRenderingExtensionsAttribute } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface TextItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
4
|
+
interface TextItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, 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';
|
|
@@ -26,12 +25,13 @@ import useStringCalculatedExpression from '../../../hooks/useStringCalculatedExp
|
|
|
26
25
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
27
26
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
28
27
|
import { useQuestionnaireStore } from '../../../stores';
|
|
28
|
+
import { ItemLabelWrapper } from '../ItemParts';
|
|
29
29
|
function TextItem(props) {
|
|
30
30
|
var _a;
|
|
31
|
-
const { qItem, qrItem, isRepeated, parentIsReadOnly, onQrItemChange } = props;
|
|
31
|
+
const { qItem, qrItem, isRepeated, renderingExtensions, parentIsReadOnly, onQrItemChange } = props;
|
|
32
32
|
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
33
33
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
34
|
-
const { displayUnit, displayPrompt, entryFormat } =
|
|
34
|
+
const { displayUnit, displayPrompt, entryFormat } = renderingExtensions;
|
|
35
35
|
// Init input value
|
|
36
36
|
const answerKey = (_a = qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) === null || _a === void 0 ? void 0 : _a[0].id;
|
|
37
37
|
let valueText = '';
|
|
@@ -73,8 +73,7 @@ function TextItem(props) {
|
|
|
73
73
|
return (React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }));
|
|
74
74
|
}
|
|
75
75
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-text-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
76
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
77
|
-
React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }))));
|
|
76
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly, labelChildren: React.createElement(ItemLabelWrapper, { qItem: qItem, readOnly: readOnly }), fieldChildren: React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }) })));
|
|
78
77
|
}
|
|
79
78
|
export default TextItem;
|
|
80
79
|
//# sourceMappingURL=TextItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/TextItem/TextItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQrD,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,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,6BAA6B,MAAM,8CAA8C,CAAC;AACzF,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,QAAQ,CAAC,KAAoB;;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,GACxF,KAAK,CAAC;IAER,MAAM,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAEhE,MAAM,QAAQ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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,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,iBAAiB,GAChC,GAEJ,CACwB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const TEXT_FIELD_WIDTH = 320;
|
|
2
1
|
export declare const StandardTextField: import("@emotion/styled").StyledComponent<{
|
|
3
2
|
variant?: import("@mui/material/TextField").TextFieldVariants | undefined;
|
|
4
3
|
} & Omit<import("@mui/material/TextField").FilledTextFieldProps | import("@mui/material/TextField").OutlinedTextFieldProps | import("@mui/material/TextField").StandardTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
4
|
isTabled: boolean;
|
|
5
|
+
textFieldWidth: number;
|
|
6
6
|
}, {}, {}>;
|
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import TextField from '@mui/material/TextField';
|
|
19
|
-
export const TEXT_FIELD_WIDTH = 320;
|
|
20
19
|
// Always use this accompanied by the TextField prop fullWidth
|
|
21
20
|
export const StandardTextField = styled(TextField, {
|
|
22
|
-
shouldForwardProp: (prop) => prop !== 'isTabled'
|
|
23
|
-
})(({ isTabled }) => ({
|
|
24
|
-
// Set
|
|
25
|
-
// Set a theoretical infinite maxWidth if field is within a table to fill the table row
|
|
26
|
-
maxWidth: !isTabled ?
|
|
21
|
+
shouldForwardProp: (prop) => prop !== 'isTabled' && prop !== 'textFieldWidth'
|
|
22
|
+
})(({ isTabled, textFieldWidth }) => ({
|
|
23
|
+
// Set textFieldWidth (defaults to 320 in rendererStylingStore) as the standard width for a field
|
|
24
|
+
// Set a theoretical infinite maxWidth (3000) if field is within a table to fill the table row
|
|
25
|
+
maxWidth: !isTabled ? textFieldWidth : 3000,
|
|
27
26
|
minWidth: 160
|
|
28
27
|
}));
|
|
29
28
|
//# sourceMappingURL=Textfield.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textfield.styles.js","sourceRoot":"","sources":["../../../src/components/FormComponents/Textfield.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,
|
|
1
|
+
{"version":3,"file":"Textfield.styles.js","sourceRoot":"","sources":["../../../src/components/FormComponents/Textfield.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,EAAE;IACjD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,gBAAgB;CAC9E,CAAC,CAAgD,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;IACnF,iGAAiG;IACjG,8FAA8F;IAC9F,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI;IAC3C,QAAQ,EAAE,GAAG;CACd,CAAC,CAAC,CAAC"}
|