@aehrc/smart-forms-renderer 0.9.3 → 0.10.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/.swcrc +11 -0
- package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js +5 -5
- package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +1 -1
- package/lib/components/FormComponents/RepeatItem/RemoveItemButton.d.ts +10 -0
- package/lib/components/FormComponents/RepeatItem/RemoveItemButton.js +30 -0
- package/lib/components/FormComponents/RepeatItem/RemoveItemButton.js.map +1 -0
- package/lib/components/FormComponents/RepeatItem/RepeatField.js +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/Tables/GroupTable.d.ts +1 -2
- package/lib/components/FormComponents/Tables/GroupTable.js +59 -63
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTableBody.d.ts +17 -0
- package/lib/components/FormComponents/Tables/GroupTableBody.js +48 -0
- package/lib/components/FormComponents/Tables/GroupTableBody.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +18 -5
- package/lib/components/FormComponents/Tables/GroupTableRow.js +17 -25
- package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTableRowCells.d.ts +10 -0
- package/lib/components/FormComponents/Tables/GroupTableRowCells.js +46 -0
- package/lib/components/FormComponents/Tables/GroupTableRowCells.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTableRows.d.ts +17 -0
- package/lib/components/FormComponents/Tables/GroupTableRows.js +45 -0
- package/lib/components/FormComponents/Tables/GroupTableRows.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTableTestRow.d.ts +22 -0
- package/lib/components/FormComponents/Tables/GroupTableTestRow.js +43 -0
- package/lib/components/FormComponents/Tables/GroupTableTestRow.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTableView.d.ts +21 -0
- package/lib/components/FormComponents/Tables/GroupTableView.js +65 -0
- package/lib/components/FormComponents/Tables/GroupTableView.js.map +1 -0
- package/lib/components/FormComponents/Tables/RemoveRowButton.d.ts +10 -0
- package/lib/components/FormComponents/Tables/RemoveRowButton.js +32 -0
- package/lib/components/FormComponents/Tables/RemoveRowButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/SelectRowButton.d.ts +7 -0
- package/lib/components/FormComponents/Tables/SelectRowButton.js +26 -0
- package/lib/components/FormComponents/Tables/SelectRowButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/Table.styles.d.ts +8 -0
- package/lib/components/FormComponents/Tables/Table.styles.js +17 -0
- package/lib/components/FormComponents/Tables/Table.styles.js.map +1 -1
- package/lib/components/Renderer/BaseRenderer.js +5 -6
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/components/Renderer/FormBodyCollapsible.js +4 -4
- package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -1
- package/lib/components/Renderer/FormBodyTabbed.js +3 -3
- package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
- package/lib/components/Tabs/CompleteTabButton.js +2 -2
- package/lib/components/Tabs/CompleteTabButton.js.map +1 -1
- package/lib/components/Tabs/FormBodySingleTab.js +2 -2
- package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
- package/lib/components/Tabs/FormBodyTabList.js +4 -4
- package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
- package/lib/hooks/useDecimalCalculatedExpression.js +2 -2
- package/lib/hooks/useDecimalCalculatedExpression.js.map +1 -1
- package/lib/hooks/useGroupTableRows.d.ts +9 -0
- package/lib/hooks/useGroupTableRows.js +26 -0
- package/lib/hooks/useGroupTableRows.js.map +1 -0
- package/lib/hooks/useHidden.js +4 -4
- package/lib/hooks/useHidden.js.map +1 -1
- package/lib/hooks/useInitialiseGroupTable.d.ts +2 -2
- package/lib/hooks/useInitialiseGroupTable.js.map +1 -1
- package/lib/hooks/useInitialiseRenderer.js +13 -15
- package/lib/hooks/useInitialiseRenderer.js.map +1 -1
- package/lib/hooks/useIntegerCalculatedExpression.js +2 -2
- package/lib/hooks/useIntegerCalculatedExpression.js.map +1 -1
- package/lib/hooks/useMinimalStringCalculatedExpression.js +25 -13
- package/lib/hooks/useStringCalculatedExpression.js +2 -2
- package/lib/hooks/useStringCalculatedExpression.js.map +1 -1
- package/lib/hooks/useTerminologyServerQuery.js +3 -4
- package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
- package/lib/hooks/useValueSetCodings.js +10 -12
- package/lib/hooks/useValueSetCodings.js.map +1 -1
- package/lib/index.js +19 -20
- package/lib/index.js.map +1 -1
- package/lib/interfaces/groupTable.interface.d.ts +1 -1
- package/lib/setup-jest.js +1 -0
- package/lib/setup-jest.js.map +1 -0
- package/lib/stores/index.d.ts +4 -3
- package/lib/stores/index.js +4 -3
- package/lib/stores/index.js.map +1 -1
- package/lib/stores/questionnaireResponseStore.d.ts +28 -0
- package/lib/stores/questionnaireResponseStore.js +64 -0
- package/lib/stores/questionnaireResponseStore.js.map +1 -0
- package/lib/stores/questionnaireStore.d.ts +65 -0
- package/lib/stores/questionnaireStore.js +172 -0
- package/lib/stores/questionnaireStore.js.map +1 -0
- package/lib/stores/selector.d.ts +1 -1
- package/lib/stores/selector.js.map +1 -1
- package/lib/stores/smartConfigStore.d.ts +25 -0
- package/lib/stores/smartConfigStore.js +30 -0
- package/lib/stores/smartConfigStore.js.map +1 -0
- package/lib/stores/terminologyServerStore.d.ts +14 -0
- package/lib/stores/terminologyServerStore.js +26 -0
- package/lib/stores/terminologyServerStore.js.map +1 -0
- package/lib/stores/useQuestionnaireResponseStore.d.ts +14 -2
- package/lib/stores/useQuestionnaireResponseStore.js +4 -2
- package/lib/stores/useQuestionnaireResponseStore.js.map +1 -1
- package/lib/stores/useQuestionnaireStore.d.ts +30 -2
- package/lib/stores/useQuestionnaireStore.js +4 -2
- package/lib/stores/useQuestionnaireStore.js.map +1 -1
- package/lib/stories/MedicalHistoryTable.stories.js +45 -0
- package/lib/stories/MedicalHistoryTable.stories.js.map +1 -0
- package/lib/stories/SmartFormsRenderer.stories.js +103 -0
- package/lib/stories/SmartFormsRenderer.stories.js.map +1 -0
- package/lib/theme/overrides/Table.d.ts +1 -0
- package/lib/theme/overrides/Table.js +2 -1
- package/lib/theme/overrides/Table.js.map +1 -1
- package/lib/utils/calculatedExpression.js +1 -2
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/groupTable.d.ts +3 -0
- package/lib/utils/groupTable.js +29 -0
- package/lib/utils/groupTable.js.map +1 -0
- package/package.json +9 -4
- package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx +5 -5
- package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +1 -1
- package/src/components/FormComponents/RepeatItem/{DeleteItemButton.tsx → RemoveItemButton.tsx} +4 -4
- package/src/components/FormComponents/RepeatItem/RepeatField.tsx +2 -2
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +2 -2
- package/src/components/FormComponents/Tables/GroupTable.tsx +71 -125
- package/src/components/FormComponents/Tables/GroupTableBody.tsx +117 -0
- package/src/components/FormComponents/Tables/GroupTableRow.tsx +89 -49
- package/src/components/FormComponents/Tables/GroupTableRowCells.tsx +84 -0
- package/src/components/FormComponents/Tables/GroupTableView.tsx +169 -0
- package/src/components/FormComponents/Tables/{DeleteRowButton.tsx → RemoveRowButton.tsx} +7 -7
- package/src/components/FormComponents/Tables/SelectRowButton.tsx +37 -0
- package/src/components/FormComponents/Tables/Table.styles.tsx +25 -0
- package/src/components/Renderer/BaseRenderer.tsx +5 -6
- package/src/components/Renderer/FormBodyCollapsible.tsx +4 -5
- package/src/components/Renderer/FormBodyTabbed.tsx +3 -3
- package/src/components/Tabs/CompleteTabButton.tsx +2 -2
- package/src/components/Tabs/FormBodySingleTab.tsx +2 -3
- package/src/components/Tabs/FormBodyTabList.tsx +4 -4
- package/src/hooks/useDecimalCalculatedExpression.ts +2 -2
- package/src/hooks/useGroupTableRows.ts +33 -0
- package/src/hooks/useHidden.ts +4 -4
- package/src/hooks/useInitialiseGroupTable.ts +3 -3
- package/src/hooks/useInitialiseRenderer.ts +19 -19
- package/src/hooks/useIntegerCalculatedExpression.ts +2 -2
- package/src/hooks/useStringCalculatedExpression.ts +2 -2
- package/src/hooks/useTerminologyServerQuery.ts +3 -4
- package/src/hooks/useValueSetCodings.ts +10 -12
- package/src/index.ts +19 -20
- package/src/interfaces/groupTable.interface.ts +1 -1
- package/src/stores/index.ts +7 -3
- package/src/stores/questionnaireResponseStore.ts +83 -0
- package/src/stores/{useQuestionnaireStore.ts → questionnaireStore.ts} +7 -6
- package/src/stores/selector.ts +2 -1
- package/src/stores/smartConfigStore.ts +45 -0
- package/src/stores/{useTerminologyServerStore.ts → terminologyServerStore.ts} +5 -4
- package/src/stories/MedicalHistoryTable.stories.tsx +57 -0
- package/src/stories/SmartFormsRenderer.stories.ts +15 -5
- package/src/stories/assets/QItems-and-QRItems/QR_GTableMedicalHistory.json +80 -0
- package/src/stories/assets/QItems-and-QRItems/Q_GTableMedicalHistory.json +109 -0
- package/src/stories/assets/Qs-and-QRs/QDev715.json +16081 -0
- package/src/theme/overrides/Table.ts +2 -1
- package/src/utils/calculatedExpression.ts +1 -2
- package/src/utils/groupTable.ts +37 -0
- package/src/stores/useQuestionnaireResponseStore.ts +0 -63
- package/src/stores/useSmartConfigStore.ts +0 -27
- /package/src/stories/assets/{Q715.json → Qs-and-QRs/Q715.json} +0 -0
- /package/src/stories/assets/{QTestGrid.json → Qs-and-QRs/QTestGrid.json} +0 -0
- /package/src/stories/assets/{R715.json → Qs-and-QRs/R715.json} +0 -0
- /package/src/stories/assets/{RTestGrid.json → Qs-and-QRs/RTestGrid.json} +0 -0
package/.swcrc
ADDED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
import React, { memo } from 'react';
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import { findNumOfVisibleTabs, getNextVisibleTabIndex } from '../../../utils/tabs';
|
|
20
|
-
import useQuestionnaireStore from '../../../stores
|
|
20
|
+
import { useQuestionnaireStore } from '../../../stores';
|
|
21
21
|
import NextTabButton from './NextTabButton';
|
|
22
22
|
const NextTabButtonWrapper = memo(function NextTabWrapper(props) {
|
|
23
23
|
const { currentTabIndex, tabs } = props;
|
|
24
|
-
const enableWhenIsActivated = useQuestionnaireStore
|
|
25
|
-
const enableWhenItems = useQuestionnaireStore
|
|
26
|
-
const enableWhenExpressions = useQuestionnaireStore
|
|
27
|
-
const switchTab = useQuestionnaireStore
|
|
24
|
+
const enableWhenIsActivated = useQuestionnaireStore.use.enableWhenIsActivated();
|
|
25
|
+
const enableWhenItems = useQuestionnaireStore.use.enableWhenItems();
|
|
26
|
+
const enableWhenExpressions = useQuestionnaireStore.use.enableWhenExpressions();
|
|
27
|
+
const switchTab = useQuestionnaireStore.use.switchTab();
|
|
28
28
|
const tabsNotDefined = currentTabIndex === undefined || tabs === undefined;
|
|
29
29
|
function handleNextTabClick() {
|
|
30
30
|
if (tabsNotDefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextTabButtonWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"NextTabButtonWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx"],"names":[],"mappings":"AAAA;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AAC;KACb;IAED,MAAM,gBAAgB,GACpB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,EAAE,eAAe,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAEjG,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,aAAa,EAAC,aAAa,EAAC,EAAE,EAAE,CAAC;QACnD,oBAAC,aAAa,IAAC,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,GAAI,CAC/E,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -21,7 +21,7 @@ import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline';
|
|
|
21
21
|
function DeleteItemButton(props) {
|
|
22
22
|
const { nullableQrItem, numOfRepeatGroups, readOnly, onDeleteItem } = props;
|
|
23
23
|
const isDisabled = nullableQrItem === null || numOfRepeatGroups === 1 || readOnly;
|
|
24
|
-
return (React.createElement(RepeatDeleteTooltip, { className: "repeat-group-delete", title: "
|
|
24
|
+
return (React.createElement(RepeatDeleteTooltip, { className: "repeat-group-delete", title: "Remove item" },
|
|
25
25
|
React.createElement("span", null,
|
|
26
26
|
React.createElement(IconButton, { size: "small", color: "error", disabled: isDisabled, onClick: onDeleteItem },
|
|
27
27
|
React.createElement(RemoveCircleOutlineIcon, null)))));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireResponseItemAnswer } from 'fhir/r4';
|
|
3
|
+
interface RemoveItemButtonProps {
|
|
4
|
+
answer: QuestionnaireResponseItemAnswer | null;
|
|
5
|
+
numOfRepeatAnswers: number;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
onDeleteAnswer: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare function RemoveItemButton(props: RemoveItemButtonProps): React.JSX.Element;
|
|
10
|
+
export default RemoveItemButton;
|
|
@@ -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 React from 'react';
|
|
18
|
+
import { RepeatDeleteTooltip } from './RepeatItem.styles';
|
|
19
|
+
import IconButton from '@mui/material/IconButton';
|
|
20
|
+
import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline';
|
|
21
|
+
function RemoveItemButton(props) {
|
|
22
|
+
const { answer, numOfRepeatAnswers, readOnly, onDeleteAnswer } = props;
|
|
23
|
+
const isDisabled = answer === null || numOfRepeatAnswers === 1 || readOnly;
|
|
24
|
+
return (React.createElement(RepeatDeleteTooltip, { className: "repeat-item-delete", title: "Remove item" },
|
|
25
|
+
React.createElement("span", null,
|
|
26
|
+
React.createElement(IconButton, { size: "small", color: "error", disabled: isDisabled, onClick: onDeleteAnswer },
|
|
27
|
+
React.createElement(RemoveCircleOutlineIcon, { fontSize: "small" })))));
|
|
28
|
+
}
|
|
29
|
+
export default RemoveItemButton;
|
|
30
|
+
//# sourceMappingURL=RemoveItemButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoveItemButton.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/RepeatItem/RemoveItemButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,uBAAuB,MAAM,yCAAyC,CAAC;AAU9E,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEvE,MAAM,UAAU,GAAG,MAAM,KAAK,IAAI,IAAI,kBAAkB,KAAK,CAAC,IAAI,QAAQ,CAAC;IAE3E,OAAO,CACL,oBAAC,mBAAmB,IAAC,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAC,aAAa;QACrE;YACE,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc;gBAClF,oBAAC,uBAAuB,IAAC,QAAQ,EAAC,OAAO,GAAG,CACjC,CACR,CACa,CACvB,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -18,7 +18,7 @@ import React from 'react';
|
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import { RepeatItemContainerStack } from './RepeatItem.styles';
|
|
20
20
|
import SingleItem from '../SingleItem/SingleItem';
|
|
21
|
-
import
|
|
21
|
+
import RemoveItemButton from './RemoveItemButton';
|
|
22
22
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
23
23
|
function RepeatField(props) {
|
|
24
24
|
var _a;
|
|
@@ -27,7 +27,7 @@ function RepeatField(props) {
|
|
|
27
27
|
return (React.createElement(RepeatItemContainerStack, { direction: "row" },
|
|
28
28
|
React.createElement(Box, { sx: { flexGrow: 1 } },
|
|
29
29
|
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false, isTabled: false, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })),
|
|
30
|
-
showMinimalView ? null : (React.createElement(
|
|
30
|
+
showMinimalView ? null : (React.createElement(RemoveItemButton, { answer: answer, numOfRepeatAnswers: numOfRepeatAnswers, readOnly: readOnly, onDeleteAnswer: onDeleteAnswer }))));
|
|
31
31
|
}
|
|
32
32
|
export default RepeatField;
|
|
33
33
|
//# sourceMappingURL=RepeatField.js.map
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React, { useCallback } from 'react';
|
|
18
|
-
import useQuestionnaireStore from '../../../stores
|
|
18
|
+
import { useQuestionnaireStore } from '../../../stores';
|
|
19
19
|
import SingleItemSwitcher from './SingleItemSwitcher';
|
|
20
20
|
import useHidden from '../../../hooks/useHidden';
|
|
21
21
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
22
22
|
function SingleItem(props) {
|
|
23
23
|
const { qItem, qrItem, isRepeated, isTabled, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
|
|
24
|
-
const updateEnableWhenItem = useQuestionnaireStore
|
|
24
|
+
const updateEnableWhenItem = useQuestionnaireStore.use.updateEnableWhenItem();
|
|
25
25
|
const handleQrItemChange = useCallback((newQrItem) => {
|
|
26
26
|
if (newQrItem.answer) {
|
|
27
27
|
updateEnableWhenItem(qItem.linkId, newQrItem.answer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAS3C,OAAO,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"SingleItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItem.tsx"],"names":[],"mappings":"A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|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
import type { PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrRepeatGroupChangeHandler, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
5
4
|
interface GroupTableProps extends PropsWithQrRepeatGroupChangeHandler, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
6
5
|
qItem: QuestionnaireItem;
|
|
7
6
|
qrItems: QuestionnaireResponseItem[];
|
|
@@ -14,33 +14,27 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import
|
|
27
|
-
import GroupTableRow from './GroupTableRow';
|
|
28
|
-
import { HeaderTableCell } from './Table.styles';
|
|
29
|
-
import { QGroupContainerBox } from '../../Box.styles';
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
import React, { useMemo } from 'react';
|
|
30
27
|
import { mapQItemsIndex } from '../../../utils/mapItem';
|
|
31
|
-
import useInitialiseGroupTable from '../../../hooks/useInitialiseGroupTable';
|
|
32
28
|
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
29
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
30
|
+
import GroupTableView from './GroupTableView';
|
|
31
|
+
import { getGroupTableItemsToUpdate } from '../../../utils/groupTable';
|
|
32
|
+
import useGroupTableRows from '../../../hooks/useGroupTableRows';
|
|
33
|
+
import { flushSync } from 'react-dom';
|
|
39
34
|
function GroupTable(props) {
|
|
40
35
|
const { qItem, qrItems, groupCardElevation, showMinimalView, parentIsReadOnly, onQrRepeatGroupChange } = props;
|
|
41
36
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
42
|
-
const
|
|
43
|
-
const [tableRows, setTableRows] = useState(initialisedGroupTables);
|
|
37
|
+
const { tableRows, selectedIds, setTableRows, setSelectedIds } = useGroupTableRows(qrItems);
|
|
44
38
|
// Generate item labels as table headers
|
|
45
39
|
const qItems = qItem.item;
|
|
46
40
|
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]);
|
|
@@ -62,66 +56,68 @@ function GroupTable(props) {
|
|
|
62
56
|
setTableRows(updatedTableRows);
|
|
63
57
|
onQrRepeatGroupChange({
|
|
64
58
|
linkId: qItem.linkId,
|
|
65
|
-
qrItems: updatedTableRows
|
|
59
|
+
qrItems: getGroupTableItemsToUpdate(updatedTableRows, selectedIds)
|
|
66
60
|
});
|
|
67
61
|
}
|
|
68
|
-
function
|
|
62
|
+
function handleRemoveRow(index) {
|
|
69
63
|
const updatedTableRows = [...tableRows];
|
|
64
|
+
const rowToRemove = updatedTableRows[index];
|
|
70
65
|
updatedTableRows.splice(index, 1);
|
|
71
66
|
setTableRows(updatedTableRows);
|
|
72
67
|
onQrRepeatGroupChange({
|
|
73
68
|
linkId: qItem.linkId,
|
|
74
|
-
qrItems: updatedTableRows
|
|
69
|
+
qrItems: getGroupTableItemsToUpdate(updatedTableRows, selectedIds)
|
|
75
70
|
});
|
|
71
|
+
setSelectedIds(selectedIds.filter((id) => id !== rowToRemove.nanoId));
|
|
76
72
|
}
|
|
77
73
|
function handleAddRow() {
|
|
74
|
+
const newRowNanoId = nanoid();
|
|
78
75
|
setTableRows([
|
|
79
76
|
...tableRows,
|
|
80
77
|
{
|
|
81
|
-
nanoId:
|
|
78
|
+
nanoId: newRowNanoId,
|
|
82
79
|
qrItem: null
|
|
83
80
|
}
|
|
84
81
|
]);
|
|
82
|
+
setSelectedIds([...selectedIds, newRowNanoId]);
|
|
85
83
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
function handleSelectAll() {
|
|
85
|
+
// deselect all if all are selected, otherwise select all
|
|
86
|
+
const updatedTableIds = selectedIds.length === tableRows.length ? [] : tableRows.map((tableRow) => tableRow.nanoId);
|
|
87
|
+
setSelectedIds(updatedTableIds);
|
|
88
|
+
onQrRepeatGroupChange({
|
|
89
|
+
linkId: qItem.linkId,
|
|
90
|
+
qrItems: getGroupTableItemsToUpdate(tableRows, updatedTableIds)
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function handleSelectRow(nanoId) {
|
|
94
|
+
const updatedSelectedIds = [...selectedIds];
|
|
95
|
+
const index = updatedSelectedIds.indexOf(nanoId);
|
|
96
|
+
if (index === -1) {
|
|
97
|
+
updatedSelectedIds.push(nanoId);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
updatedSelectedIds.splice(index, 1);
|
|
101
|
+
}
|
|
102
|
+
setSelectedIds(updatedSelectedIds);
|
|
103
|
+
onQrRepeatGroupChange({
|
|
104
|
+
linkId: qItem.linkId,
|
|
105
|
+
qrItems: getGroupTableItemsToUpdate(tableRows, updatedSelectedIds)
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function handleReorderRows(newTableRows) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
// Prevent state batching when reordering to prevent view stuttering https://react.dev/reference/react-dom/flushSync
|
|
111
|
+
flushSync(() => {
|
|
112
|
+
setTableRows(newTableRows);
|
|
113
|
+
});
|
|
114
|
+
onQrRepeatGroupChange({
|
|
115
|
+
linkId: qItem.linkId,
|
|
116
|
+
qrItems: getGroupTableItemsToUpdate(newTableRows, selectedIds)
|
|
117
|
+
});
|
|
118
|
+
});
|
|
102
119
|
}
|
|
103
|
-
return (React.createElement(
|
|
104
|
-
groupCardElevation !== 1 ? (React.createElement(React.Fragment, null,
|
|
105
|
-
React.createElement(Typography, { fontSize: 13, variant: "h6", color: readOnly ? 'text.secondary' : 'text.primary' },
|
|
106
|
-
React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
|
|
107
|
-
React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
|
|
108
|
-
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
109
|
-
React.createElement(Table, null,
|
|
110
|
-
React.createElement("caption", null,
|
|
111
|
-
React.createElement(AddRowButton, { repeatGroups: tableRows, readOnly: readOnly, onAddItem: handleAddRow })),
|
|
112
|
-
React.createElement(TableHead, null,
|
|
113
|
-
React.createElement(TableRow, null,
|
|
114
|
-
itemLabels.map((itemLabel) => (React.createElement(HeaderTableCell, { key: itemLabel }, itemLabel))),
|
|
115
|
-
React.createElement(TableCell, null))),
|
|
116
|
-
React.createElement(TableBody, null, tableRows.map(({ nanoId, qrItem: nullableQrItem }, index) => {
|
|
117
|
-
const answeredQrItem = createEmptyQrItem(qItem);
|
|
118
|
-
if (nullableQrItem) {
|
|
119
|
-
answeredQrItem.item = nullableQrItem.item;
|
|
120
|
-
}
|
|
121
|
-
return (React.createElement(TableRow, { key: nanoId },
|
|
122
|
-
React.createElement(GroupTableRow, { qItem: qItem, qrItem: answeredQrItem, qItemsIndexMap: qItemsIndexMap, parentIsReadOnly: parentIsReadOnly, onQrItemChange: (newQrGroup) => handleRowChange(newQrGroup, index) }),
|
|
123
|
-
React.createElement(DeleteRowButton, { nullableQrItem: nullableQrItem, numOfRows: tableRows.length, readOnly: readOnly, onDeleteItem: () => handleDeleteRow(index) })));
|
|
124
|
-
}))))));
|
|
120
|
+
return (React.createElement(GroupTableView, { qItem: qItem, qItemsIndexMap: qItemsIndexMap, groupCardElevation: groupCardElevation, readOnly: readOnly, tableRows: tableRows, selectedIds: selectedIds, itemLabels: itemLabels, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onAddRow: handleAddRow, onRowChange: handleRowChange, onRemoveRow: handleRemoveRow, onSelectRow: handleSelectRow, onSelectAll: handleSelectAll, onReorderRows: handleReorderRows }));
|
|
125
121
|
}
|
|
126
122
|
export default GroupTable;
|
|
127
123
|
//# sourceMappingURL=GroupTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG
|
|
1
|
+
{"version":3,"file":"GroupTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTable.tsx"],"names":[],"mappings":"AAAA;;;;;;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A0B,CAAC,YAAY,EAAE,WAAW,CAAC;aAC/D,CAAC,CAAC;QACL,CAAC;KAAA;IAED,OAAO,CACL,oBAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,eAAe,EAC5B,aAAa,EAAE,iBAAiB,GAChC,CACH,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { GroupTableRowModel } from '../../../interfaces/groupTable.interface';
|
|
4
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
5
|
+
interface GroupTableBodyProps extends PropsWithParentIsReadOnlyAttribute, PropsWithShowMinimalViewAttribute {
|
|
6
|
+
tableQItem: QuestionnaireItem;
|
|
7
|
+
readOnly: boolean;
|
|
8
|
+
tableRows: GroupTableRowModel[];
|
|
9
|
+
selectedIds: string[];
|
|
10
|
+
qItemsIndexMap: Record<string, number>;
|
|
11
|
+
onRowChange: (newQrRow: QuestionnaireResponseItem, index: number) => void;
|
|
12
|
+
onRemoveRow: (index: number) => void;
|
|
13
|
+
onSelectRow: (nanoId: string) => void;
|
|
14
|
+
onReorderRows: (newTableRows: GroupTableRowModel[]) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function GroupTableBody(props: GroupTableBodyProps): React.JSX.Element;
|
|
17
|
+
export default GroupTableBody;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { createEmptyQrItem } from '../../../utils/qrItem';
|
|
19
|
+
import GroupTableRow from './GroupTableRow';
|
|
20
|
+
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
|
21
|
+
import { reorderRows } from '../../../utils/groupTable';
|
|
22
|
+
import TableBody from '@mui/material/TableBody';
|
|
23
|
+
function GroupTableBody(props) {
|
|
24
|
+
const { tableQItem, readOnly, tableRows, selectedIds, qItemsIndexMap, showMinimalView, parentIsReadOnly, onRowChange, onRemoveRow, onSelectRow, onReorderRows } = props;
|
|
25
|
+
function onDragEnd(result) {
|
|
26
|
+
if (!result.destination) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (result.destination.index === result.source.index) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const reorderedRows = reorderRows(tableRows, result.source.index, result.destination.index);
|
|
33
|
+
onReorderRows(reorderedRows);
|
|
34
|
+
}
|
|
35
|
+
return (React.createElement(DragDropContext, { onDragEnd: onDragEnd },
|
|
36
|
+
React.createElement(Droppable, { droppableId: "gtable_rows", direction: "vertical" }, (droppableProvided, snapshot) => (React.createElement(TableBody, Object.assign({ ref: droppableProvided.innerRef }, droppableProvided.droppableProps),
|
|
37
|
+
tableRows.map(({ nanoId, qrItem: nullableQrItem }, index) => {
|
|
38
|
+
const itemIsSelected = selectedIds.indexOf(nanoId) !== -1;
|
|
39
|
+
const answeredQrItem = createEmptyQrItem(tableQItem);
|
|
40
|
+
if (nullableQrItem) {
|
|
41
|
+
answeredQrItem.item = nullableQrItem.item;
|
|
42
|
+
}
|
|
43
|
+
return (React.createElement(GroupTableRow, { key: nanoId, index: index, nanoId: nanoId, tableQItem: tableQItem, answeredQrItem: answeredQrItem, nullableQrItem: nullableQrItem, readOnly: readOnly, hoverDisabled: snapshot.isDraggingOver, tableRows: tableRows, itemIsSelected: itemIsSelected, selectedIds: selectedIds, qItemsIndexMap: qItemsIndexMap, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onRowChange: onRowChange, onRemoveRow: onRemoveRow, onSelectRow: onSelectRow }));
|
|
44
|
+
}),
|
|
45
|
+
droppableProvided.placeholder)))));
|
|
46
|
+
}
|
|
47
|
+
export default GroupTableBody;
|
|
48
|
+
//# sourceMappingURL=GroupTableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTableBody.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableBody.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAgBhD,SAAS,cAAc,CAAC,KAA0B;IA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EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,QAAQ,CAAC,cAAc,EACtC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;YACJ,CAAC,CAAC;YACD,iBAAiB,CAAC,WAAW,CACpB,CACb,CACS,CACI,CACnB,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithParentIsReadOnlyAttribute,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
import type { TableRowProps } from '@mui/material/TableRow';
|
|
5
|
+
import type { GroupTableRowModel } from '../../../interfaces/groupTable.interface';
|
|
6
|
+
interface GroupTableRowProps extends PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute, TableRowProps {
|
|
7
|
+
nanoId: string;
|
|
8
|
+
index: number;
|
|
9
|
+
tableQItem: QuestionnaireItem;
|
|
10
|
+
answeredQrItem: QuestionnaireResponseItem;
|
|
11
|
+
nullableQrItem: QuestionnaireResponseItem | null;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
hoverDisabled: boolean;
|
|
14
|
+
tableRows: GroupTableRowModel[];
|
|
15
|
+
itemIsSelected: boolean;
|
|
16
|
+
selectedIds: string[];
|
|
7
17
|
qItemsIndexMap: Record<string, number>;
|
|
18
|
+
onRowChange: (newQrRow: QuestionnaireResponseItem, index: number) => void;
|
|
19
|
+
onRemoveRow: (index: number) => void;
|
|
20
|
+
onSelectRow: (nanoId: string) => void;
|
|
8
21
|
}
|
|
9
|
-
declare function GroupTableRow(props:
|
|
22
|
+
declare function GroupTableRow(props: GroupTableRowProps): React.JSX.Element;
|
|
10
23
|
export default GroupTableRow;
|
|
@@ -15,32 +15,24 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
18
|
+
import SelectRowButton from './SelectRowButton';
|
|
19
|
+
import GroupTableRowCells from './GroupTableRowCells';
|
|
20
|
+
import RemoveRowButton from './RemoveRowButton';
|
|
21
|
+
import DragIndicator from '@mui/icons-material/DragIndicator';
|
|
22
|
+
import TableCell from '@mui/material/TableCell';
|
|
23
|
+
import Box from '@mui/material/Box';
|
|
24
|
+
import { Draggable } from 'react-beautiful-dnd';
|
|
25
|
+
import { StyledGroupTableRow } from './Table.styles';
|
|
22
26
|
function GroupTableRow(props) {
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 !== null && qrItem !== void 0 ? qrItem : null, isRepeated: true, isTabled: true, showMinimalView: true, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleQrRowItemChange })));
|
|
43
|
-
})));
|
|
27
|
+
const { nanoId, index, tableQItem, answeredQrItem, nullableQrItem, readOnly, hoverDisabled, tableRows, itemIsSelected, qItemsIndexMap, showMinimalView, parentIsReadOnly, onRowChange, onRemoveRow, onSelectRow } = props;
|
|
28
|
+
return (React.createElement(Draggable, { draggableId: nanoId, index: index }, (draggableProvided, snapshot) => (React.createElement(StyledGroupTableRow, Object.assign({ itemIsDragged: snapshot.isDragging, itemIsSelected: itemIsSelected, hoverDisabled: hoverDisabled, hover: !hoverDisabled, ref: draggableProvided.innerRef }, draggableProvided.draggableProps),
|
|
29
|
+
showMinimalView ? null : (React.createElement(React.Fragment, null,
|
|
30
|
+
React.createElement(TableCell, { padding: "checkbox" },
|
|
31
|
+
React.createElement(Box, Object.assign({ display: "flex", alignItems: "center", justifyContent: "center" }, draggableProvided.dragHandleProps),
|
|
32
|
+
React.createElement(DragIndicator, { fontSize: "small" }))),
|
|
33
|
+
React.createElement(SelectRowButton, { isSelected: itemIsSelected, onSelectItem: () => onSelectRow(nanoId) }))),
|
|
34
|
+
React.createElement(GroupTableRowCells, { qItem: tableQItem, qrItem: answeredQrItem, qItemsIndexMap: qItemsIndexMap, parentIsReadOnly: parentIsReadOnly, onQrItemChange: (newQrGroup) => onRowChange(newQrGroup, index) }),
|
|
35
|
+
showMinimalView ? null : (React.createElement(RemoveRowButton, { nullableQrItem: nullableQrItem, numOfRows: tableRows.length, readOnly: readOnly, onRemoveItem: () => onRemoveRow(index) }))))));
|
|
44
36
|
}
|
|
45
37
|
export default GroupTableRow;
|
|
46
38
|
//# sourceMappingURL=GroupTableRow.js.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"GroupTableRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAC9D,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAsBrD,SAAS,aAAa,CAAC,KAAyB;IAC9C,MAAM,EACJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,WAAW,EACZ,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,oBAAC,SAAS,IAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IACzC,CAAC,iBAAiB,EAAE,QAAQ,EAAE,EAAE,CAAC,CAChC,oBAAC,mBAAmB,kBAClB,aAAa,EAAE,QAAQ,CAAC,UAAU,EAClC,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,CAAC,aAAa,EACrB,GAAG,EAAE,iBAAiB,CAAC,QAAQ,IAC3B,iBAAiB,CAAC,cAAc;QACnC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB;YACE,oBAAC,SAAS,IAAC,OAAO,EAAC,UAAU;gBAC3B,oBAAC,GAAG,kBACF,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,IACnB,iBAAiB,CAAC,eAAe;oBACrC,oBAAC,aAAa,IAAC,QAAQ,EAAC,OAAO,GAAG,CAC9B,CACI;YACZ,oBAAC,eAAe,IACd,UAAU,EAAE,cAAc,EAC1B,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,GACvC,CACD,CACJ;QACD,oBAAC,kBAAkB,IACjB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,GAC9D;QACD,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,oBAAC,eAAe,IACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,CAAC,MAAM,EAC3B,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,GACtC,CACH,CACmB,CACvB,CACS,CACb,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface GroupTableRowCellsProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
+
qItem: QuestionnaireItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
|
+
qItemsIndexMap: Record<string, number>;
|
|
8
|
+
}
|
|
9
|
+
declare function GroupTableRowCells(props: GroupTableRowCellsProps): React.JSX.Element | null;
|
|
10
|
+
export default GroupTableRowCells;
|
|
@@ -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 { createEmptyQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
|
|
19
|
+
import SingleItem from '../SingleItem/SingleItem';
|
|
20
|
+
import { getQrItemsIndex } from '../../../utils/mapItem';
|
|
21
|
+
import { StandardTableCell } from './Table.styles';
|
|
22
|
+
function GroupTableRowCells(props) {
|
|
23
|
+
const { qItem, qrItem, qItemsIndexMap, parentIsReadOnly, onQrItemChange } = props;
|
|
24
|
+
const rowItems = qItem.item;
|
|
25
|
+
const row = qrItem && qrItem.item ? qrItem : createEmptyQrGroup(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 !== null && qrItem !== void 0 ? qrItem : null, isRepeated: true, isTabled: true, showMinimalView: true, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleQrRowItemChange })));
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
export default GroupTableRowCells;
|
|
46
|
+
//# sourceMappingURL=GroupTableRowCells.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTableRowCells.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableRowCells.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAcnD,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAElF,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC;IAC5B,MAAM,GAAG,GAAG,MAAM,IAAI,MAA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