@aehrc/smart-forms-renderer 0.44.1 → 0.44.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/FormComponents/CustomComponent.d.ts +9 -0
- package/lib/components/FormComponents/CustomComponent.js +31 -0
- package/lib/components/FormComponents/CustomComponent.js.map +1 -0
- package/lib/components/FormComponents/CustomComponentWrapper.d.ts +1 -0
- package/lib/components/FormComponents/CustomComponentWrapper.js +40 -0
- package/lib/components/FormComponents/CustomComponentWrapper.js.map +1 -0
- package/lib/components/FormComponents/DecimalItem/index.d.ts +1 -0
- package/lib/components/FormComponents/DecimalItem/index.js +18 -0
- package/lib/components/FormComponents/DecimalItem/index.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/Collapsible.d.ts +3 -0
- package/lib/components/FormComponents/GroupItem/Collapsible.js +6 -0
- package/lib/components/FormComponents/GroupItem/Collapsible.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/GroupAccordion.d.ts +0 -0
- package/lib/components/FormComponents/GroupItem/GroupAccordion.js +2 -0
- package/lib/components/FormComponents/GroupItem/GroupAccordion.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/FlyoverItem.d.ts +6 -0
- package/lib/components/FormComponents/ItemParts/FlyoverItem.js +45 -0
- package/lib/components/FormComponents/ItemParts/FlyoverItem.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/index.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/index.js +18 -0
- package/lib/components/FormComponents/ItemParts/index.js.map +1 -0
- package/lib/components/FormComponents/StringItem/index.d.ts +1 -0
- package/lib/components/FormComponents/StringItem/index.js +18 -0
- package/lib/components/FormComponents/StringItem/index.js.map +1 -0
- package/lib/components/Pages/SingleItemPaginated.d.ts +19 -0
- package/lib/components/Pages/SingleItemPaginated.js +7 -0
- package/lib/components/Pages/SingleItemPaginated.js.map +1 -0
- package/lib/components/Renderer/FormBodyPaginated.d.ts +9 -0
- package/lib/components/Renderer/FormBodyPaginated.js +49 -0
- package/lib/components/Renderer/FormBodyPaginated.js.map +1 -0
- package/lib/components/Renderer/PageItem.d.ts +9 -0
- package/lib/components/Renderer/PageItem.js +68 -0
- package/lib/components/Renderer/PageItem.js.map +1 -0
- package/lib/hooks/useInitialiseGroupTable.d.ts +4 -0
- package/lib/hooks/useInitialiseGroupTable.js +36 -0
- package/lib/hooks/useInitialiseGroupTable.js.map +1 -0
- package/lib/hooks/useNumberInput.d.ts +3 -0
- package/lib/hooks/useNumberInput.js +31 -0
- package/lib/hooks/useNumberInput.js.map +1 -0
- package/lib/hooks/useRepeatGroups.d.ts +4 -0
- package/lib/hooks/useRepeatGroups.js +34 -0
- package/lib/hooks/useRepeatGroups.js.map +1 -0
- package/lib/hooks/useStringInput.d.ts +3 -0
- package/lib/hooks/useStringInput.js +32 -0
- package/lib/hooks/useStringInput.js.map +1 -0
- package/lib/interfaces/customComponent.d.ts +9 -0
- package/lib/interfaces/customComponent.interface.d.ts +9 -0
- package/lib/interfaces/customComponent.interface.js +18 -0
- package/lib/interfaces/customComponent.interface.js.map +1 -0
- package/lib/interfaces/customComponent.js +18 -0
- package/lib/interfaces/customComponent.js.map +1 -0
- package/lib/interfaces/customOverrideComponent.interface.d.ts +9 -0
- package/lib/interfaces/customOverrideComponent.interface.js +18 -0
- package/lib/interfaces/customOverrideComponent.interface.js.map +1 -0
- package/lib/interfaces/overrideComponent.interface.d.ts +12 -0
- package/lib/interfaces/overrideComponent.interface.js +18 -0
- package/lib/interfaces/overrideComponent.interface.js.map +1 -0
- package/lib/interfaces/qItemOverrideComponent.interface.d.ts +9 -0
- package/lib/interfaces/qItemOverrideComponent.interface.js +18 -0
- package/lib/interfaces/qItemOverrideComponent.interface.js.map +1 -0
- package/lib/stores/rendererStylingStore.d.ts +31 -0
- package/lib/stores/rendererStylingStore.js +40 -0
- package/lib/stores/rendererStylingStore.js.map +1 -0
- package/lib/stores/stylingStore.d.ts +23 -0
- package/lib/stores/stylingStore.js +27 -0
- package/lib/stores/stylingStore.js.map +1 -0
- package/lib/utils/customComponent.d.ts +9 -0
- package/lib/utils/customComponent.js +18 -0
- package/lib/utils/customComponent.js.map +1 -0
- package/lib/utils/openChoice.js +10 -2
- package/lib/utils/openChoice.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/openChoice.ts +13 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
|
|
3
|
+
import { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
+
interface CustomComponentProps extends PropsWithQrItemChangeHandler {
|
|
5
|
+
qItem: QuestionnaireItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
|
+
}
|
|
8
|
+
declare function CustomComponent(props: CustomComponentProps): React.JSX.Element;
|
|
9
|
+
export default CustomComponent;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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 { useQuestionnaireStore } from '../../stores';
|
|
19
|
+
import { FullWidthFormComponentBox } from '../Box.styles';
|
|
20
|
+
import ItemFieldGrid from './ItemParts/ItemFieldGrid';
|
|
21
|
+
import BooleanField from './BooleanItem/BooleanField';
|
|
22
|
+
function CustomComponent(props) {
|
|
23
|
+
const { qItem, qrItem, onQrItemChange } = props;
|
|
24
|
+
const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
25
|
+
r;
|
|
26
|
+
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-boolean-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
27
|
+
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
28
|
+
React.createElement(BooleanField, { qItem: qItem, readOnly: readOnly, valueBoolean: valueBoolean, calcExpUpdated: calcExpUpdated, onCheckedChange: handleValueChange, onClear: handleClear }))));
|
|
29
|
+
}
|
|
30
|
+
export default CustomComponent;
|
|
31
|
+
//# sourceMappingURL=CustomComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomComponent.js","sourceRoot":"","sources":["../../../src/components/FormComponents/CustomComponent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAOtD,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEhD,MAAM,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAEhE,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,yBAAyB,iBACd,oBAAoB,iBACjB,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7C,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,iBAAiB,EAClC,OAAO,EAAE,WAAW,GACpB,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
// function CustomComponentWrapper(props: CustomComponentWrapperProps) {
|
|
19
|
+
// const { qItem, qrItem, onQrItemChange } = props;
|
|
20
|
+
//
|
|
21
|
+
// const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
|
|
22
|
+
//
|
|
23
|
+
// if (includeItemFieldGrid) {
|
|
24
|
+
// return (
|
|
25
|
+
// <FullWidthFormComponentBox
|
|
26
|
+
// data-test="q-item-boolean-box"
|
|
27
|
+
// data-linkid={qItem.linkId}
|
|
28
|
+
// onClick={() => onFocusLinkId(qItem.linkId)}>
|
|
29
|
+
// <ItemFieldGrid qItem={qItem} readOnly={false}>
|
|
30
|
+
// {children}
|
|
31
|
+
// </ItemFieldGrid>
|
|
32
|
+
// </FullWidthFormComponentBox>
|
|
33
|
+
// );
|
|
34
|
+
// }
|
|
35
|
+
//
|
|
36
|
+
// return <>{children}</>;
|
|
37
|
+
// }
|
|
38
|
+
//
|
|
39
|
+
// export default CustomComponentWrapper;
|
|
40
|
+
//# sourceMappingURL=CustomComponentWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomComponentWrapper.js","sourceRoot":"","sources":["../../../src/components/FormComponents/CustomComponentWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;AAUH,wEAAwE;AACxE,qDAAqD;AACrD,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,gCAAgC;AAChC,eAAe;AACf,mCAAmC;AACnC,yCAAyC;AACzC,qCAAqC;AACrC,uDAAuD;AACvD,yDAAyD;AACzD,uBAAuB;AACvB,2BAA2B;AAC3B,qCAAqC;AACrC,SAAS;AACT,MAAM;AACN,EAAE;AACF,4BAA4B;AAC5B,IAAI;AACJ,EAAE;AACF,yCAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DecimalField } from './DecimalField';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { default as DecimalField } from './DecimalField';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DecimalItem/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapsible.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/Collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,SAAS,WAAW,CAAC,KAAK;IACxB,OAAO,gCAAW,CAAC;AACrB,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAccordion.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupAccordion.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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 Tooltip from '@mui/material/Tooltip';
|
|
19
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
20
|
+
import { useQuestionnaireStore } from '../../../stores';
|
|
21
|
+
function FlyoverItem(props) {
|
|
22
|
+
const { displayFlyover } = props;
|
|
23
|
+
const sdcUiOverrideComponents = useQuestionnaireStore.use.sdcUiOverrideComponents();
|
|
24
|
+
const FlyoverOverrideComponent = sdcUiOverrideComponents['flyover'];
|
|
25
|
+
// If a flyover override component is defined for this item, render it
|
|
26
|
+
if (FlyoverOverrideComponent && typeof FlyoverOverrideComponent === 'function') {
|
|
27
|
+
return React.createElement(FlyoverOverrideComponent, { displayText: displayFlyover });
|
|
28
|
+
}
|
|
29
|
+
return (React.createElement(Tooltip, { title: displayFlyover, placement: "top", slotProps: {
|
|
30
|
+
popper: {
|
|
31
|
+
modifiers: [
|
|
32
|
+
{
|
|
33
|
+
name: 'offset',
|
|
34
|
+
options: {
|
|
35
|
+
offset: [0, -8]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
} },
|
|
41
|
+
React.createElement("span", null,
|
|
42
|
+
React.createElement(InfoOutlinedIcon, { sx: { color: 'text.secondary' }, fontSize: "small" }))));
|
|
43
|
+
}
|
|
44
|
+
export default FlyoverItem;
|
|
45
|
+
//# sourceMappingURL=FlyoverItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlyoverItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/FlyoverItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAMxD,SAAS,WAAW,CAAC,KAAuB;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEjC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC;IACpF,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAEpE,sEAAsE;IACtE,IAAI,wBAAwB,IAAI,OAAO,wBAAwB,KAAK,UAAU,EAAE;QAC9E,OAAO,oBAAC,wBAAwB,IAAC,WAAW,EAAE,cAAc,GAAI,CAAC;KAClE;IAED,OAAO,CACL,oBAAC,OAAO,IACN,KAAK,EAAE,cAAc,EACrB,SAAS,EAAC,KAAK,EACf,SAAS,EAAE;YACT,MAAM,EAAE;gBACN,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE;4BACP,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;yBAChB;qBACF;iBACF;aACF;SACF;QACD;YACE,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,QAAQ,EAAC,OAAO,GAAG,CACjE,CACC,CACX,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ItemFieldGrid } from './ItemFieldGrid';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { default as ItemFieldGrid } from './ItemFieldGrid';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StringField } from './StringField';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { default as StringField } from './StringField';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithParentIsRepeatGroupAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
|
|
3
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
+
import type { Tabs } from '../../interfaces';
|
|
5
|
+
import type { Pages } from '../../interfaces/page.interface';
|
|
6
|
+
interface SingleItemPaginatedProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithParentIsRepeatGroupAttribute {
|
|
7
|
+
qItem: QuestionnaireItem;
|
|
8
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
9
|
+
groupCardElevation: number;
|
|
10
|
+
disableCardView?: boolean;
|
|
11
|
+
tabIsMarkedAsComplete?: boolean;
|
|
12
|
+
tabs?: Tabs;
|
|
13
|
+
currentTabIndex?: number;
|
|
14
|
+
pageIsMarkedAsComplete?: boolean;
|
|
15
|
+
pages?: Pages;
|
|
16
|
+
currentPageIndex?: number;
|
|
17
|
+
}
|
|
18
|
+
declare function SingleItemPaginated(props: SingleItemPaginatedProps): React.JSX.Element;
|
|
19
|
+
export default SingleItemPaginated;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
function SingleItemPaginated(props) {
|
|
3
|
+
const { qItem, qrItem, isRepeated, groupCardElevation, disableCardView, tabIsMarkedAsComplete, tabs, currentTabIndex, pageIsMarkedAsComplete, pages, currentPageIndex, parentIsReadOnly, parentIsRepeatGroup, parentRepeatGroupIndex, onQrItemChange } = props;
|
|
4
|
+
return React.createElement("div", null);
|
|
5
|
+
}
|
|
6
|
+
export default SingleItemPaginated;
|
|
7
|
+
//# sourceMappingURL=SingleItemPaginated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SingleItemPaginated.js","sourceRoot":"","sources":["../../../src/components/Pages/SingleItemPaginated.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,SAAS,mBAAmB,CAAC,KAA+B;IAC1D,MAAM,EACJ,KAAK,EACL,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,IAAI,EACJ,eAAe,EACf,sBAAsB,EACtB,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,OAAO,gCAAW,CAAC;AACrB,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
|
|
4
|
+
interface FormBodyPaginatedProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
+
topLevelQItems: QuestionnaireItem[];
|
|
6
|
+
topLevelQRItems: (QuestionnaireResponseItem | QuestionnaireResponseItem[] | undefined)[];
|
|
7
|
+
}
|
|
8
|
+
declare function FormBodyPaginated(props: FormBodyPaginatedProps): React.JSX.Element;
|
|
9
|
+
export default FormBodyPaginated;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
|
+
import TabContext from '@mui/lab/TabContext';
|
|
4
|
+
import TabPanel from '@mui/lab/TabPanel';
|
|
5
|
+
import GroupItem from '../FormComponents/GroupItem/GroupItem';
|
|
6
|
+
import { useQuestionnaireStore } from '../../stores';
|
|
7
|
+
import { useRendererStylingStore } from '../../stores/rendererStylingStore';
|
|
8
|
+
import { SingleItem } from '../FormComponents';
|
|
9
|
+
import PageButtonsWrapper from '../FormComponents/GroupItem/PageButtonWrapper';
|
|
10
|
+
import { QGroupContainerBox } from '../Box.styles';
|
|
11
|
+
import { GroupCard } from '../FormComponents/GroupItem/GroupItem.styles';
|
|
12
|
+
// TODO This implementation doesnt take into account repeat items and repeat groups
|
|
13
|
+
// TODO need to fix this before bringing it into release
|
|
14
|
+
// Every group item in here is rendered as a page
|
|
15
|
+
function FormBodyPaginated(props) {
|
|
16
|
+
const { topLevelQItems, topLevelQRItems, parentIsReadOnly, onQrItemChange } = props;
|
|
17
|
+
const pages = useQuestionnaireStore.use.pages();
|
|
18
|
+
const currentPage = useQuestionnaireStore.use.currentPageIndex();
|
|
19
|
+
const disableCardView = useRendererStylingStore.use.disablePageCardView();
|
|
20
|
+
return (React.createElement(Grid, { container: true, spacing: 1.5 },
|
|
21
|
+
React.createElement(TabContext, { value: currentPage.toString() },
|
|
22
|
+
React.createElement(Grid, { item: true, xs: 12, md: 12, lg: 12 }, topLevelQItems.map((qItem, i) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const qrItem = topLevelQRItems[i];
|
|
25
|
+
const isNotRepeatGroup = !Array.isArray(qrItem);
|
|
26
|
+
const isPage = !!pages[qItem.linkId];
|
|
27
|
+
const itemIsGroup = qItem.type === 'group';
|
|
28
|
+
if (!isPage || !isNotRepeatGroup) {
|
|
29
|
+
// Something has gone horribly wrong
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
|
|
33
|
+
const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
|
|
34
|
+
// Render this page as a group
|
|
35
|
+
if (itemIsGroup) {
|
|
36
|
+
return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
|
|
37
|
+
React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, disableCardView: disableCardView, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
|
|
38
|
+
}
|
|
39
|
+
// Page consists of a non-group item
|
|
40
|
+
return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
|
|
41
|
+
React.createElement(QGroupContainerBox, { cardElevation: 1, isRepeated: isRepeated, "data-test": "q-item-group-box" }, disableCardView ? (React.createElement(React.Fragment, null,
|
|
42
|
+
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
|
|
43
|
+
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))) : (React.createElement(GroupCard, { elevation: 1, isRepeated: isRepeated },
|
|
44
|
+
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
|
|
45
|
+
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))))));
|
|
46
|
+
})))));
|
|
47
|
+
}
|
|
48
|
+
export default FormBodyPaginated;
|
|
49
|
+
//# sourceMappingURL=FormBodyPaginated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormBodyPaginated.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyPaginated.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1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AAC,EAChB,UAAU,EAAE,UAAU,eACZ,kBAAkB,IAC3B,eAAe,CAAC,CAAC,CAAC,CACjB;wBACE,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,KAAK,GACf;wBACF,oBAAC,kBAAkB,IAAC,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,CAClE,CACJ,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,IAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU;wBAC7C,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,KAAK,GACf;wBACF,oBAAC,kBAAkB,IAAC,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,CACzD,CACb,CACkB,CACZ,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
|
|
4
|
+
interface PageItemProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
+
qItem: QuestionnaireItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
|
+
}
|
|
8
|
+
declare function PageItem(props: PageItemProps): React.JSX.Element | null;
|
|
9
|
+
export default PageItem;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
|
+
import TabContext from '@mui/lab/TabContext';
|
|
4
|
+
import TabPanel from '@mui/lab/TabPanel';
|
|
5
|
+
import GroupItem from '../FormComponents/GroupItem/GroupItem';
|
|
6
|
+
import { SingleItem } from '../FormComponents';
|
|
7
|
+
import PageButtonsWrapper from '../FormComponents/GroupItem/PageButtonWrapper';
|
|
8
|
+
import { QGroupContainerBox } from '../Box.styles';
|
|
9
|
+
import { GroupCard } from '../FormComponents/GroupItem/GroupItem.styles';
|
|
10
|
+
import { isRepeatItemAndNotCheckbox } from '../../utils';
|
|
11
|
+
import { useQuestionnaireStore } from '../../stores';
|
|
12
|
+
import { useRendererStylingStore } from '../../stores/rendererStylingStore';
|
|
13
|
+
// Every group item in here is rendered as a page
|
|
14
|
+
function PageItem(props) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const { qItem, qrItem, parentIsReadOnly, onQrItemChange } = props;
|
|
17
|
+
const pages = useQuestionnaireStore.use.pages();
|
|
18
|
+
const currentPage = useQuestionnaireStore.use.currentPageIndex();
|
|
19
|
+
const disableCardView = useRendererStylingStore.use.disablePageCardView();
|
|
20
|
+
const itemIsGroup = qItem.type === 'group';
|
|
21
|
+
const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
|
|
22
|
+
const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
|
|
23
|
+
if (!isPage || !isNotRepeatGroup) {
|
|
24
|
+
// Something has gone horribly wrong
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
if (itemIsGroup) {
|
|
28
|
+
return (React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, disableCardView: disableCardView, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
29
|
+
}
|
|
30
|
+
const itemRepeatsAndIsNotCheckbox = isRepeatItemAndNotCheckbox(qItem);
|
|
31
|
+
if (itemRepeatsAndIsNotCheckbox) {
|
|
32
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: 1, isRepeated: isRepeated, "data-test": "q-item-group-box" }, disableCardView ? (React.createElement(React.Fragment, null,
|
|
33
|
+
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
|
|
34
|
+
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))) : (React.createElement(GroupCard, { elevation: 1, isRepeated: isRepeated },
|
|
35
|
+
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
|
|
36
|
+
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages })))));
|
|
37
|
+
}
|
|
38
|
+
return (React.createElement(Grid, { container: true, spacing: 1.5 },
|
|
39
|
+
React.createElement(TabContext, { value: currentPage.toString() },
|
|
40
|
+
React.createElement(Grid, { item: true, xs: 12, md: 12, lg: 12 }, topLevelQItems.map((qItem, i) => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const qrItem = topLevelQRItems[i];
|
|
43
|
+
const isNotRepeatGroup = !Array.isArray(qrItem);
|
|
44
|
+
const isPage = !!pages[qItem.linkId];
|
|
45
|
+
const itemIsGroup = qItem.type === 'group';
|
|
46
|
+
if (!isPage || !isNotRepeatGroup) {
|
|
47
|
+
// Something has gone horribly wrong
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
|
|
51
|
+
const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
|
|
52
|
+
// Render this page as a group
|
|
53
|
+
if (itemIsGroup) {
|
|
54
|
+
return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
|
|
55
|
+
React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, disableCardView: disableCardView, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
|
|
56
|
+
}
|
|
57
|
+
// Page consists of a non-group item
|
|
58
|
+
const itemRepeatsAndIsNotCheckbox = isRepeatItemAndNotCheckbox(qItem);
|
|
59
|
+
return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
|
|
60
|
+
React.createElement(QGroupContainerBox, { cardElevation: 1, isRepeated: isRepeated, "data-test": "q-item-group-box" }, disableCardView ? (React.createElement(React.Fragment, null,
|
|
61
|
+
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
|
|
62
|
+
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))) : (React.createElement(GroupCard, { elevation: 1, isRepeated: isRepeated },
|
|
63
|
+
React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
|
|
64
|
+
React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))))));
|
|
65
|
+
})))));
|
|
66
|
+
}
|
|
67
|
+
export default PageItem;
|
|
68
|
+
//# sourceMappingURL=PageItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/PageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAK9D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,kBAAkB,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAO5E,iDAAiD;AACjD,SAAS,QAAQ,CAAC,KAAoB;;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAElE,MAAM,KAAK,GAAG,qBAAqB,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IAChD,MAAM,WAAW,GAAG,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACjE,MAAM,eAAe,GAAG,uBAAuB,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;IAE1E,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI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,EAAE,KAAK,GAAI,CAClE,CACJ,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,IAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU;wBAC7C,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,KAAK,GACf;wBACF,oBAAC,kBAAkB,IAAC,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,CACzD,CACb,CACkB,CACZ,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
import type { GroupTableRowModel } from '../interfaces/groupTable.interface';
|
|
3
|
+
declare function useInitialiseGroupTable(qrItems: QuestionnaireResponseItem[]): GroupTableRowModel[];
|
|
4
|
+
export default useInitialiseGroupTable;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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 { nanoid } from 'nanoid';
|
|
18
|
+
function useInitialiseGroupTable(qrItems) {
|
|
19
|
+
let initialGroupTableRows = [
|
|
20
|
+
{
|
|
21
|
+
nanoId: nanoid(),
|
|
22
|
+
qrItem: null
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
if (qrItems.length > 0) {
|
|
26
|
+
initialGroupTableRows = qrItems.map((qrItem) => {
|
|
27
|
+
return {
|
|
28
|
+
nanoId: nanoid(),
|
|
29
|
+
qrItem
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return initialGroupTableRows;
|
|
34
|
+
}
|
|
35
|
+
export default useInitialiseGroupTable;
|
|
36
|
+
//# sourceMappingURL=useInitialiseGroupTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInitialiseGroupTable.js","sourceRoot":"","sources":["../../src/hooks/useInitialiseGroupTable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,SAAS,uBAAuB,CAAC,OAAoC;IACnE,IAAI,qBAAqB,GAAyB;QAChD;YACE,MAAM,EAAE,MAAM,EAAE;YAChB,MAAM,EAAE,IAAI;SACb;KACF,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7C,OAAO;gBACL,MAAM,EAAE,MAAM,EAAE;gBAChB,MAAM;aACP,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { useEffect, useState } from 'react';
|
|
18
|
+
function useNumberInput(valueFromProps) {
|
|
19
|
+
const [value, setValue] = useState(valueFromProps);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (value !== valueFromProps) {
|
|
22
|
+
setValue(valueFromProps);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
// Only trigger this effect if prop value changes
|
|
26
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
+
[valueFromProps]);
|
|
28
|
+
return [value, setValue];
|
|
29
|
+
}
|
|
30
|
+
export default useNumberInput;
|
|
31
|
+
//# sourceMappingURL=useNumberInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNumberInput.js","sourceRoot":"","sources":["../../src/hooks/useNumberInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,SAAS,cAAc,CAAC,cAAsB;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEnD,SAAS,CACP,GAAG,EAAE;QACH,IAAI,KAAK,KAAK,cAAc,EAAE;YAC5B,QAAQ,CAAC,cAAc,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { RepeatGroupSingle } from '../interfaces/repeatGroup.interface';
|
|
3
|
+
declare function useRepeatGroups(valueFromProps: RepeatGroupSingle[]): [RepeatGroupSingle[], Dispatch<SetStateAction<RepeatGroupSingle[]>>];
|
|
4
|
+
export default useRepeatGroups;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { useEffect, useState } from 'react';
|
|
18
|
+
import _isEqual from 'lodash/isEqual';
|
|
19
|
+
function useRepeatGroups(valueFromProps) {
|
|
20
|
+
const [repeatGroups, setRepeatGroups] = useState(valueFromProps);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const valueFromPropsQRItems = valueFromProps.map((repeatGroupSingle) => repeatGroupSingle.qrItem);
|
|
23
|
+
const repeatGroupsQRItems = repeatGroups.map((repeatGroupSingle) => repeatGroupSingle.qrItem);
|
|
24
|
+
if (!_isEqual(valueFromPropsQRItems, repeatGroupsQRItems)) {
|
|
25
|
+
setRepeatGroups(valueFromProps);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
// Only trigger this effect if prop value changes
|
|
29
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
|
+
[valueFromProps]);
|
|
31
|
+
return [repeatGroups, setRepeatGroups];
|
|
32
|
+
}
|
|
33
|
+
export default useRepeatGroups;
|
|
34
|
+
//# sourceMappingURL=useRepeatGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRepeatGroups.js","sourceRoot":"","sources":["../../src/hooks/useRepeatGroups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,SAAS,eAAe,CACtB,cAAmC;IAEnC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEjE,SAAS,CACP,GAAG,EAAE;QACH,MAAM,qBAAqB,GAAG,cAAc,CAAC,GAAG,CAC9C,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAChD,CAAC;QACF,MAAM,mBAAmB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAE9F,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,EAAE;YACzD,eAAe,CAAC,cAAc,CAAC,CAAC;SACjC;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;AACzC,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { useEffect, useState } from 'react';
|
|
18
|
+
// The purpose of this hook to sync the string state from external changes i.e. re-population changes etc.
|
|
19
|
+
function useStringInput(valueFromProps) {
|
|
20
|
+
const [input, setInput] = useState(valueFromProps);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (input !== valueFromProps) {
|
|
23
|
+
setInput(valueFromProps);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
// Only trigger this effect if prop value changes
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
[valueFromProps]);
|
|
29
|
+
return [input, setInput];
|
|
30
|
+
}
|
|
31
|
+
export default useStringInput;
|
|
32
|
+
//# sourceMappingURL=useStringInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStringInput.js","sourceRoot":"","sources":["../../src/hooks/useStringInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,0GAA0G;AAC1G,SAAS,cAAc,CAAC,cAAsB;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEnD,SAAS,CACP,GAAG,EAAE;QACH,IAAI,KAAK,KAAK,cAAc,EAAE;YAC5B,QAAQ,CAAC,cAAc,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuestionnaireItem, type QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
export interface CustomComponentProps {
|
|
3
|
+
qItem: QuestionnaireItem;
|
|
4
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
isTabled: boolean;
|
|
7
|
+
parentIsReadOnly?: boolean;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuestionnaireItem, type QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
export interface CustomComponentProps {
|
|
3
|
+
qItem: QuestionnaireItem;
|
|
4
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
isTabled: boolean;
|
|
7
|
+
parentIsReadOnly?: boolean;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=customComponent.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customComponent.interface.js","sourceRoot":"","sources":["../../src/interfaces/customComponent.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=customComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customComponent.js","sourceRoot":"","sources":["../../src/interfaces/customComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuestionnaireItem, type QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
export interface CustomOverrideComponentProps {
|
|
3
|
+
qItem: QuestionnaireItem;
|
|
4
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
isTabled: boolean;
|
|
7
|
+
parentIsReadOnly?: boolean;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=customOverrideComponent.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customOverrideComponent.interface.js","sourceRoot":"","sources":["../../src/interfaces/customOverrideComponent.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
export interface QItemOverrideComponentProps {
|
|
3
|
+
qItem: QuestionnaireItem;
|
|
4
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
isTabled: boolean;
|
|
7
|
+
parentIsReadOnly?: boolean;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface SdcUiOverrideComponentProps {
|
|
11
|
+
displayText: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=overrideComponent.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overrideComponent.interface.js","sourceRoot":"","sources":["../../src/interfaces/overrideComponent.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuestionnaireItem, type QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
export interface QItemOverrideComponentProps {
|
|
3
|
+
qItem: QuestionnaireItem;
|
|
4
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
isTabled: boolean;
|
|
7
|
+
parentIsReadOnly?: boolean;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=qItemOverrideComponent.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qItemOverrideComponent.interface.js","sourceRoot":"","sources":["../../src/interfaces/qItemOverrideComponent.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface RendererStyling {
|
|
2
|
+
itemLabelFontWeight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | 'default';
|
|
3
|
+
enableWhenAsReadOnly?: boolean | 'non-group';
|
|
4
|
+
disablePageCardView?: boolean;
|
|
5
|
+
disablePageButtons?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* RendererStylingStore properties and methods
|
|
9
|
+
*
|
|
10
|
+
* @author Sean Fong
|
|
11
|
+
*/
|
|
12
|
+
export interface RendererStylingStoreType {
|
|
13
|
+
itemLabelFontWeight: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | 'default';
|
|
14
|
+
enableWhenAsReadOnly: boolean | 'non-group';
|
|
15
|
+
disablePageCardView: boolean;
|
|
16
|
+
disablePageButtons: boolean;
|
|
17
|
+
setRendererStyling: (params: RendererStyling) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @author Sean Fong
|
|
21
|
+
*/
|
|
22
|
+
export declare const rendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType>;
|
|
23
|
+
export declare const useRendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType> & {
|
|
24
|
+
use: {
|
|
25
|
+
itemLabelFontWeight: () => "500" | "800" | "600" | "default" | "100" | "200" | "300" | "400" | "700" | "900";
|
|
26
|
+
enableWhenAsReadOnly: () => boolean | "non-group";
|
|
27
|
+
disablePageCardView: () => boolean;
|
|
28
|
+
disablePageButtons: () => boolean;
|
|
29
|
+
setRendererStyling: () => (params: RendererStyling) => void;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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 { createStore } from 'zustand/vanilla';
|
|
18
|
+
import { createSelectors } from './selector';
|
|
19
|
+
/**
|
|
20
|
+
* @author Sean Fong
|
|
21
|
+
*/
|
|
22
|
+
export const rendererStylingStore = createStore()((set) => ({
|
|
23
|
+
itemLabelFontWeight: 'default',
|
|
24
|
+
enableWhenAsReadOnly: false,
|
|
25
|
+
disablePageCardView: false,
|
|
26
|
+
disablePageButtons: false,
|
|
27
|
+
setRendererStyling: (params) => {
|
|
28
|
+
set(() => {
|
|
29
|
+
var _a, _b, _c, _d;
|
|
30
|
+
return ({
|
|
31
|
+
itemLabelFontWeight: (_a = params.itemLabelFontWeight) !== null && _a !== void 0 ? _a : 'default',
|
|
32
|
+
enableWhenAsReadOnly: (_b = params.enableWhenAsReadOnly) !== null && _b !== void 0 ? _b : false,
|
|
33
|
+
disablePageCardView: (_c = params.disablePageCardView) !== null && _c !== void 0 ? _c : false,
|
|
34
|
+
disablePageButtons: (_d = params.disablePageButtons) !== null && _d !== void 0 ? _d : false
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
export const useRendererStylingStore = createSelectors(rendererStylingStore);
|
|
40
|
+
//# sourceMappingURL=rendererStylingStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendererStylingStore.js","sourceRoot":"","sources":["../../src/stores/rendererStylingStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA0C7C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,EAA4B,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACpF,mBAAmB,EAAE,SAAS;IAC9B,oBAAoB,EAAE,KAAK;IAC3B,mBAAmB,EAAE,KAAK;IAC1B,kBAAkB,EAAE,KAAK;IACzB,kBAAkB,EAAE,CAAC,MAAuB,EAAE,EAAE;QAC9C,GAAG,CAAC,GAAG,EAAE;;YAAC,OAAA,CAAC;gBACT,mBAAmB,EAAE,MAAA,MAAM,CAAC,mBAAmB,mCAAI,SAAS;gBAC5D,oBAAoB,EAAE,MAAA,MAAM,CAAC,oBAAoB,mCAAI,KAAK;gBAC1D,mBAAmB,EAAE,MAAA,MAAM,CAAC,mBAAmB,mCAAI,KAAK;gBACxD,kBAAkB,EAAE,MAAA,MAAM,CAAC,kBAAkB,mCAAI,KAAK;aACvD,CAAC,CAAA;SAAA,CAAC,CAAC;IACN,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface RendererStyling {
|
|
2
|
+
itemLabelIsBold: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* RendererStylingStore properties and methods
|
|
6
|
+
*
|
|
7
|
+
* @author Sean Fong
|
|
8
|
+
*/
|
|
9
|
+
export interface RendererStylingStoreType {
|
|
10
|
+
itemLabelIsBold: boolean;
|
|
11
|
+
setRendererStyling: (params: RendererStyling) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @author Sean Fong
|
|
15
|
+
*/
|
|
16
|
+
export declare const rendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType>;
|
|
17
|
+
export declare const useRendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType> & {
|
|
18
|
+
use: {
|
|
19
|
+
itemLabelIsBold: () => boolean;
|
|
20
|
+
setRendererStyling: () => (params: RendererStyling) => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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 { createStore } from 'zustand/vanilla';
|
|
18
|
+
import { createSelectors } from './selector';
|
|
19
|
+
/**
|
|
20
|
+
* @author Sean Fong
|
|
21
|
+
*/
|
|
22
|
+
export const rendererStylingStore = createStore()((set) => ({
|
|
23
|
+
itemLabelIsBold: false,
|
|
24
|
+
setRendererStyling: (params) => set(() => ({ itemLabelIsBold: (params.itemLabelIsBold = false) }))
|
|
25
|
+
}));
|
|
26
|
+
export const useRendererStylingStore = createSelectors(rendererStylingStore);
|
|
27
|
+
//# sourceMappingURL=stylingStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylingStore.js","sourceRoot":"","sources":["../../src/stores/stylingStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAgB7C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,EAA4B,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACpF,eAAe,EAAE,KAAK;IACtB,kBAAkB,EAAE,CAAC,MAAuB,EAAE,EAAE,CAC9C,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;CACrE,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuestionnaireItem, type QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
export interface CustomComponentProps {
|
|
3
|
+
qItem: QuestionnaireItem;
|
|
4
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
isTabled: boolean;
|
|
7
|
+
parentIsReadOnly?: boolean;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=customComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customComponent.js","sourceRoot":"","sources":["../../src/utils/customComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
package/lib/utils/openChoice.js
CHANGED
|
@@ -35,6 +35,7 @@ import differenceWith from 'lodash.differencewith';
|
|
|
35
35
|
* @author Sean Fong
|
|
36
36
|
*/
|
|
37
37
|
export function updateOpenLabelAnswer(openLabelChecked, changedOpenLabelValue, answers, options, oldQrItem, isMultiSelection, answerKey) {
|
|
38
|
+
var _a;
|
|
38
39
|
// Open label is unchecked, search for open label value and remove it
|
|
39
40
|
if (!openLabelChecked) {
|
|
40
41
|
// In single-selection, return empty array because there can only be one answer
|
|
@@ -76,8 +77,15 @@ export function updateOpenLabelAnswer(openLabelChecked, changedOpenLabelValue, a
|
|
|
76
77
|
return oldQrItem;
|
|
77
78
|
}
|
|
78
79
|
// New open label answer is different from old open label answer, update it
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const updatedAnswers = (_a = oldQrItem.answer) === null || _a === void 0 ? void 0 : _a.map((answer) => {
|
|
81
|
+
const { valueString } = answer;
|
|
82
|
+
if (valueString === oldOpenLabelAnswer.valueString) {
|
|
83
|
+
return Object.assign(Object.assign({}, answer), { valueString: changedOpenLabelValue // Update the valueString
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return answer; // Keep the other answers unchanged
|
|
87
|
+
});
|
|
88
|
+
return Object.assign(Object.assign({}, oldQrItem), { answer: updatedAnswers });
|
|
81
89
|
}
|
|
82
90
|
/**
|
|
83
91
|
* Get the old open label answer from the list of answers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openChoice.js","sourceRoot":"","sources":["../../src/utils/openChoice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAQH,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,gBAAyB,EACzB,qBAA6B,EAC7B,OAA0C,EAC1C,OAAwC,EACxC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AE;QAChC,OAAO,MAAM,CAAC,WAAW,CAAC;KAC3B;SAAM,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;QACjC,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;KACvC;SAAM;QACL,OAAO,EAAE,CAAC;KACX;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/utils/openChoice.ts
CHANGED
|
@@ -106,10 +106,21 @@ export function updateOpenLabelAnswer(
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
// New open label answer is different from old open label answer, update it
|
|
109
|
-
|
|
109
|
+
const updatedAnswers = oldQrItem.answer?.map((answer) => {
|
|
110
|
+
const { valueString } = answer;
|
|
111
|
+
if (valueString === oldOpenLabelAnswer.valueString) {
|
|
112
|
+
return {
|
|
113
|
+
...answer,
|
|
114
|
+
valueString: changedOpenLabelValue // Update the valueString
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return answer; // Keep the other answers unchanged
|
|
119
|
+
});
|
|
120
|
+
|
|
110
121
|
return {
|
|
111
122
|
...oldQrItem,
|
|
112
|
-
answer:
|
|
123
|
+
answer: updatedAnswers
|
|
113
124
|
};
|
|
114
125
|
}
|
|
115
126
|
|