@aehrc/smart-forms-renderer 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Alert.styles.d.ts +2 -7
- package/lib/components/Box.styles.d.ts +6 -21
- package/lib/components/FormComponents/BooleanItem/BooleanItem.d.ts +2 -2
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js +5 -4
- package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +6 -5
- 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 +7 -6
- 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 +7 -6
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +2 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +8 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +6 -6
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +6 -5
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +2 -2
- 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 +8 -7
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +2 -2
- 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 +8 -7
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/DateItem/DateItem.d.ts +2 -1
- package/lib/components/FormComponents/DateItem/DateItem.js +5 -4
- package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -1
- package/lib/components/FormComponents/DateItem/DatePicker.d.ts +2 -0
- package/lib/components/FormComponents/DateItem/DatePicker.js +42 -0
- package/lib/components/FormComponents/DateItem/DatePicker.js.map +1 -0
- package/lib/components/FormComponents/DateItem/DatePickerField.d.ts +8 -0
- package/{src/components/FormComponents/Typography.styles.ts → lib/components/FormComponents/DateItem/DatePickerField.js} +8 -9
- package/lib/components/FormComponents/DateItem/DatePickerField.js.map +1 -0
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.d.ts +2 -2
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +5 -4
- package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.d.ts +2 -2
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +5 -4
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.d.ts +1 -0
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +2 -2
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js.map +1 -1
- package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.d.ts +2 -7
- package/lib/components/FormComponents/DisplayItem/DisplayItem.js +2 -2
- package/lib/components/FormComponents/DisplayItem/DisplayItem.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridGroup.d.ts +2 -2
- package/lib/components/FormComponents/GridGroup/GridGroup.js +6 -4
- package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridRow.d.ts +2 -1
- package/lib/components/FormComponents/GridGroup/GridRow.js +2 -2
- package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridTable.d.ts +2 -1
- package/lib/components/FormComponents/GridGroup/GridTable.js +2 -2
- package/lib/components/FormComponents/GridGroup/GridTable.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupHeading.d.ts +1 -0
- package/lib/components/FormComponents/GroupItem/GroupHeading.js +6 -5
- package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +2 -3
- package/lib/components/FormComponents/GroupItem/GroupItem.js +5 -3
- package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.styles.d.ts +2 -6
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +10 -10
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerItem.d.ts +2 -2
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js +5 -4
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/Item.styles.d.ts +0 -4
- package/lib/components/FormComponents/Item.styles.js +0 -4
- package/lib/components/FormComponents/Item.styles.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +3 -3
- package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js +4 -6
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +2 -2
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
- package/lib/components/FormComponents/Lists.styles.d.ts +2 -9
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +3 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +2 -3
- 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 +8 -7
- 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 +8 -7
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +6 -6
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +7 -6
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +3 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +2 -2
- 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 +7 -6
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +3 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +2 -2
- 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 +8 -7
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +8 -6
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.d.ts +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +5 -3
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/AddItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatItem/AddItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatItem/AddItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +1 -0
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +2 -2
- package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatField.d.ts +2 -2
- package/lib/components/FormComponents/RepeatItem/RepeatField.js +5 -3
- package/lib/components/FormComponents/RepeatItem/RepeatField.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +2 -2
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js +6 -5
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.d.ts +4 -18
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItem.js +4 -2
- 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 +12 -12
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringItem.d.ts +2 -2
- package/lib/components/FormComponents/StringItem/StringItem.js +5 -4
- package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
- package/lib/components/FormComponents/Tables/AddRowButton.d.ts +1 -0
- package/lib/components/FormComponents/Tables/AddRowButton.js +2 -2
- package/lib/components/FormComponents/Tables/AddRowButton.js.map +1 -1
- package/lib/components/FormComponents/Tables/DeleteRowButton.d.ts +1 -0
- package/lib/components/FormComponents/Tables/DeleteRowButton.js +2 -2
- package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTable.d.ts +2 -2
- package/lib/components/FormComponents/Tables/GroupTable.js +8 -6
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +2 -1
- package/lib/components/FormComponents/Tables/GroupTableRow.js +2 -2
- package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
- package/lib/components/FormComponents/Tables/QItemGroupTable.js +5 -7
- package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +1 -1
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +2 -2
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextItem.d.ts +2 -2
- package/lib/components/FormComponents/TextItem/TextItem.js +5 -4
- package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
- package/lib/components/FormComponents/TimeItem/TimeItem.d.ts +2 -2
- package/lib/components/FormComponents/TimeItem/TimeItem.js +5 -4
- package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
- package/lib/components/FormComponents/UrlItem/UrlItem.d.ts +2 -2
- package/lib/components/FormComponents/UrlItem/UrlItem.js +5 -4
- package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
- package/lib/components/Lists.styles.d.ts +2 -9
- package/lib/components/Renderer/FormTopLevelItem.js +7 -5
- package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
- package/lib/components/Tabs/FormBodySingleTab.js +1 -1
- package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
- package/lib/components/Tabs/ShowCompletedTabsSection.js +1 -1
- package/lib/components/Tabs/ShowCompletedTabsSection.js.map +1 -1
- package/lib/hooks/useMinimalStringCalculatedExpression.d.ts +11 -0
- package/lib/hooks/useMinimalStringCalculatedExpression.js +37 -0
- package/lib/hooks/useMinimalStringCalculatedExpression.js.map +1 -0
- package/lib/hooks/useReadOnly.d.ts +3 -0
- package/lib/hooks/useReadOnly.js +26 -0
- package/lib/hooks/useReadOnly.js.map +1 -0
- package/lib/interfaces/calculatedExpression.interface.d.ts +1 -1
- package/lib/interfaces/renderProps.interface.d.ts +3 -0
- package/lib/theme/overrides/Typography.d.ts +13 -0
- package/lib/theme/overrides/Typography.js +31 -0
- package/lib/theme/overrides/Typography.js.map +1 -0
- package/lib/theme/typography.d.ts +0 -2
- package/lib/theme/typography.js +3 -5
- package/lib/theme/typography.js.map +1 -1
- package/lib/utils/calculatedExpression.d.ts +12 -0
- package/lib/utils/calculatedExpression.js +54 -8
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/package.json +12 -12
- package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +8 -5
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +9 -6
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +18 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +18 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +17 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +9 -8
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +10 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +3 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +14 -9
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +3 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +12 -7
- package/src/components/FormComponents/DateItem/DateItem.tsx +8 -6
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +8 -6
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +7 -5
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +6 -2
- package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +2 -2
- package/src/components/FormComponents/GridGroup/GridGroup.tsx +13 -5
- package/src/components/FormComponents/GridGroup/GridRow.tsx +6 -2
- package/src/components/FormComponents/GridGroup/GridTable.tsx +6 -2
- package/src/components/FormComponents/GroupItem/GroupHeading.tsx +12 -6
- package/src/components/FormComponents/GroupItem/GroupItem.tsx +8 -2
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +27 -4
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +7 -5
- package/src/components/FormComponents/Item.styles.ts +0 -5
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +4 -3
- package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +10 -5
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +3 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +10 -4
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +13 -7
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +20 -9
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +11 -2
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +11 -8
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +10 -4
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +10 -5
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +10 -4
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +12 -7
- package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +17 -9
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +13 -2
- package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatItem/DeleteItemButton.tsx +3 -2
- package/src/components/FormComponents/RepeatItem/RepeatField.tsx +21 -3
- package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +13 -6
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +8 -2
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +16 -2
- package/src/components/FormComponents/StringItem/StringItem.tsx +7 -5
- package/src/components/FormComponents/Tables/AddRowButton.tsx +3 -2
- package/src/components/FormComponents/Tables/DeleteRowButton.tsx +3 -2
- package/src/components/FormComponents/Tables/GroupTable.tsx +17 -6
- package/src/components/FormComponents/Tables/GroupTableRow.tsx +6 -2
- package/src/components/FormComponents/TextItem/TextItem.tsx +7 -5
- package/src/components/FormComponents/TimeItem/TimeItem.tsx +8 -6
- package/src/components/FormComponents/UrlItem/UrlItem.tsx +7 -5
- package/src/components/Renderer/FormTopLevelItem.tsx +9 -4
- package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
- package/src/components/Tabs/ShowCompletedTabsSection.tsx +1 -1
- package/src/hooks/useReadOnly.ts +30 -0
- package/src/interfaces/calculatedExpression.interface.ts +1 -1
- package/src/interfaces/renderProps.interface.ts +4 -0
- package/src/theme/typography.ts +3 -5
- package/src/utils/calculatedExpression.ts +68 -12
|
@@ -36,7 +36,6 @@ import { nanoid } from 'nanoid';
|
|
|
36
36
|
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
37
37
|
import DeleteRowButton from './DeleteRowButton';
|
|
38
38
|
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
39
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
40
39
|
function QItemGroupTable(props) {
|
|
41
40
|
const { qItem, qrItems, groupCardElevation, onQrRepeatGroupChange } = props;
|
|
42
41
|
const initialisedGroupTables = useInitialiseGroupTable(qrItems);
|
|
@@ -62,7 +61,7 @@ function QItemGroupTable(props) {
|
|
|
62
61
|
setTableRows(updatedTableRows);
|
|
63
62
|
onQrRepeatGroupChange({
|
|
64
63
|
linkId: qItem.linkId,
|
|
65
|
-
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [
|
|
64
|
+
qrItems: updatedTableRows.flatMap((singleRow) => (singleRow.qrItem ? [singleRow.qrItem] : []))
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
function handleDeleteRow(index) {
|
|
@@ -71,7 +70,7 @@ function QItemGroupTable(props) {
|
|
|
71
70
|
setTableRows(updatedTableRows);
|
|
72
71
|
onQrRepeatGroupChange({
|
|
73
72
|
linkId: qItem.linkId,
|
|
74
|
-
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [
|
|
73
|
+
qrItems: updatedTableRows.flatMap((singleRow) => (singleRow.qrItem ? [singleRow.qrItem] : []))
|
|
75
74
|
});
|
|
76
75
|
}
|
|
77
76
|
function handleAddRow() {
|
|
@@ -84,10 +83,9 @@ function QItemGroupTable(props) {
|
|
|
84
83
|
]);
|
|
85
84
|
}
|
|
86
85
|
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
|
|
87
|
-
|
|
88
|
-
React.createElement(
|
|
89
|
-
|
|
90
|
-
React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
|
|
86
|
+
React.createElement(Typography, { fontSize: 13, variant: "h6" },
|
|
87
|
+
React.createElement(LabelWrapper, { qItem: qItem })),
|
|
88
|
+
React.createElement(Divider, { sx: { my: 1 }, light: true }),
|
|
91
89
|
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
92
90
|
React.createElement(Table, null,
|
|
93
91
|
React.createElement("caption", null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QItemGroupTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;A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O,CACE,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
|
-
import { createQrGroup,
|
|
18
|
+
import { createQrGroup, updateQrGroup } from '../../../utils/qrItem';
|
|
19
19
|
import SingleItem from '../SingleItem/SingleItem';
|
|
20
20
|
import { getQrItemsIndex } from '../../../utils/mapItem';
|
|
21
21
|
import { StandardTableCell } from './Table.styles';
|
|
@@ -29,7 +29,7 @@ function QItemGroupTableRow(props) {
|
|
|
29
29
|
}
|
|
30
30
|
function handleQrRowItemChange(newQrRowItem) {
|
|
31
31
|
const qrRow = Object.assign({}, row);
|
|
32
|
-
|
|
32
|
+
updateQrGroup(newQrRowItem, null, qrRow, qItemsIndexMap);
|
|
33
33
|
onQrItemChange(qrRow);
|
|
34
34
|
}
|
|
35
35
|
const qrItemsByIndex = getQrItemsIndex(rowItems, rowQrItems, qItemsIndexMap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QItemGroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"QItemGroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/QItemGroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,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qBAAqB,GACrC,CACgB,CACrB,CAAC;IACJ,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface TextItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
|
|
4
|
+
interface TextItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem;
|
|
7
7
|
}
|
|
@@ -25,10 +25,11 @@ import TextField from './TextField';
|
|
|
25
25
|
import useStringCalculatedExpression from '../../../hooks/useStringCalculatedExpression';
|
|
26
26
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
27
27
|
import useStringInput from '../../../hooks/useStringInput';
|
|
28
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
28
29
|
function TextItem(props) {
|
|
29
|
-
const { qItem, qrItem, isRepeated, onQrItemChange } = props;
|
|
30
|
-
|
|
31
|
-
const { displayUnit, displayPrompt, displayInstructions,
|
|
30
|
+
const { qItem, qrItem, isRepeated, parentIsReadOnly, onQrItemChange } = props;
|
|
31
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
32
|
+
const { displayUnit, displayPrompt, displayInstructions, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
|
|
32
33
|
// Init input value
|
|
33
34
|
let valueText = '';
|
|
34
35
|
if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueString)) {
|
|
@@ -65,7 +66,7 @@ function TextItem(props) {
|
|
|
65
66
|
return (React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }));
|
|
66
67
|
}
|
|
67
68
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-text-box" },
|
|
68
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
|
|
69
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
69
70
|
React.createElement(TextField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, onInputChange: handleInputChange }))));
|
|
70
71
|
}
|
|
71
72
|
export default TextItem;
|
|
@@ -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,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,MAAM,OAAO,CAAC;AAO3C,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE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K,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,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface TimeItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
|
|
4
|
+
interface TimeItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem;
|
|
7
7
|
}
|
|
@@ -21,10 +21,11 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
|
21
21
|
import TimeField from './TimeField';
|
|
22
22
|
import dayjs from 'dayjs';
|
|
23
23
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
24
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
24
25
|
function TimeItem(props) {
|
|
25
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
26
|
-
|
|
27
|
-
const { displayPrompt, displayInstructions,
|
|
26
|
+
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
27
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
28
|
+
const { displayPrompt, displayInstructions, entryFormat } = useRenderingExtensions(qItem);
|
|
28
29
|
// Init input value
|
|
29
30
|
let timeString = null;
|
|
30
31
|
if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueTime)) {
|
|
@@ -45,7 +46,7 @@ function TimeItem(props) {
|
|
|
45
46
|
return (React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }));
|
|
46
47
|
}
|
|
47
48
|
return (React.createElement(FullWidthFormComponentBox, null,
|
|
48
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
|
|
49
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
49
50
|
React.createElement(TimeField, { value: timeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onTimeChange: handleTimeChange, isTabled: isTabled }))));
|
|
50
51
|
}
|
|
51
52
|
export default TimeItem;
|
|
@@ -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;AAQ1B,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB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U,EAAE;QACd,OAAO,CACL,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,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB;QACxB,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;YACvF,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,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
3
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
interface UrlItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
|
|
4
|
+
interface UrlItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
5
|
qItem: QuestionnaireItem;
|
|
6
6
|
qrItem: QuestionnaireResponseItem;
|
|
7
7
|
}
|
|
@@ -23,10 +23,11 @@ import { DEBOUNCE_DURATION } from '../../../utils/debounce';
|
|
|
23
23
|
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
24
24
|
import UrlField from './UrlField';
|
|
25
25
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
26
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
26
27
|
function UrlItem(props) {
|
|
27
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
28
|
-
|
|
29
|
-
const { displayUnit, displayPrompt, displayInstructions,
|
|
28
|
+
const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
|
|
29
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
30
|
+
const { displayUnit, displayPrompt, displayInstructions, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
|
|
30
31
|
// Init input value
|
|
31
32
|
let valueUri = '';
|
|
32
33
|
if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueUri)) {
|
|
@@ -54,7 +55,7 @@ function UrlItem(props) {
|
|
|
54
55
|
return (React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }));
|
|
55
56
|
}
|
|
56
57
|
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-string-box" },
|
|
57
|
-
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
|
|
58
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
|
|
58
59
|
React.createElement(UrlField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, onInputChange: handleChange, isTabled: isTabled }))));
|
|
59
60
|
}
|
|
60
61
|
export default UrlItem;
|
|
@@ -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;AAQrD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,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;AAUrD,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAExF,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,EACJ,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,SAAS,EACV,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAElC,mBAAmB;IACnB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,CAA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QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;KACH;IACD,OAAO,CACL,oBAAC,yBAAyB,iBAAW,mBAAmB;QACtD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;YACvF,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,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const PrimarySelectableList: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
children?: import("react").ReactNode;
|
|
4
|
-
classes?: Partial<import("@mui/material/List").ListClasses> | undefined;
|
|
5
|
-
dense?: boolean | undefined;
|
|
6
|
-
disablePadding?: boolean | undefined;
|
|
7
|
-
subheader?: import("react").ReactNode;
|
|
8
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
9
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & {
|
|
2
|
+
export declare const PrimarySelectableList: import("@emotion/styled").StyledComponent<import("@mui/material/List").ListOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & {
|
|
10
3
|
ref?: ((instance: HTMLUListElement | null) => void) | import("react").RefObject<HTMLUListElement> | null | undefined;
|
|
11
|
-
}, "children" | "sx" | "
|
|
4
|
+
}, "style" | "className" | "children" | "sx" | "classes" | "dense" | "disablePadding" | "subheader"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -23,12 +23,14 @@ import FormBodyCollapsible from './FormBodyCollapsible';
|
|
|
23
23
|
import useResponsive from '../../hooks/useResponsive';
|
|
24
24
|
import useHidden from '../../hooks/useHidden';
|
|
25
25
|
import GroupItemSwitcher from '../FormComponents/GroupItem/GroupItemSwitcher';
|
|
26
|
+
import useReadOnly from '../../hooks/useReadOnly';
|
|
26
27
|
function FormTopLevelItem(props) {
|
|
27
28
|
const { topLevelQItem, topLevelQRItemOrItems, onQrItemChange, onQrRepeatGroupChange } = props;
|
|
28
29
|
const itemIsTabContainer = isTabContainer(topLevelQItem);
|
|
29
30
|
const itemContainsTabs = containsTabs(topLevelQItem);
|
|
30
|
-
const
|
|
31
|
+
const isTablet = useResponsive('up', 'md');
|
|
31
32
|
const itemIsGroup = topLevelQItem.type === 'group';
|
|
33
|
+
const readOnly = useReadOnly(topLevelQItem, false);
|
|
32
34
|
const itemIsHidden = useHidden(topLevelQItem);
|
|
33
35
|
if (itemIsHidden) {
|
|
34
36
|
return null;
|
|
@@ -36,23 +38,23 @@ function FormTopLevelItem(props) {
|
|
|
36
38
|
// If item has multiple answers, use a group item switcher to determine how to render it.
|
|
37
39
|
const hasMultipleAnswers = Array.isArray(topLevelQRItemOrItems);
|
|
38
40
|
if (hasMultipleAnswers) {
|
|
39
|
-
return (React.createElement(GroupItemSwitcher, { qItem: topLevelQItem, qrItemOrItems: topLevelQRItemOrItems, groupCardElevation: 1, onQrItemChange: onQrItemChange, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
41
|
+
return (React.createElement(GroupItemSwitcher, { qItem: topLevelQItem, qrItemOrItems: topLevelQRItemOrItems, groupCardElevation: 1, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange, onQrRepeatGroupChange: onQrRepeatGroupChange }));
|
|
40
42
|
}
|
|
41
43
|
// At this point, item only has one answer
|
|
42
44
|
const topLevelQRItem = topLevelQRItemOrItems;
|
|
43
45
|
// If form is tabbed, it is rendered as a tabbed form
|
|
44
46
|
if (itemContainsTabs || itemIsTabContainer) {
|
|
45
|
-
if (
|
|
47
|
+
if (isTablet) {
|
|
46
48
|
return (React.createElement(FormBodyTabbed, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, onQrItemChange: onQrItemChange }));
|
|
47
49
|
}
|
|
48
50
|
return (React.createElement(FormBodyCollapsible, { key: topLevelQItem.linkId, topLevelQItem: topLevelQItem, topLevelQRItem: topLevelQRItem, onQrItemChange: onQrItemChange }));
|
|
49
51
|
}
|
|
50
52
|
// If form is untabbed, it is rendered as a regular group
|
|
51
53
|
if (itemIsGroup) {
|
|
52
|
-
return (React.createElement(GroupItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, groupCardElevation: 1,
|
|
54
|
+
return (React.createElement(GroupItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, groupCardElevation: 1, isRepeated: false, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
53
55
|
}
|
|
54
56
|
// Otherwise, it is rendered as a non-group item
|
|
55
|
-
return (React.createElement(SingleItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, isTabled: false,
|
|
57
|
+
return (React.createElement(SingleItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, isRepeated: false, isTabled: false, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
56
58
|
}
|
|
57
59
|
export default FormTopLevelItem;
|
|
58
60
|
//# sourceMappingURL=FormTopLevelItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormTopLevelItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTopLevelItem.tsx"],"names":[],"mappings":"AAAA;;;;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U,EAAE,KAAK,EACjB,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,gDAAgD;IAChD,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,aAAa,CAAC,MAAM,EACzB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -29,7 +29,7 @@ const FormBodySingleTab = memo(function FormBodySingleTab(props) {
|
|
|
29
29
|
window.scrollTo(0, 0);
|
|
30
30
|
}
|
|
31
31
|
return (React.createElement(React.Fragment, null,
|
|
32
|
-
React.createElement(ListItemButton, { selected: selected, sx: { my: 0.
|
|
32
|
+
React.createElement(ListItemButton, { selected: selected, sx: { my: 0.1, minHeight: '36px' }, onClick: handleTabClick },
|
|
33
33
|
React.createElement(ListItemText, { primary: React.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "space-between" },
|
|
34
34
|
React.createElement(Typography, { variant: "subtitle2" }, tabLabel),
|
|
35
35
|
React.createElement(Box, { display: "flex", minHeight: 24, minWidth: 24, ml: 1 }, contextDisplayItems.map((item) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodySingleTab.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodySingleTab.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,qBAAqB,MAA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cAAc;QACrB,SAAS,CAAC,SAAS,CAAC,CAAC;QACrB,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,CACL;QACE,oBAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,EAClC,OAAO,EAAE,cAAc;YACvB,oBAAC,YAAY,IACX,OAAO,EACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe;oBACpE,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,IAAE,QAAQ,CAAc;oBACvD,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IACnD,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBAChC,OAAO,oBAAC,kBAAkB,IAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,GAAI,CAAC;oBACrE,CAAC,CAAC,CACE,CACF,GAER,CACa,CAChB,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -23,7 +23,7 @@ import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
|
23
23
|
function ShowCompletedTabsSection(props) {
|
|
24
24
|
const { completedTabsExpanded, setCompletedTabsExpanded } = props;
|
|
25
25
|
return (React.createElement(Box, { display: "flex", justifyContent: "center", alignItems: "center", mx: 2, columnGap: 0.5 },
|
|
26
|
-
React.createElement(Typography, { variant: "overline", fontSize:
|
|
26
|
+
React.createElement(Typography, { variant: "overline", fontSize: 8.5, color: completedTabsExpanded ? 'text.secondary' : 'text.disabled' },
|
|
27
27
|
"Completed tabs ",
|
|
28
28
|
completedTabsExpanded ? 'shown' : 'hidden'),
|
|
29
29
|
React.createElement(IconButton, { size: "small", onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowCompletedTabsSection.js","sourceRoot":"","sources":["../../../src/components/Tabs/ShowCompletedTabsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAOxD,SAAS,wBAAwB,CAAC,KAAoC;IACpE,MAAM,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,GAAG,KAAK,CAAC;IAElE,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG;QACnF,oBAAC,UAAU,IACT,OAAO,EAAC,UAAU,EAClB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ShowCompletedTabsSection.js","sourceRoot":"","sources":["../../../src/components/Tabs/ShowCompletedTabsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAOxD,SAAS,wBAAwB,CAAC,KAAoC;IACpE,MAAM,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,GAAG,KAAK,CAAC;IAElE,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG;QACnF,oBAAC,UAAU,IACT,OAAO,EAAC,UAAU,EAClB,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe;;YACjD,qBAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAC/C;QACb,oBAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;gBACZ,wBAAwB,CAAC,CAAC,qBAAqB,CAAC,CAAC;YACnD,CAAC,IACA,qBAAqB,CAAC,CAAC,CAAC,oBAAC,UAAU,IAAC,QAAQ,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC,oBAAC,UAAU,IAAC,QAAQ,EAAC,OAAO,GAAG,CAC/E,CACT,CACP,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
interface UseMinimalStringCalculatedExpression {
|
|
3
|
+
calcExpUpdated: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface useMinimalStringCalculatedExpressionProps {
|
|
6
|
+
qItem: QuestionnaireItem;
|
|
7
|
+
inputValue: string;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function useMinimalStringCalculatedExpression(props: useMinimalStringCalculatedExpressionProps): UseMinimalStringCalculatedExpression;
|
|
11
|
+
export default useMinimalStringCalculatedExpression;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { useEffect } from 'react';
|
|
18
|
+
import { createEmptyQrItem } from '../utils/qrItem';
|
|
19
|
+
import useQuestionnaireStore from '../stores/useQuestionnaireStore';
|
|
20
|
+
function useMinimalStringCalculatedExpression(props) {
|
|
21
|
+
const { qItem, inputValue, onQrItemChange } = props;
|
|
22
|
+
const calculatedExpressions = useQuestionnaireStore((state) => state.calculatedExpressions);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const calcExpression = calculatedExpressions[qItem.linkId];
|
|
25
|
+
// only update if calculated value is different from current value
|
|
26
|
+
if ((calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) !== inputValue && typeof (calcExpression === null || calcExpression === void 0 ? void 0 : calcExpression.value) === 'string') {
|
|
27
|
+
// update questionnaireResponse
|
|
28
|
+
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueString: calcExpression.value }] }));
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
// Only trigger this effect if calculatedExpression of item changes
|
|
32
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
|
+
[calculatedExpressions]);
|
|
34
|
+
return { calcExpUpdated: false };
|
|
35
|
+
}
|
|
36
|
+
export default useMinimalStringCalculatedExpression;
|
|
37
|
+
//# sourceMappingURL=useMinimalStringCalculatedExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMinimalStringCalculatedExpression.js","sourceRoot":"","sources":["../../src/hooks/useMinimalStringCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AAYpE,SAAS,oCAAoC,CAC3C,KAAgD;IAEhD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEpD,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAE5F,SAAS,CACP,GAAG,EAAE;QACH,MAAM,cAAc,GAAG,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE3D,kEAAkE;QAClE,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,MAAK,UAAU,IAAI,OAAO,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,CAAA,KAAK,QAAQ,EAAE;YACrF,+BAA+B;YAC/B,cAAc,iCACT,iBAAiB,CAAC,KAAK,CAAC,KAC3B,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC,IAC/C,CAAC;SACJ;IACH,CAAC;IACD,mEAAmE;IACnE,uDAAuD;IACvD,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC;AAED,eAAe,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import useRenderingExtensions from './useRenderingExtensions';
|
|
18
|
+
function useReadOnly(qItem, parentIsReadOnly) {
|
|
19
|
+
let { readOnly } = useRenderingExtensions(qItem);
|
|
20
|
+
if (typeof parentIsReadOnly === 'boolean' && parentIsReadOnly) {
|
|
21
|
+
readOnly = parentIsReadOnly;
|
|
22
|
+
}
|
|
23
|
+
return readOnly;
|
|
24
|
+
}
|
|
25
|
+
export default useReadOnly;
|
|
26
|
+
//# sourceMappingURL=useReadOnly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReadOnly.js","sourceRoot":"","sources":["../../src/hooks/useReadOnly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAE9D,SAAS,WAAW,CAAC,KAAwB,EAAE,gBAAqC;IAClF,IAAI,EAAE,QAAQ,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,OAAO,gBAAgB,KAAK,SAAS,IAAI,gBAAgB,EAAE;QAC7D,QAAQ,GAAG,gBAAgB,CAAC;KAC7B;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export default function Typography(theme) {
|
|
18
|
+
return {
|
|
19
|
+
MuiTypography: {
|
|
20
|
+
styleOverrides: {
|
|
21
|
+
paragraph: {
|
|
22
|
+
marginBottom: theme.spacing(2)
|
|
23
|
+
},
|
|
24
|
+
gutterBottom: {
|
|
25
|
+
marginBottom: theme.spacing(1)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=Typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/theme/overrides/Typography.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAY;IAC7C,OAAO;QACL,aAAa,EAAE;YACb,cAAc,EAAE;gBACd,SAAS,EAAE;oBACT,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;iBAC/B;gBACD,YAAY,EAAE;oBACZ,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;iBAC/B;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/lib/theme/typography.js
CHANGED
|
@@ -34,9 +34,7 @@ export function responsiveFontSizes(props) {
|
|
|
34
34
|
// ----------------------------------------------------------------------
|
|
35
35
|
const typography = {
|
|
36
36
|
fontFamily: ['Inter', 'sans-serif', 'Roboto', 'Arial', '"Helvetica Neue"', 'Helvetica'].join(','),
|
|
37
|
-
fontWeightRegular:
|
|
38
|
-
fontWeightMedium: 600,
|
|
39
|
-
fontWeightBold: 700,
|
|
37
|
+
fontWeightRegular: 500,
|
|
40
38
|
h1: Object.assign({ fontWeight: 800, lineHeight: 80 / 64, fontSize: pxToRem(36) }, responsiveFontSizes({ sm: 40, md: 48, lg: 54 })),
|
|
41
39
|
h2: Object.assign({ fontWeight: 800, lineHeight: 64 / 48, fontSize: pxToRem(28) }, responsiveFontSizes({ sm: 32, md: 34, lg: 36 })),
|
|
42
40
|
h3: Object.assign({ fontWeight: 700, lineHeight: 1.5, fontSize: pxToRem(20) }, responsiveFontSizes({ sm: 22, md: 26, lg: 28 })),
|
|
@@ -51,11 +49,11 @@ const typography = {
|
|
|
51
49
|
subtitle2: {
|
|
52
50
|
fontWeight: 600,
|
|
53
51
|
lineHeight: 22 / 14,
|
|
54
|
-
fontSize: pxToRem(11)
|
|
52
|
+
fontSize: pxToRem(11.5)
|
|
55
53
|
},
|
|
56
54
|
body1: {
|
|
57
55
|
lineHeight: 1.5,
|
|
58
|
-
fontSize: pxToRem(12)
|
|
56
|
+
fontSize: pxToRem(12.25)
|
|
59
57
|
},
|
|
60
58
|
body2: {
|
|
61
59
|
lineHeight: 22 / 14,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,GAAG,KAAK,GAAG,EAAE,KAAK,CAAC;AAC5B,CAAC;AAED,MAAM,UA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EAAE,OAAO,CAAC,EAAE,CAAC,IAClB,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CACnD;IACD,SAAS,EAAE;QACT,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;KACtB;IACD,SAAS,EAAE;QACT,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,EAAE,GAAG,EAAE;QACnB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;KACxB;IACD,KAAK,EAAE;QACL,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;KACzB;IACD,KAAK,EAAE;QACL,UAAU,EAAE,EAAE,GAAG,EAAE;QACnB,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;KACtB;IACD,OAAO,EAAE;QACP,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;KACtB;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;KACtB;IACD,MAAM,EAAE;QACN,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,EAAE,GAAG,EAAE;QACnB,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;KACtB;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -11,4 +11,16 @@ export declare function evaluateCalculatedExpressions(fhirPathContext: Record<st
|
|
|
11
11
|
updatedCalculatedExpressions: Record<string, CalculatedExpression>;
|
|
12
12
|
};
|
|
13
13
|
export declare function initialiseCalculatedExpressionValues(questionnaire: Questionnaire, populatedResponse: QuestionnaireResponse, calculatedExpressions: Record<string, CalculatedExpression>): QuestionnaireResponse;
|
|
14
|
+
/**
|
|
15
|
+
* Check if an answer is a datetime in the format YYYY, YYYY-MM, YYYY-MM-DD, YYYY-MM-DDThh:mm:ss+zz:zz
|
|
16
|
+
*
|
|
17
|
+
* @author Sean Fong
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkIsDateTime(value: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Check if an answer is in a time format - Regex: ([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?
|
|
22
|
+
*
|
|
23
|
+
* @author Sean Fong
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkIsTime(value: string): boolean;
|
|
14
26
|
export {};
|