@aehrc/smart-forms-renderer 0.9.2 → 0.10.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/.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 +44 -59
- 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 +11 -0
- package/lib/components/FormComponents/Tables/GroupTableRowCells.js +57 -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/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 +11 -14
- 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/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 +49 -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 +10 -5
- 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 -120
- package/src/components/FormComponents/Tables/GroupTableBody.tsx +116 -0
- package/src/components/FormComponents/Tables/GroupTableRow.tsx +89 -49
- package/src/components/FormComponents/Tables/GroupTableRowCells.tsx +87 -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/useHidden.ts +4 -4
- package/src/hooks/useInitialiseGroupTable.ts +3 -3
- package/src/hooks/useInitialiseRenderer.ts +17 -18
- 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/smartConfigStore.ts +45 -0
- package/src/stores/{useTerminologyServerStore.ts → terminologyServerStore.ts} +5 -4
- package/src/stories/MedicalHistoryTable.stories.tsx +61 -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
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
function GroupTableRows(props) {
|
|
23
|
+
const { tableQItem, readOnly, tableRows, selectedIds, qItemsIndexMap, showMinimalView, parentIsReadOnly, onRowChange, onRemoveRow, onSelectRow, onReorderRows } = props;
|
|
24
|
+
function onDragEnd(result) {
|
|
25
|
+
if (!result.destination) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (result.destination.index === result.source.index) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const reorderedRows = reorderRows(tableRows, result.source.index, result.destination.index);
|
|
32
|
+
onReorderRows(reorderedRows);
|
|
33
|
+
}
|
|
34
|
+
return (React.createElement(DragDropContext, { onDragEnd: onDragEnd },
|
|
35
|
+
React.createElement(Droppable, { droppableId: "list" }, tableRows.map(({ nanoId, qrItem: nullableQrItem }, index) => {
|
|
36
|
+
const itemIsSelected = selectedIds.indexOf(nanoId) !== -1;
|
|
37
|
+
const answeredQrItem = createEmptyQrItem(tableQItem);
|
|
38
|
+
if (nullableQrItem) {
|
|
39
|
+
answeredQrItem.item = nullableQrItem.item;
|
|
40
|
+
}
|
|
41
|
+
return (React.createElement(GroupTableRow, { key: nanoId, index: index, nanoId: nanoId, tableQItem: tableQItem, answeredQrItem: answeredQrItem, nullableQrItem: nullableQrItem, readOnly: readOnly, tableRows: tableRows, itemIsSelected: itemIsSelected, selectedIds: selectedIds, qItemsIndexMap: qItemsIndexMap, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onRowChange: onRowChange, onRemoveRow: onRemoveRow, onSelectRow: onSelectRow }));
|
|
42
|
+
}))));
|
|
43
|
+
}
|
|
44
|
+
export default GroupTableRows;
|
|
45
|
+
//# sourceMappingURL=GroupTableRows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTableRows.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableRows.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;AAC5C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAgBxD,SAAS,cAAc,CAAC,KAA0B;IAChD,MAAM,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACd,GAAG,KAAK,CAAC;IAEV,SAAS,SAAS,CAAC,MAAkB;QACnC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;YACvB,OAAO;SACR;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;YACpD,OAAO;SACR;QAED,MAAM,aAAa,GAAG,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE5F,aAAa,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CACL,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS;QACnC,oBAAC,SAAS,IAAC,WAAW,EAAC,MAAM,IAC1B,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,EAAE;YAC3D,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1D,MAAM,cAAc,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;YACrD,IAAI,cAAc,EAAE;gBAClB,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;aAC3C;YAED,OAAO,CACL,oBAAC,aAAa,IACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,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;QACJ,CAAC,CAAC,CACQ,CACI,CACnB,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
import { TableRowProps } from '@mui/material/TableRow';
|
|
5
|
+
import { GroupTableRowModel } from '../../../interfaces/groupTable.interface';
|
|
6
|
+
interface GroupTableTestRowProps extends PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute, TableRowProps {
|
|
7
|
+
nanoId: string;
|
|
8
|
+
index: number;
|
|
9
|
+
tableQItem: QuestionnaireItem;
|
|
10
|
+
answeredQrItem: QuestionnaireResponseItem;
|
|
11
|
+
nullableQrItem: QuestionnaireResponseItem | null;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
tableRows: GroupTableRowModel[];
|
|
14
|
+
itemIsSelected: boolean;
|
|
15
|
+
selectedIds: string[];
|
|
16
|
+
qItemsIndexMap: Record<string, number>;
|
|
17
|
+
onRowChange: (newQrRow: QuestionnaireResponseItem, index: number) => void;
|
|
18
|
+
onRemoveRow: (index: number) => void;
|
|
19
|
+
onSelectRow: (nanoId: string) => void;
|
|
20
|
+
}
|
|
21
|
+
declare function GroupTableTestRow(props: GroupTableTestRowProps): React.JSX.Element;
|
|
22
|
+
export default GroupTableTestRow;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 TableRow from '@mui/material/TableRow';
|
|
19
|
+
import { alpha } from '@mui/material/styles';
|
|
20
|
+
import SelectRowButton from './SelectRowButton';
|
|
21
|
+
import GroupTableRow from './GroupTableRow';
|
|
22
|
+
import RemoveRowButton from './RemoveRowButton';
|
|
23
|
+
import { useDrag } from 'react-dnd';
|
|
24
|
+
function GroupTableTestRow(props) {
|
|
25
|
+
const { nanoId, index, tableQItem, answeredQrItem, nullableQrItem, readOnly, tableRows, itemIsSelected, qItemsIndexMap, showMinimalView, parentIsReadOnly, onRowChange, onRemoveRow, onSelectRow } = props;
|
|
26
|
+
const [{ isDragging }, drag, dragPreview] = useDrag(() => ({
|
|
27
|
+
// "type" is required. It is used by the "accept" specification of drop targets.
|
|
28
|
+
type: 'ROW',
|
|
29
|
+
// The collect function utilizes a "monitor" instance (see the Overview for what this is)
|
|
30
|
+
// to pull important pieces of state from the DnD system.
|
|
31
|
+
collect: (monitor) => ({
|
|
32
|
+
isDragging: monitor.isDragging()
|
|
33
|
+
})
|
|
34
|
+
}));
|
|
35
|
+
return (React.createElement(TableRow, { ref: drag, sx: {
|
|
36
|
+
bgcolor: itemIsSelected ? alpha('#C7DBFF', 0.25) : 'common.white'
|
|
37
|
+
} },
|
|
38
|
+
showMinimalView ? null : (React.createElement(SelectRowButton, { isSelected: itemIsSelected, onSelectItem: () => onSelectRow(nanoId) })),
|
|
39
|
+
React.createElement(GroupTableRow, { qItem: tableQItem, qrItem: answeredQrItem, qItemsIndexMap: qItemsIndexMap, parentIsReadOnly: parentIsReadOnly, onQrItemChange: (newQrGroup) => onRowChange(newQrGroup, index) }),
|
|
40
|
+
showMinimalView ? null : (React.createElement(RemoveRowButton, { nullableQrItem: nullableQrItem, numOfRows: tableRows.length, readOnly: readOnly, onRemoveItem: () => onRemoveRow(index) }))));
|
|
41
|
+
}
|
|
42
|
+
export default GroupTableTestRow;
|
|
43
|
+
//# sourceMappingURL=GroupTableTestRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTableTestRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/Group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F;QACD,oBAAC,aAAa,IACZ,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,CACQ,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import { PropsWithParentIsReadOnlyAttribute, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
import { GroupTableRowModel } from '../../../interfaces/groupTable.interface';
|
|
5
|
+
interface GroupTableViewProps extends PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
6
|
+
qItem: QuestionnaireItem;
|
|
7
|
+
qItemsIndexMap: Record<string, number>;
|
|
8
|
+
groupCardElevation: number;
|
|
9
|
+
readOnly: boolean;
|
|
10
|
+
tableRows: GroupTableRowModel[];
|
|
11
|
+
selectedIds: string[];
|
|
12
|
+
itemLabels: string[];
|
|
13
|
+
onAddRow: () => void;
|
|
14
|
+
onRowChange: (newQrRow: QuestionnaireResponseItem, index: number) => void;
|
|
15
|
+
onRemoveRow: (index: number) => void;
|
|
16
|
+
onSelectRow: (nanoId: string) => void;
|
|
17
|
+
onSelectAll: () => void;
|
|
18
|
+
onReorderRows: (newTableRows: GroupTableRowModel[]) => void;
|
|
19
|
+
}
|
|
20
|
+
declare function GroupTableView(props: GroupTableViewProps): React.JSX.Element;
|
|
21
|
+
export default GroupTableView;
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { QGroupContainerBox } from '../../Box.styles';
|
|
19
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
20
|
+
import Paper from '@mui/material/Paper';
|
|
21
|
+
import Table from '@mui/material/Table';
|
|
22
|
+
import TableHead from '@mui/material/TableHead';
|
|
23
|
+
import TableRow from '@mui/material/TableRow';
|
|
24
|
+
import { HeaderTableCell } from './Table.styles';
|
|
25
|
+
import TableCell from '@mui/material/TableCell';
|
|
26
|
+
import TableBody from '@mui/material/TableBody';
|
|
27
|
+
import Typography from '@mui/material/Typography';
|
|
28
|
+
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
29
|
+
import Divider from '@mui/material/Divider';
|
|
30
|
+
import AddRowButton from './AddRowButton';
|
|
31
|
+
import GroupTableBody from './GroupTableBody';
|
|
32
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
33
|
+
function GroupTableView(props) {
|
|
34
|
+
const { qItem, qItemsIndexMap, groupCardElevation, readOnly, tableRows, selectedIds, itemLabels, showMinimalView, parentIsReadOnly, onAddRow, onRowChange, onRemoveRow, onSelectRow, onSelectAll, onReorderRows } = props;
|
|
35
|
+
if (showMinimalView) {
|
|
36
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 1 },
|
|
37
|
+
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
38
|
+
React.createElement(Table, { size: "small" },
|
|
39
|
+
React.createElement(TableHead, null,
|
|
40
|
+
React.createElement(TableRow, null,
|
|
41
|
+
itemLabels.map((itemLabel) => (React.createElement(HeaderTableCell, { key: itemLabel, size: "medium" }, itemLabel))),
|
|
42
|
+
React.createElement(TableCell, null))),
|
|
43
|
+
React.createElement(TableBody, null,
|
|
44
|
+
React.createElement(GroupTableBody, { tableQItem: qItem, readOnly: readOnly, tableRows: tableRows, selectedIds: selectedIds, qItemsIndexMap: qItemsIndexMap, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onRowChange: onRowChange, onRemoveRow: onRemoveRow, onSelectRow: onSelectRow, onReorderRows: onReorderRows }))))));
|
|
45
|
+
}
|
|
46
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
|
|
47
|
+
groupCardElevation !== 1 ? (React.createElement(React.Fragment, null,
|
|
48
|
+
React.createElement(Typography, { fontSize: 13, variant: "h6", color: readOnly ? 'text.secondary' : 'text.primary' },
|
|
49
|
+
React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
|
|
50
|
+
React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
|
|
51
|
+
React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
|
|
52
|
+
React.createElement(Table, null,
|
|
53
|
+
React.createElement("caption", null,
|
|
54
|
+
React.createElement(AddRowButton, { repeatGroups: tableRows, readOnly: readOnly, onAddItem: onAddRow })),
|
|
55
|
+
React.createElement(TableHead, null,
|
|
56
|
+
React.createElement(TableRow, null,
|
|
57
|
+
React.createElement(HeaderTableCell, { padding: "checkbox" }),
|
|
58
|
+
React.createElement(HeaderTableCell, { padding: "checkbox" },
|
|
59
|
+
React.createElement(Checkbox, { color: "primary", size: "small", indeterminate: selectedIds.length > 0 && selectedIds.length < tableRows.length, checked: tableRows.length > 0 && selectedIds.length === tableRows.length, onChange: onSelectAll })),
|
|
60
|
+
itemLabels.map((itemLabel) => (React.createElement(HeaderTableCell, { key: itemLabel }, itemLabel))),
|
|
61
|
+
React.createElement(TableCell, null))),
|
|
62
|
+
React.createElement(GroupTableBody, { tableQItem: qItem, readOnly: readOnly, tableRows: tableRows, selectedIds: selectedIds, qItemsIndexMap: qItemsIndexMap, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onRowChange: onRowChange, onRemoveRow: onRemoveRow, onSelectRow: onSelectRow, onReorderRows: onReorderRows })))));
|
|
63
|
+
}
|
|
64
|
+
export default GroupTableView;
|
|
65
|
+
//# sourceMappingURL=GroupTableView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupTableView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/GroupTableView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD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,EAAE,CAAC,CAC7B,oBAAC,eAAe,IAAC,GAAG,EAAE,SAAS,IAAG,SAAS,CAAmB,CAC/D,CAAC;wBACF,oBAAC,SAAS,OAAG,CACJ,CACD;gBACZ,oBAAC,cAAc,IACb,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,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,EACxB,aAAa,EAAE,aAAa,GAC5B,CACI,CACO,CACE,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
interface RemoveRowButtonProps {
|
|
4
|
+
nullableQrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
numOfRows: number;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
onRemoveItem: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare function RemoveRowButton(props: RemoveRowButtonProps): React.JSX.Element;
|
|
10
|
+
export default RemoveRowButton;
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { DeleteButtonTableCell } from './Table.styles';
|
|
19
|
+
import IconButton from '@mui/material/IconButton';
|
|
20
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
21
|
+
import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline';
|
|
22
|
+
function RemoveRowButton(props) {
|
|
23
|
+
const { nullableQrItem, numOfRows, readOnly, onRemoveItem } = props;
|
|
24
|
+
const isDisabled = nullableQrItem === null || numOfRows === 1 || readOnly;
|
|
25
|
+
return (React.createElement(DeleteButtonTableCell, null,
|
|
26
|
+
React.createElement(Tooltip, { title: "Remove item" },
|
|
27
|
+
React.createElement("span", null,
|
|
28
|
+
React.createElement(IconButton, { size: "small", color: "error", disabled: isDisabled, onClick: onRemoveItem },
|
|
29
|
+
React.createElement(RemoveCircleOutlineIcon, { fontSize: "small" }))))));
|
|
30
|
+
}
|
|
31
|
+
export default RemoveRowButton;
|
|
32
|
+
//# sourceMappingURL=RemoveRowButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoveRowButton.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/RemoveRowButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,OAAO,uBAAuB,MAAM,yCAAyC,CAAC;AAU9E,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAEpE,MAAM,UAAU,GAAG,cAAc,KAAK,IAAI,IAAI,SAAS,KAAK,CAAC,IAAI,QAAQ,CAAC;IAC1E,OAAO,CACL,oBAAC,qBAAqB;QACpB,oBAAC,OAAO,IAAC,KAAK,EAAC,aAAa;YAC1B;gBACE,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY;oBAChF,oBAAC,uBAAuB,IAAC,QAAQ,EAAC,OAAO,GAAG,CACjC,CACR,CACC,CACY,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
19
|
+
import TableCell from '@mui/material/TableCell';
|
|
20
|
+
function SelectRowButton(props) {
|
|
21
|
+
const { isSelected, onSelectItem } = props;
|
|
22
|
+
return (React.createElement(TableCell, { padding: "checkbox" },
|
|
23
|
+
React.createElement(Checkbox, { color: "primary", size: "small", checked: isSelected, onChange: onSelectItem })));
|
|
24
|
+
}
|
|
25
|
+
export default SelectRowButton;
|
|
26
|
+
//# sourceMappingURL=SelectRowButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectRowButton.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/SelectRowButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAOhD,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE3C,OAAO,CACL,oBAAC,SAAS,IAAC,OAAO,EAAC,UAAU;QAC3B,oBAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,GAAI,CAC5E,CACb,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const HeaderTableCell: import("@emotion/styled").StyledComponent<import("@mui/material/TableCell").TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
2
3
|
export declare const StandardTableCell: import("@emotion/styled").StyledComponent<import("@mui/material/TableCell").TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
3
4
|
numOfColumns: number;
|
|
@@ -8,3 +9,10 @@ export declare const GridTextTableCell: import("@emotion/styled").StyledComponen
|
|
|
8
9
|
export declare const GridAnswerTableCell: import("@emotion/styled").StyledComponent<import("@mui/material/TableCell").TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
9
10
|
numOfColumns: number;
|
|
10
11
|
}, {}, {}>;
|
|
12
|
+
export declare const StyledGroupTableRow: import("@emotion/styled").StyledComponent<import("@mui/material/TableRow").TableRowOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
|
|
13
|
+
ref?: ((instance: HTMLTableRowElement | null) => void) | import("react").RefObject<HTMLTableRowElement> | null | undefined;
|
|
14
|
+
}, "hover" | "selected" | "style" | "children" | "className" | "sx" | "classes"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
15
|
+
itemIsDragged: boolean;
|
|
16
|
+
itemIsSelected: boolean;
|
|
17
|
+
hoverDisabled: boolean;
|
|
18
|
+
}, {}, {}>;
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import TableCell from '@mui/material/TableCell';
|
|
19
|
+
import TableRow from '@mui/material/TableRow';
|
|
20
|
+
import { grey } from '@mui/material/colors';
|
|
19
21
|
export const HeaderTableCell = styled(TableCell)(() => ({
|
|
20
22
|
fontSize: 13,
|
|
21
23
|
lineHeight: 'normal'
|
|
@@ -44,4 +46,19 @@ export const GridAnswerTableCell = styled(TableCell, {
|
|
|
44
46
|
paddingLeft: 5,
|
|
45
47
|
paddingRight: 5
|
|
46
48
|
}));
|
|
49
|
+
export const StyledGroupTableRow = styled(TableRow, {
|
|
50
|
+
shouldForwardProp: (prop) => prop !== 'itemIsDragged' && prop !== 'itemIsSelected' && prop !== 'hoverDisabled'
|
|
51
|
+
})(({ theme, itemIsDragged, itemIsSelected, hoverDisabled }) => (Object.assign(Object.assign({ backgroundColor: itemIsSelected ? '#f4f8ff' : '#fff' }, (hoverDisabled
|
|
52
|
+
? {}
|
|
53
|
+
: {
|
|
54
|
+
'&.MuiTableRow-root:hover': {
|
|
55
|
+
backgroundColor: itemIsSelected ? '#e9f1ff' : grey['50']
|
|
56
|
+
}
|
|
57
|
+
})), (itemIsDragged
|
|
58
|
+
? {
|
|
59
|
+
boxShadow: theme.customShadows.z8,
|
|
60
|
+
opacity: 1,
|
|
61
|
+
backgroundColor: itemIsSelected ? '#edf4ff' : '#fafafa'
|
|
62
|
+
}
|
|
63
|
+
: {}))));
|
|
47
64
|
//# sourceMappingURL=Table.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/Table.styles.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,SAAS,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Table.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/Tables/Table.styles.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACtD,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,EAAE;IACjD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,SAAS;CAC3E,CAAC,CAA6C,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,KAAK,EAAE,GAAG,GAAG,GAAG,YAAY,GAAG;IAC/B,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CA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,CAAC,CAAC;QACE,0BAA0B,EAAE;YAC1B,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;SACzD;KACF,CAAC,GACH,CAAC,aAAa;IACf,CAAC,CAAC;QACE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE;QACjC,OAAO,EAAE,CAAC;QACV,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;KACxD;IACH,CAAC,CAAC,EAAE,CAAC,EACP,CACH,CAAC"}
|
|
@@ -18,17 +18,16 @@ import React, { useMemo } from 'react';
|
|
|
18
18
|
import Container from '@mui/material/Container';
|
|
19
19
|
import Fade from '@mui/material/Fade';
|
|
20
20
|
import FormTopLevelItem from './FormTopLevelItem';
|
|
21
|
-
import useQuestionnaireStore from '../../stores
|
|
22
|
-
import useQuestionnaireResponseStore from '../../stores/useQuestionnaireResponseStore';
|
|
21
|
+
import { useQuestionnaireResponseStore, useQuestionnaireStore } from '../../stores';
|
|
23
22
|
import cloneDeep from 'lodash.clonedeep';
|
|
24
23
|
import { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
|
|
25
24
|
import { updateQrItemsInGroup } from '../../utils/qrItem';
|
|
26
25
|
function BaseRenderer() {
|
|
27
26
|
var _a;
|
|
28
|
-
const sourceQuestionnaire = useQuestionnaireStore
|
|
29
|
-
const updateExpressions = useQuestionnaireStore
|
|
30
|
-
const updatableResponse = useQuestionnaireResponseStore
|
|
31
|
-
const updateResponse = useQuestionnaireResponseStore
|
|
27
|
+
const sourceQuestionnaire = useQuestionnaireStore.use.sourceQuestionnaire();
|
|
28
|
+
const updateExpressions = useQuestionnaireStore.use.updateExpressions();
|
|
29
|
+
const updatableResponse = useQuestionnaireResponseStore.use.updatableResponse();
|
|
30
|
+
const updateResponse = useQuestionnaireResponseStore.use.updateResponse();
|
|
32
31
|
const qItemsIndexMap = useMemo(() => mapQItemsIndex(sourceQuestionnaire), [sourceQuestionnaire]);
|
|
33
32
|
function handleTopLevelQRItemSingleChange(newTopLevelQRItem) {
|
|
34
33
|
const updatedResponse = cloneDeep(updatableResponse);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseRenderer.js","sourceRoot":"","sources":["../../../src/components/Renderer/BaseRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,
|
|
1
|
+
{"version":3,"file":"BaseRenderer.js","sourceRoot":"","sources":["../../../src/components/Renderer/BaseRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,SAAS,YAAY;;IACnB,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;IAC5E,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;IACxE,MAAM,iBAAiB,GAAG,6BAA6B,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAChF,MA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,IAAI,IAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG;QAC1B,oBAAC,SAAS,IAAC,QAAQ,EAAC,IAAI,IACrB,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACnC,MAAM,aAAa,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAEpD,OAAO,CACL,oBAAC,gBAAgB,IACf,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,aAAa,EAAE,KAAK,EACpB,qBAAqB,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,IAAI,EAC5C,cAAc,EAAE,CAAC,iBAAiB,EAAE,EAAE,CACpC,gCAAgC,CAAC,iBAAiB,CAAC,EAErD,qBAAqB,EAAE,CAAC,kBAAkB,EAAE,EAAE,CAC5C,kCAAkC,CAAC,kBAAkB,CAAC,GAExD,CACH,CAAC;QACJ,CAAC,CAAC,CACQ,CACP,CACR,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -18,13 +18,13 @@ import React, { useMemo } from 'react';
|
|
|
18
18
|
import Stack from '@mui/material/Stack';
|
|
19
19
|
import { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
|
|
20
20
|
import { createEmptyQrGroup, updateQrItemsInGroup } from '../../utils/qrItem';
|
|
21
|
-
import useQuestionnaireStore from '../../stores
|
|
21
|
+
import { useQuestionnaireStore } from '../../stores';
|
|
22
22
|
import FormBodySingleCollapsibleWrapper from './FormBodySingleCollapsibleWrapper';
|
|
23
23
|
function FormBodyCollapsibleWrapper(props) {
|
|
24
24
|
const { topLevelQItem, topLevelQRItem, onQrItemChange } = props;
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const switchTab = useQuestionnaireStore
|
|
25
|
+
const tabs = useQuestionnaireStore.use.tabs();
|
|
26
|
+
const currentTab = useQuestionnaireStore.use.currentTabIndex();
|
|
27
|
+
const switchTab = useQuestionnaireStore.use.switchTab();
|
|
28
28
|
const indexMap = useMemo(() => mapQItemsIndex(topLevelQItem), [topLevelQItem]);
|
|
29
29
|
const nonNullTopLevelQRItem = topLevelQRItem !== null && topLevelQRItem !== void 0 ? topLevelQRItem : createEmptyQrGroup(topLevelQItem);
|
|
30
30
|
const qItems = topLevelQItem.item;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodyCollapsible.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyCollapsible.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"FormBodyCollapsible.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyCollapsible.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAOlF,SAAS,0BAA0B,CAAC,KAA+B;IACjE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEhE,MAAM,IAAI,GAAG,qBAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;I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AM,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnC,IAAI,CAAC,KAAK,IAAI,CAAC,gBAAgB,EAAE;YAC/B,oCAAoC;YACpC,OAAO,IAAI,CAAC;SACb;QAED,OAAO,CACL,oBAAC,gCAAgC,IAC/B,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,KAAK,EAAE,CAAC,EACR,aAAa,EAAE,UAAU,EACzB,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,mBAAmB,GACnC,CACH,CAAC;IACJ,CAAC,CAAC,CACI,CACT,CAAC;AACJ,CAAC;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -22,11 +22,11 @@ import { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
|
|
|
22
22
|
import GroupItem from '../FormComponents/GroupItem/GroupItem';
|
|
23
23
|
import { createEmptyQrGroup, updateQrItemsInGroup } from '../../utils/qrItem';
|
|
24
24
|
import FormBodyTabListWrapper from '../Tabs/FormBodyTabListWrapper';
|
|
25
|
-
import useQuestionnaireStore from '../../stores
|
|
25
|
+
import { useQuestionnaireStore } from '../../stores';
|
|
26
26
|
function FormBodyTabbed(props) {
|
|
27
27
|
const { topLevelQItem, topLevelQRItem, onQrItemChange } = props;
|
|
28
|
-
const tabs = useQuestionnaireStore
|
|
29
|
-
const currentTab = useQuestionnaireStore
|
|
28
|
+
const tabs = useQuestionnaireStore.use.tabs();
|
|
29
|
+
const currentTab = useQuestionnaireStore.use.currentTabIndex();
|
|
30
30
|
const indexMap = useMemo(() => mapQItemsIndex(topLevelQItem), [topLevelQItem]);
|
|
31
31
|
const nonNullTopLevelQRItem = topLevelQRItem !== null && topLevelQRItem !== void 0 ? topLevelQRItem : createEmptyQrGroup(topLevelQItem);
|
|
32
32
|
const qItems = topLevelQItem.item;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodyTabbed.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyTabbed.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AAEpE,OAAO,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"FormBodyTabbed.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyTabbed.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAOrD,SAAS,cAAc,CAAC,KAA0B;IAChD,MAAM,EAAE,aAAa,EAAE,cAAc,EA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|
19
19
|
import Tooltip from '@mui/material/Tooltip';
|
|
20
20
|
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
21
|
-
import useQuestionnaireStore from '../../stores
|
|
21
|
+
import { useQuestionnaireStore } from '../../stores';
|
|
22
22
|
const CompleteTabButton = memo(function CompleteTabButton(props) {
|
|
23
23
|
const { tabLinkId, tabIsMarkedAsComplete } = props;
|
|
24
|
-
const markTabAsComplete = useQuestionnaireStore
|
|
24
|
+
const markTabAsComplete = useQuestionnaireStore.use.markTabAsComplete();
|
|
25
25
|
return (React.createElement(Tooltip, { title: tabIsMarkedAsComplete ? 'Mark as incomplete' : 'Complete tab' },
|
|
26
26
|
React.createElement(IconButton, { onClick: () => markTabAsComplete(tabLinkId) },
|
|
27
27
|
React.createElement(CheckCircleIcon, { color: tabIsMarkedAsComplete ? 'success' : 'inherit' }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompleteTabButton.js","sourceRoot":"","sources":["../../../src/components/Tabs/CompleteTabButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"CompleteTabButton.js","sourceRoot":"","sources":["../../../src/components/Tabs/CompleteTabButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAOrD,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,iBAAiB,CAAC,KAA6B;IACrF,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAEnD,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAExE,OAAO,CACL,oBAAC,OAAO,IAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,cAAc;QAC3E,oBAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;YACrD,oBAAC,eAAe,IAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAI,CAC9D,CACL,CACX,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -19,11 +19,11 @@ import Box from '@mui/material/Box';
|
|
|
19
19
|
import ListItemButton from '@mui/material/ListItemButton';
|
|
20
20
|
import ListItemText from '@mui/material/ListItemText';
|
|
21
21
|
import Typography from '@mui/material/Typography';
|
|
22
|
-
import useQuestionnaireStore from '../../stores
|
|
22
|
+
import { useQuestionnaireStore } from '../../stores';
|
|
23
23
|
import ContextDisplayItem from '../FormComponents/ItemParts/ContextDisplayItem';
|
|
24
24
|
const FormBodySingleTab = memo(function FormBodySingleTab(props) {
|
|
25
25
|
const { contextDisplayItems, selected, tabLabel, listIndex } = props;
|
|
26
|
-
const switchTab = useQuestionnaireStore
|
|
26
|
+
const switchTab = useQuestionnaireStore.use.switchTab();
|
|
27
27
|
function handleTabClick() {
|
|
28
28
|
switchTab(listIndex);
|
|
29
29
|
window.scrollTo(0, 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodySingleTab.js","sourceRoot":"","sources":["../../../src/components/Tabs/FormBodySingleTab.tsx"],"names":[],"mappings":"AA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,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe;oBACpE,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,IAAE,QAAQ,CAAc;oBACvD,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IACnD,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBAChC,OAAO,oBAAC,kBAAkB,IAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,GAAI,CAAC;oBACrE,CAAC,CAAC,CACE,CACF,GAER,CACa,CAChB,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -19,13 +19,13 @@ 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
|
-
import useQuestionnaireStore from '../../stores
|
|
22
|
+
import { useQuestionnaireStore } from '../../stores';
|
|
23
23
|
import { isTabHidden } from '../../utils/tabs';
|
|
24
24
|
const FormBodyTabList = memo(function FormBodyTabList(props) {
|
|
25
25
|
const { topLevelItems, currentTabIndex, tabs, completedTabsCollapsed, allContextDisplayItems } = props;
|
|
26
|
-
const enableWhenIsActivated = useQuestionnaireStore
|
|
27
|
-
const enableWhenItems = useQuestionnaireStore
|
|
28
|
-
const enableWhenExpressions = useQuestionnaireStore
|
|
26
|
+
const enableWhenIsActivated = useQuestionnaireStore.use.enableWhenIsActivated();
|
|
27
|
+
const enableWhenItems = useQuestionnaireStore.use.enableWhenItems();
|
|
28
|
+
const enableWhenExpressions = useQuestionnaireStore.use.enableWhenExpressions();
|
|
29
29
|
return (React.createElement(TransitionGroup, null, topLevelItems.map((qItem, i) => {
|
|
30
30
|
var _a, _b;
|
|
31
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,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,
|
|
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,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,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,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAChF,MAAM,eAAe,GAAG,qBAAqB,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC;IACpE,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAEhF,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"}
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { useEffect, useState } from 'react';
|
|
18
18
|
import { createEmptyQrItem } from '../utils/qrItem';
|
|
19
|
-
import useQuestionnaireStore from '../stores
|
|
19
|
+
import { useQuestionnaireStore } from '../stores';
|
|
20
20
|
function useDecimalCalculatedExpression(props) {
|
|
21
21
|
const { qItem, inputValue, precision, setInputValue, onQrItemChange } = props;
|
|
22
|
-
const calculatedExpressions = useQuestionnaireStore
|
|
22
|
+
const calculatedExpressions = useQuestionnaireStore.use.calculatedExpressions();
|
|
23
23
|
const [calcExpUpdated, setCalcExpUpdated] = useState(false);
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
const calcExpression = calculatedExpressions[qItem.linkId];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDecimalCalculatedExpression.js","sourceRoot":"","sources":["../../src/hooks/useDecimalCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"useDecimalCalculatedExpression.js","sourceRoot":"","sources":["../../src/hooks/useDecimalCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAclD,SAAS,8BAA8B,CACrC,KAA0C;IAE1C,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE9E,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAEhF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,SAAS,CACP,GAAG,EAAE;QACH,MAAM,cAAc,GAAG,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE3D,kEAAkE;QAClE,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,MAAK,UAAU,IAAI,OAAO,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,CAAA,KAAK,QAAQ,EAAE;YACrF,MAAM,KAAK,GAAG,SAAS;gBACrB,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBACrD,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;YAEzB,kEAAkE;YAClE,IAAI,KAAK,KAAK,UAAU,CAAC,UAAU,CAAC,EAAE;gBACpC,6CAA6C;gBAC7C,iBAAiB,CAAC,IAAI,CAAC,CAAC;gBACxB,UAAU,CAAC,GAAG,EAAE;oBACd,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAC3B,CAAC,EAAE,GAAG,CAAC,CAAC;gBAER,+BAA+B;gBAC/B,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACvE,cAAc,iCACT,iBAAiB,CAAC,KAAK,CAAC,KAC3B,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,IACjC,CAAC;aACJ;SACF;IACH,CAAC;IACD,mEAAmE;IACnE,uDAAuD;IACvD,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC5C,CAAC;AAED,eAAe,8BAA8B,CAAC"}
|
package/lib/hooks/useHidden.js
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { hasHiddenExtension } from '../utils/itemControl';
|
|
18
|
-
import useQuestionnaireStore from '../stores
|
|
18
|
+
import { useQuestionnaireStore } from '../stores';
|
|
19
19
|
import { isHiddenByEnableWhens } from '../utils/qItem';
|
|
20
20
|
function useHidden(qItem) {
|
|
21
|
-
const enableWhenIsActivated = useQuestionnaireStore
|
|
22
|
-
const enableWhenItems = useQuestionnaireStore
|
|
23
|
-
const enableWhenExpressions = useQuestionnaireStore
|
|
21
|
+
const enableWhenIsActivated = useQuestionnaireStore.use.enableWhenIsActivated();
|
|
22
|
+
const enableWhenItems = useQuestionnaireStore.use.enableWhenItems();
|
|
23
|
+
const enableWhenExpressions = useQuestionnaireStore.use.enableWhenExpressions();
|
|
24
24
|
if (hasHiddenExtension(qItem)) {
|
|
25
25
|
return true;
|
|
26
26
|
}
|