@aehrc/smart-forms-renderer 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +0 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +39 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +14 -27
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +13 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +4 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +14 -22
- 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 +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +27 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +9 -24
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +14 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +8 -21
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +10 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +41 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +7 -23
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +8 -18
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +4 -4
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/Item.styles.d.ts +2 -2
- package/lib/components/FormComponents/Item.styles.js +2 -2
- package/lib/components/FormComponents/Item.styles.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +20 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +49 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js +2 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +11 -35
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +17 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +42 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +23 -36
- 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 +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +15 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +29 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +3 -23
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +11 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +14 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +2 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +18 -23
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +12 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +16 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +8 -14
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItem.js +2 -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 +3 -3
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/Tables/AddItemButton.d.ts +8 -0
- package/lib/components/FormComponents/Tables/AddItemButton.js +28 -0
- package/lib/components/FormComponents/Tables/AddItemButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/AddRowButton.d.ts +8 -0
- package/lib/components/FormComponents/Tables/AddRowButton.js +28 -0
- package/lib/components/FormComponents/Tables/AddRowButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTable.d.ts +10 -0
- package/lib/components/FormComponents/Tables/GroupTable.js +108 -0
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +10 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.js +46 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -0
- package/lib/components/FormComponents/Tables/index.d.ts +1 -1
- package/lib/components/FormComponents/Tables/index.js +1 -1
- package/lib/components/FormComponents/Tables/index.js.map +1 -1
- package/lib/components/Renderer/FormBodyTabbed.js +1 -1
- package/lib/components/Renderer/FormBodyTabbed.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/FormBodyTabList.d.ts +1 -0
- package/lib/components/Tabs/FormBodyTabList.js +3 -4
- package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
- package/lib/components/Tabs/FormBodyTabListWrapper.d.ts +1 -1
- package/lib/components/Tabs/FormBodyTabListWrapper.js +6 -13
- package/lib/components/Tabs/FormBodyTabListWrapper.js.map +1 -1
- package/lib/components/Tabs/ShowCompletedTabsSection.d.ts +7 -0
- package/lib/components/Tabs/ShowCompletedTabsSection.js +34 -0
- package/lib/components/Tabs/ShowCompletedTabsSection.js.map +1 -0
- package/lib/hooks/useContextDisplayItems.d.ts +6 -0
- package/lib/hooks/useContextDisplayItems.js +30 -0
- package/lib/hooks/useContextDisplayItems.js.map +1 -0
- package/lib/hooks/useInitialiseRenderer.js +2 -2
- package/lib/hooks/useInitialiseRenderer.js.map +1 -1
- package/lib/hooks/useInitialiseRepeatGroups.d.ts +1 -1
- package/lib/hooks/useNumberInput.d.ts +1 -1
- package/lib/hooks/useNumberInput.js.map +1 -1
- package/lib/hooks/useStringInput.d.ts +1 -1
- package/lib/hooks/useStringInput.js.map +1 -1
- package/lib/hooks/useTerminologyServerQuery.js +3 -6
- package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/interfaces/renderProps.interface.d.ts +3 -0
- package/lib/stores/useQuestionnaireResponseStore.d.ts +2 -1
- package/lib/stores/useQuestionnaireResponseStore.js +5 -3
- package/lib/stores/useQuestionnaireResponseStore.js.map +1 -1
- package/lib/utils/qrItem.d.ts +2 -3
- package/lib/utils/qrItem.js +2 -3
- package/lib/utils/qrItem.js.map +1 -1
- package/lib/utils/repopulateIntoResponse.d.ts +2 -2
- package/lib/utils/repopulateItems.js +0 -1
- package/lib/utils/repopulateItems.js.map +1 -1
- package/package.json +7 -7
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +0 -1
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +85 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +35 -58
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +79 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +37 -50
- package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +10 -5
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +48 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +25 -53
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +83 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +27 -49
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +81 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +19 -54
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +97 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +22 -60
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +4 -4
- package/src/components/FormComponents/Item.styles.ts +2 -2
- package/src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx +72 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +131 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +38 -93
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +112 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +57 -76
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +8 -5
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +72 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +12 -59
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +54 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +40 -64
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +63 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +22 -50
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +6 -3
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +7 -3
- package/src/components/FormComponents/Tables/AddRowButton.tsx +49 -0
- package/src/components/FormComponents/Tables/{QItemGroupTable.tsx → GroupTable.tsx} +6 -17
- package/src/components/FormComponents/Tables/{QItemGroupTableRow.tsx → GroupTableRow.tsx} +2 -2
- package/src/components/FormComponents/Tables/index.ts +1 -1
- package/src/components/Renderer/FormBodyTabbed.tsx +1 -1
- package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
- package/src/components/Tabs/FormBodyTabList.tsx +5 -8
- package/src/components/Tabs/FormBodyTabListWrapper.tsx +15 -26
- package/src/components/Tabs/ShowCompletedTabsSection.tsx +52 -0
- package/src/hooks/useContextDisplayItems.ts +40 -0
- package/src/hooks/useInitialiseRenderer.ts +2 -2
- package/src/hooks/useInitialiseRepeatGroups.ts +1 -1
- package/src/hooks/useNumberInput.ts +2 -1
- package/src/hooks/useStringInput.ts +2 -1
- package/src/hooks/useTerminologyServerQuery.ts +3 -6
- package/src/index.ts +2 -2
- package/src/interfaces/renderProps.interface.ts +4 -0
- package/src/stores/useQuestionnaireResponseStore.ts +5 -4
- package/src/utils/qrItem.ts +4 -3
- package/src/utils/repopulateIntoResponse.ts +2 -2
- package/src/utils/repopulateItems.ts +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import React, { useMemo, useState } from 'react';
|
|
18
|
+
import Divider from '@mui/material/Divider';
|
|
19
|
+
import Paper from '@mui/material/Paper';
|
|
20
|
+
import Table from '@mui/material/Table';
|
|
21
|
+
import TableBody from '@mui/material/TableBody';
|
|
22
|
+
import TableCell from '@mui/material/TableCell';
|
|
23
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
24
|
+
import TableHead from '@mui/material/TableHead';
|
|
25
|
+
import TableRow from '@mui/material/TableRow';
|
|
26
|
+
import Typography from '@mui/material/Typography';
|
|
27
|
+
import GroupTableRow from './GroupTableRow';
|
|
28
|
+
import { HeaderTableCell } from './Table.styles';
|
|
29
|
+
import { QGroupContainerBox } from '../../Box.styles';
|
|
30
|
+
import { mapQItemsIndex } from '../../../utils/mapItem';
|
|
31
|
+
import useInitialiseGroupTable from '../../../hooks/useInitialiseGroupTable';
|
|
32
|
+
import { nanoid } from 'nanoid';
|
|
33
|
+
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
34
|
+
import DeleteRowButton from './DeleteRowButton';
|
|
35
|
+
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
36
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
37
|
+
import AddRowButton from './AddRowButton';
|
|
38
|
+
function GroupTable(props) {
|
|
39
|
+
const { qItem, qrItems, groupCardElevation, onQrRepeatGroupChange } = props;
|
|
40
|
+
const initialisedGroupTables = useInitialiseGroupTable(qrItems);
|
|
41
|
+
const [tableRows, setTableRows] = useState(initialisedGroupTables);
|
|
42
|
+
// Generate item labels as table headers
|
|
43
|
+
const qItems = qItem.item;
|
|
44
|
+
const itemLabels = useMemo(() => { var _a; return (_a = qItems === null || qItems === void 0 ? void 0 : qItems.map((item) => { var _a; return (_a = item.text) !== null && _a !== void 0 ? _a : ''; })) !== null && _a !== void 0 ? _a : []; }, [qItems]);
|
|
45
|
+
const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
|
|
46
|
+
// Check if there are columns within the group table
|
|
47
|
+
if (!qItems || qItems.length === 0) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
// Event Handlers
|
|
51
|
+
function handleRowChange(newQrRow, index) {
|
|
52
|
+
const updatedTableRows = [...tableRows];
|
|
53
|
+
if (newQrRow.item) {
|
|
54
|
+
updatedTableRows[index].qrItem = {
|
|
55
|
+
linkId: newQrRow.linkId,
|
|
56
|
+
text: newQrRow.text,
|
|
57
|
+
item: newQrRow.item
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
setTableRows(updatedTableRows);
|
|
61
|
+
onQrRepeatGroupChange({
|
|
62
|
+
linkId: qItem.linkId,
|
|
63
|
+
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [cloneDeep(singleRow.qrItem)] : [])
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function handleDeleteRow(index) {
|
|
67
|
+
const updatedTableRows = [...tableRows];
|
|
68
|
+
updatedTableRows.splice(index, 1);
|
|
69
|
+
setTableRows(updatedTableRows);
|
|
70
|
+
onQrRepeatGroupChange({
|
|
71
|
+
linkId: qItem.linkId,
|
|
72
|
+
qrItems: updatedTableRows.flatMap((singleRow) => singleRow.qrItem ? [cloneDeep(singleRow.qrItem)] : [])
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function handleAddRow() {
|
|
76
|
+
setTableRows([
|
|
77
|
+
...tableRows,
|
|
78
|
+
{
|
|
79
|
+
nanoId: nanoid(),
|
|
80
|
+
qrItem: null
|
|
81
|
+
}
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
84
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
|
|
85
|
+
groupCardElevation !== 1 ? (React.createElement(React.Fragment, null,
|
|
86
|
+
React.createElement(Typography, { fontSize: 13, variant: "h6" },
|
|
87
|
+
React.createElement(LabelWrapper, { qItem: qItem })),
|
|
88
|
+
React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
|
|
89
|
+
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
90
|
+
React.createElement(Table, null,
|
|
91
|
+
React.createElement("caption", null,
|
|
92
|
+
React.createElement(AddRowButton, { repeatGroups: tableRows, onAddItem: handleAddRow })),
|
|
93
|
+
React.createElement(TableHead, null,
|
|
94
|
+
React.createElement(TableRow, null,
|
|
95
|
+
itemLabels.map((itemLabel) => (React.createElement(HeaderTableCell, { key: itemLabel }, itemLabel))),
|
|
96
|
+
React.createElement(TableCell, null))),
|
|
97
|
+
React.createElement(TableBody, null, tableRows.map(({ nanoId, qrItem: nullableQrItem }, index) => {
|
|
98
|
+
const answeredQrItem = createEmptyQrItem(qItem);
|
|
99
|
+
if (nullableQrItem) {
|
|
100
|
+
answeredQrItem.item = nullableQrItem.item;
|
|
101
|
+
}
|
|
102
|
+
return (React.createElement(TableRow, { key: nanoId },
|
|
103
|
+
React.createElement(GroupTableRow, { qItem: qItem, qrItem: answeredQrItem, qItemsIndexMap: qItemsIndexMap, onQrItemChange: (newQrGroup) => handleRowChange(newQrGroup, index) }),
|
|
104
|
+
React.createElement(DeleteRowButton, { nullableQrItem: nullableQrItem, numOfRows: tableRows.length, onDeleteItem: () => handleDeleteRow(index) })));
|
|
105
|
+
}))))));
|
|
106
|
+
}
|
|
107
|
+
export default GroupTable;
|
|
108
|
+
//# sourceMappingURL=GroupTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,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;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,uBAAuB,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
|
|
5
|
+
qItem: QuestionnaireItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem;
|
|
7
|
+
qItemsIndexMap: Record<string, number>;
|
|
8
|
+
}
|
|
9
|
+
declare function GroupTableRow(props: Props): React.JSX.Element | null;
|
|
10
|
+
export default GroupTableRow;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { createQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
|
|
19
|
+
import SingleItem from '../SingleItem/SingleItem';
|
|
20
|
+
import { getQrItemsIndex } from '../../../utils/mapItem';
|
|
21
|
+
import { StandardTableCell } from './Table.styles';
|
|
22
|
+
function GroupTableRow(props) {
|
|
23
|
+
const { qItem, qrItem, qItemsIndexMap, onQrItemChange } = props;
|
|
24
|
+
const rowItems = qItem.item;
|
|
25
|
+
const row = qrItem && qrItem.item ? qrItem : createQrGroup(qItem);
|
|
26
|
+
const rowQrItems = row.item;
|
|
27
|
+
if (!rowItems || !rowQrItems) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function handleQrRowItemChange(newQrRowItem) {
|
|
31
|
+
const qrRow = Object.assign({}, row);
|
|
32
|
+
updateQrItemsInGroup(newQrRowItem, null, qrRow, qItemsIndexMap);
|
|
33
|
+
onQrItemChange(qrRow);
|
|
34
|
+
}
|
|
35
|
+
const qrItemsByIndex = getQrItemsIndex(rowItems, rowQrItems, qItemsIndexMap);
|
|
36
|
+
return (React.createElement(React.Fragment, null, rowItems.map((rowItem, index) => {
|
|
37
|
+
const qrItem = qrItemsByIndex[index];
|
|
38
|
+
if (Array.isArray(qrItem)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return (React.createElement(StandardTableCell, { key: index, numOfColumns: rowItems.length, isFirst: index === 0 },
|
|
42
|
+
React.createElement(SingleItem, { key: qItem.linkId, qItem: rowItem, qrItem: qrItem, isRepeated: true, isTabled: true, onQrItemChange: handleQrRowItemChange })));
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
export default GroupTableRow;
|
|
46
|
+
//# sourceMappingURL=GroupTableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnD,SAAS,aAAa,CAAC,KAAY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,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as GroupTable } from './
|
|
1
|
+
export { default as GroupTable } from './GroupTable';
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
export { default as GroupTable } from './
|
|
17
|
+
export { default as GroupTable } from './GroupTable';
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -41,7 +41,7 @@ function FormBodyTabbed(props) {
|
|
|
41
41
|
return (React.createElement(Grid, { container: true, spacing: 2 },
|
|
42
42
|
React.createElement(TabContext, { value: currentTab.toString() },
|
|
43
43
|
React.createElement(Grid, { item: true, xs: 12, md: 3.5, lg: 3, xl: 2.75 },
|
|
44
|
-
React.createElement(FormBodyTabListWrapper, {
|
|
44
|
+
React.createElement(FormBodyTabListWrapper, { topLevelItems: qItems, currentTabIndex: currentTab, tabs: tabs })),
|
|
45
45
|
React.createElement(Grid, { item: true, xs: 12, md: 8.5, lg: 9, xl: 9.25 }, qItems.map((qItem, i) => {
|
|
46
46
|
var _a, _b;
|
|
47
47
|
const qrItem = qrItemsByIndex[i];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodyTabbed.js","sourceRoot":"","sources":["../../../src/components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AAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAEnC,IAAI,CAAC,KAAK,IAAI,CAAC,gBAAgB,EAAE;oBAC/B,oCAAoC;oBACpC,OAAO,IAAI,CAAC;iBACb;gBAED,MAAM,UAAU,GAAG,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC;gBAC1C,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,mCAAI,KAAK,CAAC;gBAErE,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,eACT,oBAAoB;oBAC9B,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,UAAU,EAC3B,cAAc,EAAE,mBAAmB,GACnC,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,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.15, 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,MAAM,oCAAoC,CAAC;AAEvE,OAAO,kBAAkB,MAAM,gDAAgD,CAAC;AAShF,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,iBAAiB,CAAC,KAA6B;IACrF,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAErE,MAAM,SAAS,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEpE,SAAS,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,
|
|
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;AAC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a,CAChB,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -6,6 +6,7 @@ interface FormBodyTabListProps {
|
|
|
6
6
|
currentTabIndex: number;
|
|
7
7
|
tabs: Tabs;
|
|
8
8
|
completedTabsCollapsed: boolean;
|
|
9
|
+
allContextDisplayItems: QuestionnaireItem[][];
|
|
9
10
|
}
|
|
10
11
|
declare const FormBodyTabList: React.NamedExoticComponent<FormBodyTabListProps>;
|
|
11
12
|
export default FormBodyTabList;
|
|
@@ -14,19 +14,18 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import React, { memo
|
|
17
|
+
import React, { memo } from 'react';
|
|
18
18
|
import Collapse from '@mui/material/Collapse';
|
|
19
19
|
import { TransitionGroup } from 'react-transition-group';
|
|
20
20
|
import { getShortText } from '../../utils/itemControl';
|
|
21
21
|
import FormBodySingleTab from './FormBodySingleTab';
|
|
22
22
|
import useQuestionnaireStore from '../../stores/useQuestionnaireStore';
|
|
23
|
-
import {
|
|
23
|
+
import { isTabHidden } from '../../utils/tabs';
|
|
24
24
|
const FormBodyTabList = memo(function FormBodyTabList(props) {
|
|
25
|
-
const { topLevelItems, currentTabIndex, tabs, completedTabsCollapsed } = props;
|
|
25
|
+
const { topLevelItems, currentTabIndex, tabs, completedTabsCollapsed, allContextDisplayItems } = props;
|
|
26
26
|
const enableWhenIsActivated = useQuestionnaireStore((state) => state.enableWhenIsActivated);
|
|
27
27
|
const enableWhenItems = useQuestionnaireStore((state) => state.enableWhenItems);
|
|
28
28
|
const enableWhenExpressions = useQuestionnaireStore((state) => state.enableWhenExpressions);
|
|
29
|
-
const allContextDisplayItems = useMemo(() => topLevelItems.map((topLevelItem) => getContextDisplays(topLevelItem)), [topLevelItems]);
|
|
30
29
|
return (React.createElement(TransitionGroup, null, topLevelItems.map((qItem, i) => {
|
|
31
30
|
var _a, _b;
|
|
32
31
|
const contextDisplayItems = allContextDisplayItems[i];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodyTabList.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodyTabList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"FormBodyTabList.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodyTabList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAU/C,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,eAAe,CAAC,KAA2B;IAC/E,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,GAC5F,KAAK,CAAC;IAER,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC5F,MAAM,eAAe,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAChF,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAE5F,OAAO,CACL,oBAAC,eAAe,QACb,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;;QAC9B,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnC,IACE,WAAW,CAAC;YACV,KAAK;YACL,mBAAmB;YACnB,KAAK;YACL,qBAAqB;YACrB,eAAe;YACf,qBAAqB;YACrB,sBAAsB;SACvB,CAAC,EACF;YACA,OAAO,IAAI,CAAC;SACb;QAED,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;QAClE,MAAM,QAAQ,GAAG,MAAA,MAAA,YAAY,CAAC,KAAK,CAAC,mCAAI,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC;QAEzD,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG;YACvC,oBAAC,iBAAiB,IAChB,mBAAmB,EAAE,mBAAmB,EACxC,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,CAAC,GACZ,CACO,CACZ,CAAC;IACJ,CAAC,CAAC,CACc,CACnB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { QuestionnaireItem } from 'fhir/r4';
|
|
3
3
|
import type { Tabs } from '../../interfaces/tab.interface';
|
|
4
4
|
interface FormBodyTabListWrapperProps {
|
|
5
|
-
|
|
5
|
+
topLevelItems: QuestionnaireItem[];
|
|
6
6
|
currentTabIndex: number;
|
|
7
7
|
tabs: Tabs;
|
|
8
8
|
}
|
|
@@ -18,27 +18,20 @@ import React, { memo, useState } from 'react';
|
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import Card from '@mui/material/Card';
|
|
20
20
|
import { PrimarySelectableList } from '../Lists.styles';
|
|
21
|
-
import { IconButton } from '@mui/material';
|
|
22
|
-
import ExpandLess from '@mui/icons-material/ExpandLess';
|
|
23
|
-
import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
24
|
-
import Typography from '@mui/material/Typography';
|
|
25
21
|
import Divider from '@mui/material/Divider';
|
|
26
22
|
import FormBodyTabList from './FormBodyTabList';
|
|
23
|
+
import ShowCompletedTabsSection from './ShowCompletedTabsSection';
|
|
24
|
+
import useContextDisplayItems from '../../hooks/useContextDisplayItems';
|
|
27
25
|
const FormBodyTabListWrapper = memo(function FormBodyTabListWrapper(props) {
|
|
28
|
-
const {
|
|
26
|
+
const { topLevelItems, currentTabIndex, tabs } = props;
|
|
29
27
|
const [completedTabsExpanded, setCompletedTabsExpanded] = useState(true);
|
|
28
|
+
const { allContextDisplayItems, completedDisplayItemExists } = useContextDisplayItems(topLevelItems);
|
|
30
29
|
return (React.createElement(Card, { sx: { p: 0.75, mb: 2 } },
|
|
31
30
|
React.createElement(Box, { sx: { flexGrow: 1 } },
|
|
32
31
|
React.createElement(PrimarySelectableList, { dense: true, disablePadding: true, sx: { mb: 1 }, "data-test": "renderer-tab-list" },
|
|
33
|
-
React.createElement(
|
|
34
|
-
React.createElement(Typography, { variant: "overline", fontSize: 9, color: completedTabsExpanded ? 'text.secondary' : 'text.disabled' },
|
|
35
|
-
"Completed tabs ",
|
|
36
|
-
completedTabsExpanded ? 'shown' : 'hidden'),
|
|
37
|
-
React.createElement(IconButton, { size: "small", onClick: () => {
|
|
38
|
-
setCompletedTabsExpanded(!completedTabsExpanded);
|
|
39
|
-
} }, completedTabsExpanded ? (React.createElement(ExpandLess, { fontSize: "small" })) : (React.createElement(ExpandMore, { fontSize: "small" })))),
|
|
32
|
+
completedDisplayItemExists ? (React.createElement(ShowCompletedTabsSection, { completedTabsExpanded: completedTabsExpanded, setCompletedTabsExpanded: setCompletedTabsExpanded })) : null,
|
|
40
33
|
React.createElement(Divider, { sx: { mx: 1 }, light: true }),
|
|
41
|
-
React.createElement(FormBodyTabList, { topLevelItems:
|
|
34
|
+
React.createElement(FormBodyTabList, { topLevelItems: topLevelItems, currentTabIndex: currentTabIndex, tabs: tabs, completedTabsCollapsed: !completedTabsExpanded, allContextDisplayItems: allContextDisplayItems })))));
|
|
42
35
|
});
|
|
43
36
|
export default FormBodyTabListWrapper;
|
|
44
37
|
//# sourceMappingURL=FormBodyTabListWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodyTabListWrapper.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodyTabListWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,
|
|
1
|
+
{"version":3,"file":"FormBodyTabListWrapper.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodyTabListWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,sBAAsB,MAAM,oCAAoC,CAAC;AAQxE,MAAM,sBAAsB,GAAG,IAAI,CAAC,SAAS,sBAAsB,CACjE,KAAkC;IAElC,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAEvD,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEzE,MAAM,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,GAC1D,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAExC,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE;QAC1B,oBAAC,GAAG,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;YACtB,oBAAC,qBAAqB,IAAC,KAAK,QAAC,cAAc,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,eAAY,mBAAmB;gBACrF,0BAA0B,CAAC,CAAC,CAAC,CAC5B,oBAAC,wBAAwB,IACvB,qBAAqB,EAAE,qBAAqB,EAC5C,wBAAwB,EAAE,wBAAwB,GAClD,CACH,CAAC,CAAC,CAAC,IAAI;gBACR,oBAAC,OAAO,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,SAAG;gBAChC,oBAAC,eAAe,IACd,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,IAAI,EACV,sBAAsB,EAAE,CAAC,qBAAqB,EAC9C,sBAAsB,EAAE,sBAAsB,GAC9C,CACoB,CACpB,CACD,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ShowCompletedTabsSectionProps {
|
|
3
|
+
completedTabsExpanded: boolean;
|
|
4
|
+
setCompletedTabsExpanded: (newExpanded: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function ShowCompletedTabsSection(props: ShowCompletedTabsSectionProps): React.JSX.Element;
|
|
7
|
+
export default ShowCompletedTabsSection;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import Box from '@mui/material/Box';
|
|
19
|
+
import Typography from '@mui/material/Typography';
|
|
20
|
+
import { IconButton } from '@mui/material';
|
|
21
|
+
import ExpandLess from '@mui/icons-material/ExpandLess';
|
|
22
|
+
import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
23
|
+
function ShowCompletedTabsSection(props) {
|
|
24
|
+
const { completedTabsExpanded, setCompletedTabsExpanded } = props;
|
|
25
|
+
return (React.createElement(Box, { display: "flex", justifyContent: "center", alignItems: "center", mx: 2, columnGap: 0.5 },
|
|
26
|
+
React.createElement(Typography, { variant: "overline", fontSize: 9, color: completedTabsExpanded ? 'text.secondary' : 'text.disabled' },
|
|
27
|
+
"Completed tabs ",
|
|
28
|
+
completedTabsExpanded ? 'shown' : 'hidden'),
|
|
29
|
+
React.createElement(IconButton, { size: "small", onClick: () => {
|
|
30
|
+
setCompletedTabsExpanded(!completedTabsExpanded);
|
|
31
|
+
} }, completedTabsExpanded ? React.createElement(ExpandLess, { fontSize: "small" }) : React.createElement(ExpandMore, { fontSize: "small" }))));
|
|
32
|
+
}
|
|
33
|
+
export default ShowCompletedTabsSection;
|
|
34
|
+
//# sourceMappingURL=ShowCompletedTabsSection.js.map
|
|
@@ -0,0 +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,CAAC,EACX,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,30 @@
|
|
|
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 { useMemo } from 'react';
|
|
18
|
+
import { getContextDisplays } from '../utils/tabs';
|
|
19
|
+
function useContextDisplayItems(topLevelItems) {
|
|
20
|
+
return useMemo(() => {
|
|
21
|
+
let completedDisplayItemExists = false;
|
|
22
|
+
const allContextDisplayItems = topLevelItems.map((topLevelItem) => getContextDisplays(topLevelItem));
|
|
23
|
+
completedDisplayItemExists = allContextDisplayItems.some((contextDisplayItems) => {
|
|
24
|
+
return contextDisplayItems.some((contextDisplayItem) => contextDisplayItem.text === 'Complete');
|
|
25
|
+
});
|
|
26
|
+
return { allContextDisplayItems, completedDisplayItemExists };
|
|
27
|
+
}, [topLevelItems]);
|
|
28
|
+
}
|
|
29
|
+
export default useContextDisplayItems;
|
|
30
|
+
//# sourceMappingURL=useContextDisplayItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContextDisplayItems.js","sourceRoot":"","sources":["../../src/hooks/useContextDisplayItems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,SAAS,sBAAsB,CAAC,aAAkC;IAChE,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,0BAA0B,GAAG,KAAK,CAAC;QAEvC,MAAM,sBAAsB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAChE,kBAAkB,CAAC,YAAY,CAAC,CACjC,CAAC;QAEF,0BAA0B,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,EAAE;YAC/E,OAAO,mBAAmB,CAAC,IAAI,CAC7B,CAAC,kBAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,KAAK,UAAU,CAC/D,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,CAAC;IAChE,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;AACtB,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { useLayoutEffect, useState } from 'react';
|
|
18
|
-
import {
|
|
18
|
+
import { createEmptyQuestionnaireResponse } from '../utils/qrItem';
|
|
19
19
|
import useQuestionnaireStore from '../stores/useQuestionnaireStore';
|
|
20
20
|
import useQuestionnaireResponseStore from '../stores/useQuestionnaireResponseStore';
|
|
21
21
|
import useSmartConfigStore from '../stores/useSmartConfigStore';
|
|
@@ -57,7 +57,7 @@ function useInitialiseRenderer(questionnaire, questionnaireResponse, additionalV
|
|
|
57
57
|
}
|
|
58
58
|
// initialise form including enableWhen, enableWhenExpressions, calculatedExpressions, initialExpressions, answerExpressions, cache answerValueSets
|
|
59
59
|
buildSourceQuestionnaire(questionnaire, questionnaireResponse, additionalVariables, terminologyServerUrl).then(() => {
|
|
60
|
-
buildSourceResponse(
|
|
60
|
+
buildSourceResponse(createEmptyQuestionnaireResponse(questionnaire));
|
|
61
61
|
if (questionnaireResponse) {
|
|
62
62
|
const updatedResponse = updatePopulatedProperties(questionnaireResponse);
|
|
63
63
|
setUpdatableResponseAsPopulated(updatedResponse);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitialiseRenderer.js","sourceRoot":"","sources":["../../src/hooks/useInitialiseRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useInitialiseRenderer.js","sourceRoot":"","sources":["../../src/hooks/useInitialiseRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,6BAA6B,MAAM,yCAAyC,CAAC;AAEpF,OAAO,mBAAmB,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,yBAAyB,MAAM,qCAAqC,CAAC;AAE5E,SAAS,qBAAqB,CAC5B,aAA4B,EAC5B,qBAA6C,EAC7C,mBAA4C,EAC5C,oBAA6B,EAC7B,UAAmB;IAEnB,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAClG,MAAM,yBAAyB,GAAG,qBAAqB,CACrD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAC3C,CAAC;IACF,MAAM,mBAAmB,GAAG,6BAA6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,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;gBAC3C,YAAY,CAAC,SAAS,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;SACJ;QAED,gFAAgF;QAChF,IAAI,oBAAoB,EAAE;YACxB,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;SAC/C;aAAM;YACL,yBAAyB,EAAE,CAAC;SAC7B;QAED,mJAAmJ;QACnJ,wBAAwB,CACtB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,CACrB,CAAC,IAAI,CAAC,GAAG,EAAE;YACV,mBAAmB,CAAC,gCAAgC,CAAC,aAAa,CAAC,CAAC,CAAC;YAErE,IAAI,qBAAqB,EAAE;gBACzB,MAAM,eAAe,GAAG,yBAAyB,CAAC,qBAAqB,CAAC,CAAC;gBACzE,+BAA+B,CAAC,eAAe,CAAC,CAAC;aAClD;YACD,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE;QACD,aAAa;QACb,qBAAqB;QACrB,wBAAwB;QACxB,mBAAmB;QACnB,+BAA+B;QAC/B,yBAAyB;QACzB,mBAAmB;QACnB,UAAU;QACV,cAAc;QACd,UAAU;QACV,OAAO;QACP,YAAY;QACZ,oBAAoB;QACpB,uBAAuB;KACxB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
-
import { QuestionnaireItem } from 'fhir/r4';
|
|
2
|
+
import type { QuestionnaireItem } from 'fhir/r4';
|
|
3
3
|
import type { RepeatGroupSingle } from '../interfaces/repeatGroup.interface';
|
|
4
4
|
declare function useInitialiseRepeatGroups(qItem: QuestionnaireItem, qrItems: QuestionnaireResponseItem[]): RepeatGroupSingle[];
|
|
5
5
|
export default useInitialiseRepeatGroups;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNumberInput.js","sourceRoot":"","sources":["../../src/hooks/useNumberInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"useNumberInput.js","sourceRoot":"","sources":["../../src/hooks/useNumberInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,SAAS,cAAc,CAAC,cAAsB;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEnD,SAAS,CACP,GAAG,EAAE;QACH,IAAI,KAAK,KAAK,cAAc,EAAE;YAC5B,QAAQ,CAAC,cAAc,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStringInput.js","sourceRoot":"","sources":["../../src/hooks/useStringInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"useStringInput.js","sourceRoot":"","sources":["../../src/hooks/useStringInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,SAAS,cAAc,CAAC,cAAsB;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEnD,SAAS,CACP,GAAG,EAAE;QACH,IAAI,KAAK,KAAK,cAAc,EAAE;YAC5B,QAAQ,CAAC,cAAc,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -24,7 +24,6 @@ function useTerminologyServerQuery(qItem, maxList, input, searchTerm) {
|
|
|
24
24
|
const defaultTerminologyServerUrl = useTerminologyServerStore((state) => state.url);
|
|
25
25
|
let fullUrl = '';
|
|
26
26
|
let options = [];
|
|
27
|
-
let loading = false;
|
|
28
27
|
let feedback;
|
|
29
28
|
if (input.length === 0) {
|
|
30
29
|
feedback = undefined;
|
|
@@ -47,12 +46,10 @@ function useTerminologyServerQuery(qItem, maxList, input, searchTerm) {
|
|
|
47
46
|
}
|
|
48
47
|
// Perform query
|
|
49
48
|
const terminologyServerUrl = (_a = getTerminologyServerUrl(qItem)) !== null && _a !== void 0 ? _a : defaultTerminologyServerUrl;
|
|
50
|
-
const {
|
|
49
|
+
const { isFetching, error, data } = useQuery(['expandValueSet', fullUrl], () => getValueSetPromise(fullUrl, terminologyServerUrl), {
|
|
51
50
|
enabled: searchTerm.length >= 2 && answerValueSetUrl !== undefined
|
|
52
51
|
});
|
|
53
|
-
|
|
54
|
-
loading = true;
|
|
55
|
-
}
|
|
52
|
+
console.log(isFetching);
|
|
56
53
|
if (error) {
|
|
57
54
|
console.warn('Ontoserver query failed. Details below: \n' + error);
|
|
58
55
|
feedback = {
|
|
@@ -71,7 +68,7 @@ function useTerminologyServerQuery(qItem, maxList, input, searchTerm) {
|
|
|
71
68
|
};
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
|
-
return { options, loading, feedback };
|
|
71
|
+
return { options, loading: isFetching, feedback };
|
|
75
72
|
}
|
|
76
73
|
export default useTerminologyServerQuery;
|
|
77
74
|
//# sourceMappingURL=useTerminologyServerQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTerminologyServerQuery.js","sourceRoot":"","sources":["../../src/hooks/useTerminologyServerQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGpG,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,yBAAyB,MAAM,qCAAqC,CAAC;AAE5E,SAAS,yBAAyB,CAChC,KAAwB,EACxB,OAAe,EACf,KAAa,EACb,UAAkB;;IAElB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC5F,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEpF,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,OAAO,GAAa,EAAE,CAAC;IAC3B,IAAI,
|
|
1
|
+
{"version":3,"file":"useTerminologyServerQuery.js","sourceRoot":"","sources":["../../src/hooks/useTerminologyServerQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGpG,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,yBAAyB,MAAM,qCAAqC,CAAC;AAE5E,SAAS,yBAAyB,CAChC,KAAwB,EACxB,OAAe,EACf,KAAa,EACb,UAAkB;;IAElB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAA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C1C,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAC3B,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,CAAC,EACvD;QACE,OAAO,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,iBAAiB,KAAK,SAAS;KACnE,CACF,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAExB,IAAI,KAAK,EAAE;QACT,OAAO,CAAC,IAAI,CAAC,4CAA4C,GAAG,KAAK,CAAC,CAAC;QACnE,QAAQ,GAAG;YACT,OAAO,EAAE,2EAA2E;YACpF,KAAK,EAAE,OAAO;SACf,CAAC;KACH;IAED,IAAI,IAAI,EAAE;QACR,IAAI,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,KAAK,MAAK,CAAC,EAAE;YAC/B,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;SACpC;aAAM;YACL,QAAQ,GAAG;gBACT,OAAO,EAAE,wEAAwE;gBACjF,KAAK,EAAE,SAAS;aACjB,CAAC;SACH;KACF;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AACpD,CAAC;AACD,eAAe,yBAAyB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import useQuestionnaireStore from './stores/useQuestionnaireStore';
|
|
11
|
-
import {
|
|
11
|
+
import { createEmptyQuestionnaireResponse } from './utils/qrItem';
|
|
12
12
|
import useQuestionnaireResponseStore from './stores/useQuestionnaireResponseStore';
|
|
13
13
|
import { removeHiddenAnswers } from './utils/removeHidden';
|
|
14
14
|
import { getItemsToRepopulate } from './utils/repopulateItems';
|
|
@@ -29,7 +29,7 @@ export function buildForm(questionnaire, questionnaireResponse) {
|
|
|
29
29
|
if (!questionnaireResponse) {
|
|
30
30
|
useQuestionnaireResponseStore
|
|
31
31
|
.getState()
|
|
32
|
-
.buildSourceResponse(
|
|
32
|
+
.buildSourceResponse(createEmptyQuestionnaireResponse(questionnaire));
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
useQuestionnaireResponseStore.getState().buildSourceResponse(questionnaireResponse);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,6BAA6B,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAGxB;;;;;GAKG;AACH,MAAM,UAAgB,SAAS,CAC7B,aAA4B,EAC5B,qBAA6C;;QAE7C,MAAM,qBAAqB,CAAC,QAAQ,EAAE,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAE/E,IAAI,CAAC,qBAAqB,EAAE;YAC1B,6BAA6B;iBAC1B,QAAQ,EAAE;iBACV,mBAAmB,CAAC,gCAAgC,CAAC,aAAa,CAAC,CAAC,CAAC;YACxE,OAAO;SACR;QAED,6BAA6B,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,CAAC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