@aehrc/smart-forms-renderer 0.44.0 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/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/ItemParts/ItemLabelText.js +4 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +6 -5
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
- 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/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +9 -0
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- 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/FormComponents/index.d.ts +2 -0
- package/lib/components/FormComponents/index.js +3 -0
- package/lib/components/FormComponents/index.js.map +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -1
- package/lib/components/index.js.map +1 -1
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.js +5 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useBuildForm.d.ts +5 -1
- package/lib/hooks/useBuildForm.js +10 -2
- package/lib/hooks/useBuildForm.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- 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/index.d.ts +1 -0
- package/lib/stores/questionnaireStore.d.ts +6 -2
- package/lib/stores/questionnaireStore.js +5 -2
- package/lib/stores/questionnaireStore.js.map +1 -1
- package/lib/stores/rendererStylingStore.d.ts +22 -0
- package/lib/stores/rendererStylingStore.js +34 -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/enableWhen.js +12 -5
- package/lib/utils/enableWhen.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/manageForm.d.ts +3 -1
- package/lib/utils/manageForm.js +3 -2
- package/lib/utils/manageForm.js.map +1 -1
- package/lib/utils/openChoice.js +20 -2
- package/lib/utils/openChoice.js.map +1 -1
- package/package.json +3 -1
- package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +9 -1
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +12 -10
- package/src/components/FormComponents/ItemParts/index.ts +18 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.tsx +1 -1
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +20 -0
- package/src/components/FormComponents/StringItem/index.ts +18 -0
- package/src/components/FormComponents/index.ts +4 -0
- package/src/components/index.ts +6 -1
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useBuildForm.ts +16 -3
- package/src/index.ts +22 -3
- package/src/interfaces/customComponent.interface.ts +27 -0
- package/src/interfaces/index.ts +1 -0
- package/src/stores/questionnaireStore.ts +11 -3
- package/src/stores/rendererStylingStore.ts +67 -0
- package/src/stories/assets/questionnaires/QBehaviorOther.ts +92 -0
- package/src/stories/sdc/BehaviorOther.stories.tsx +7 -0
- package/src/utils/enableWhen.ts +15 -5
- package/src/utils/index.ts +2 -0
- package/src/utils/manageForm.ts +12 -2
- package/src/utils/openChoice.ts +10 -4
|
@@ -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"}
|
|
@@ -23,9 +23,11 @@ import Typography from '@mui/material/Typography';
|
|
|
23
23
|
import useDisplayCqfAndCalculatedExpression from '../../../hooks/useDisplayCqfAndCalculatedExpression';
|
|
24
24
|
import { structuredDataCapture } from 'fhir-sdc-helpers';
|
|
25
25
|
import { default as styleParse } from 'style-to-js';
|
|
26
|
+
import { useRendererStylingStore } from '../../../stores/rendererStylingStore';
|
|
26
27
|
const ItemLabelText = memo(function ItemLabelText(props) {
|
|
27
28
|
var _a, _b;
|
|
28
29
|
const { qItem, readOnly } = props;
|
|
30
|
+
const itemLabelFontWeight = useRendererStylingStore.use.itemLabelFontWeight();
|
|
29
31
|
let labelText = (_a = qItem.text) !== null && _a !== void 0 ? _a : '';
|
|
30
32
|
// Use calculatedExpressionString if available
|
|
31
33
|
const calculatedExpressionString = (_b = useDisplayCqfAndCalculatedExpression(qItem)) !== null && _b !== void 0 ? _b : '';
|
|
@@ -56,8 +58,9 @@ const ItemLabelText = memo(function ItemLabelText(props) {
|
|
|
56
58
|
if (qItem.type === 'group') {
|
|
57
59
|
return React.createElement(React.Fragment, null, labelText);
|
|
58
60
|
}
|
|
61
|
+
const textFontWeight = itemLabelFontWeight != 'default' ? itemLabelFontWeight : 'normal';
|
|
59
62
|
// parse regular text
|
|
60
|
-
return (React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.primary', sx: { mt: 0.25 } }, labelText));
|
|
63
|
+
return (React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.primary', fontWeight: itemLabelFontWeight ? itemLabelFontWeight : 'normal', sx: { mt: 0.25 } }, labelText));
|
|
61
64
|
});
|
|
62
65
|
export default ItemLabelText;
|
|
63
66
|
//# sourceMappingURL=ItemLabelText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemLabelText.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ItemLabelText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,aAAa,MAAM,g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|
@@ -22,7 +22,7 @@ import ItemLabelText from './ItemLabelText';
|
|
|
22
22
|
import Tooltip from '@mui/material/Tooltip';
|
|
23
23
|
import Typography from '@mui/material/Typography';
|
|
24
24
|
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
25
|
-
import
|
|
25
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
26
26
|
function ItemLabelWrapper(props) {
|
|
27
27
|
const { qItem, readOnly } = props;
|
|
28
28
|
const { required, displayFlyover } = useRenderingExtensions(qItem);
|
|
@@ -41,10 +41,11 @@ function ItemLabelWrapper(props) {
|
|
|
41
41
|
}
|
|
42
42
|
} },
|
|
43
43
|
React.createElement("span", null,
|
|
44
|
-
React.createElement(Box, {
|
|
45
|
-
required ? (React.createElement(Typography, { color: "red", sx: {
|
|
46
|
-
React.createElement(
|
|
47
|
-
|
|
44
|
+
React.createElement(Box, { position: "relative" },
|
|
45
|
+
required ? (React.createElement(Typography, { color: "red", sx: { position: 'absolute', top: 0, left: -8 } }, "*")) : null,
|
|
46
|
+
React.createElement(Box, { display: "flex", columnGap: 0.5, justifyContent: "space-between", alignItems: "center" },
|
|
47
|
+
React.createElement(ItemLabelText, { qItem: qItem, readOnly: readOnly }),
|
|
48
|
+
displayFlyover !== '' ? (React.createElement(InfoOutlinedIcon, { sx: { color: 'text.secondary' }, fontSize: "small" })) : null)))),
|
|
48
49
|
React.createElement(Box, { display: "flex", columnGap: 0.5 }, contextDisplayItems.map((item) => {
|
|
49
50
|
return React.createElement(ContextDisplayItem, { key: item.linkId, displayItem: item });
|
|
50
51
|
}))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemLabelWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;A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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"}
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js
CHANGED
|
@@ -86,7 +86,7 @@ function OpenChoiceCheckboxAnswerValueSetItem(props) {
|
|
|
86
86
|
React.createElement(OpenChoiceCheckboxAnswerValueSetFields, { qItem: qItem, options: options, answers: answers, openLabelText: openLabelText, openLabelValue: openLabelValue, openLabelChecked: openLabelChecked, readOnly: readOnly, terminologyError: terminologyError, onOptionChange: handleOptionChange, onOpenLabelCheckedChange: handleOpenLabelCheckedChange, onOpenLabelInputChange: handleOpenLabelInputChange }),
|
|
87
87
|
React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })));
|
|
88
88
|
}
|
|
89
|
-
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-open-choice-checkbox-answer-
|
|
89
|
+
return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-open-choice-checkbox-answer-value-set-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
|
|
90
90
|
React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
|
|
91
91
|
React.createElement(OpenChoiceCheckboxAnswerValueSetFields, { qItem: qItem, options: options, answers: answers, openLabelText: openLabelText, openLabelValue: openLabelValue, openLabelChecked: openLabelChecked, readOnly: readOnly, terminologyError: terminologyError, onOptionChange: handleOptionChange, onOpenLabelCheckedChange: handleOpenLabelCheckedChange, onOpenLabelInputChange: handleOpenLabelInputChange }))));
|
|
92
92
|
}
|
package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAO3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAC9F,OAAO,WAAW,MAAM,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AAE,KAAK,CAAC,CAAC;IACjD,CAAC,EAAE,iBAAiB,CAAC,EACrB,CAAC,qBAAqB,CAAC,CACxB,CAAC,CAAC,oFAAoF;IAEvF,IAAI,eAAe,EAAE;QACnB,OAAO,CACL;YACE,oBAAC,sCAAsC,IACrC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,kBAAkB,EAClC,wBAAwB,EAAE,4BAA4B,EACtD,sBAAsB,EAAE,0BAA0B,GAClD;YACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACpF,CACJ,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBACd
|
|
1
|
+
{"version":3,"file":"OpenChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAO3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,mBAAmB,MA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eAAe,oCAAoC,CAAC"}
|
|
@@ -32,8 +32,17 @@ import IntegerItem from '../IntegerItem/IntegerItem';
|
|
|
32
32
|
import AttachmentItem from '../AttachmentItem/AttachmentItem';
|
|
33
33
|
import CustomDateTimeItem from '../DateTimeItems/CustomDateTimeItem/CustomDateTimeItem';
|
|
34
34
|
import QuantityItem from '../QuantityItem/QuantityItem';
|
|
35
|
+
import { useQuestionnaireStore } from '../../../stores';
|
|
35
36
|
function SingleItemSwitcher(props) {
|
|
36
37
|
const { qItem, qrItem, isRepeated, isTabled, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
|
|
38
|
+
const customComponents = useQuestionnaireStore.use.customComponents();
|
|
39
|
+
const CustomComponent = customComponents[qItem.linkId];
|
|
40
|
+
// If a custom component is defined for this item, render it
|
|
41
|
+
// Don't get too strict with the checks for now
|
|
42
|
+
if (CustomComponent && typeof CustomComponent === 'function') {
|
|
43
|
+
return (React.createElement(CustomComponent, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
|
|
44
|
+
}
|
|
45
|
+
// Otherwise, render the default form component based on the item type
|
|
37
46
|
switch (qItem.type) {
|
|
38
47
|
case 'display':
|
|
39
48
|
return React.createElement(DisplayItem, { qItem: qItem });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAEnE,OAAO,sBAAsB,MAAM,2CAA2C,CAAC;AAC/E,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAQlD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,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AAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ,KAAK,UAAU;YACb,wEAAwE;YACxE,OAAO,CACL,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ;YACE,OAAO,CACL,oBAAC,UAAU;;gBACC,+BAAI,KAAK,CAAC,IAAI,CAAK;yJAElB,CACd,CAAC;KACL;AACH,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"SingleItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAEnE,OAAO,sBAAsB,MAAM,2CAA2C,CAAC;AAC/E,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAQlD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,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AAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ,KAAK,WAAW;YACd,wEAAwE;YACxE,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ,KAAK,UAAU;YACb,wEAAwE;YACxE,OAAO,CACL,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ;YACE,OAAO,CACL,oBAAC,UAAU;;gBACC,+BAAI,KAAK,CAAC,IAAI,CAAK;yJAElB,CACd,CAAC;KACL;AACH,CAAC;AAED,eAAe,kBAAkB,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"}
|
|
@@ -4,3 +4,5 @@ export { RepeatGroup } from './RepeatGroup';
|
|
|
4
4
|
export { GroupTable } from './Tables';
|
|
5
5
|
export { GridGroup } from './GridGroup';
|
|
6
6
|
export { parseFhirDateToDisplayDate } from './DateTimeItems';
|
|
7
|
+
export { ItemFieldGrid } from './ItemParts';
|
|
8
|
+
export { StringField } from './StringItem';
|
|
@@ -20,4 +20,7 @@ export { RepeatGroup } from './RepeatGroup';
|
|
|
20
20
|
export { GroupTable } from './Tables';
|
|
21
21
|
export { GridGroup } from './GridGroup';
|
|
22
22
|
export { parseFhirDateToDisplayDate } from './DateTimeItems';
|
|
23
|
+
export { ItemFieldGrid } from './ItemParts';
|
|
24
|
+
// item type components
|
|
25
|
+
export { StringField } from './StringItem';
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FormComponents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FormComponents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,uBAAuB;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { SmartFormsRendererProps } from './Renderer';
|
|
2
2
|
export { SmartFormsRenderer, BaseRenderer } from './Renderer';
|
|
3
|
-
export { SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate } from './FormComponents';
|
|
3
|
+
export { SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate, ItemFieldGrid, StringField } from './FormComponents';
|
|
4
|
+
export { FullWidthFormComponentBox } from './Box.styles';
|
package/lib/components/index.js
CHANGED
|
@@ -15,5 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
export { SmartFormsRenderer, BaseRenderer } from './Renderer';
|
|
18
|
-
export { SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate } from './FormComponents';
|
|
18
|
+
export { SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate, ItemFieldGrid, StringField } from './FormComponents';
|
|
19
|
+
// Styled MUI components
|
|
20
|
+
export { FullWidthFormComponentBox } from './Box.styles';
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,0BAA0B,EAC1B,aAAa,EACb,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,wBAAwB;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC"}
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { default as useHidden } from './useHidden';
|
|
2
|
+
export { default as useReadOnly } from './useReadOnly';
|
|
2
3
|
export { default as useBuildForm } from './useBuildForm';
|
|
3
4
|
export { default as useRendererQueryClient } from './useRendererQueryClient';
|
|
5
|
+
export { default as useRenderingExtensions } from './useRenderingExtensions';
|
|
6
|
+
export { default as useValidationFeedback } from './useValidationFeedback';
|
|
7
|
+
export { default as useStringCalculatedExpression } from './useStringCalculatedExpression';
|
package/lib/hooks/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { default as useHidden } from './useHidden';
|
|
2
|
+
export { default as useReadOnly } from './useReadOnly';
|
|
2
3
|
export { default as useBuildForm } from './useBuildForm';
|
|
3
4
|
export { default as useRendererQueryClient } from './useRendererQueryClient';
|
|
5
|
+
export { default as useRenderingExtensions } from './useRenderingExtensions';
|
|
6
|
+
export { default as useValidationFeedback } from './useValidationFeedback';
|
|
7
|
+
// CalculatedExpression hooks
|
|
8
|
+
export { default as useStringCalculatedExpression } from './useStringCalculatedExpression';
|
|
4
9
|
//# sourceMappingURL=index.js.map
|
package/lib/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE3E,6BAA6B;AAC7B,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
1
2
|
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
3
|
+
import { RendererStyling } from '../stores/rendererStylingStore';
|
|
2
4
|
/**
|
|
3
5
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
4
6
|
* @see buildForm() for more information.
|
|
@@ -8,8 +10,10 @@ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
|
8
10
|
* @param readOnly - Applies read-only mode to all items in the form view
|
|
9
11
|
* @param terminologyServerUrl - Terminology server url to fetch terminology. If not provided, the default terminology server will be used. (optional)
|
|
10
12
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
13
|
+
* @param rendererStyling - Renderer styling to be applied to the form. See docs for styling options. (optional)
|
|
14
|
+
* @param customComponents - FIXME add comment
|
|
11
15
|
*
|
|
12
16
|
* @author Sean Fong
|
|
13
17
|
*/
|
|
14
|
-
declare function useBuildForm(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, readOnly?: boolean, terminologyServerUrl?: string, additionalVariables?: Record<string, object
|
|
18
|
+
declare function useBuildForm(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, readOnly?: boolean, terminologyServerUrl?: string, additionalVariables?: Record<string, object>, rendererStyling?: RendererStyling, customComponents?: Record<string, ComponentType<any>>): boolean;
|
|
15
19
|
export default useBuildForm;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { useLayoutEffect, useState } from 'react';
|
|
18
18
|
import { buildForm } from '../utils';
|
|
19
|
+
import { useRendererStylingStore } from '../stores/rendererStylingStore';
|
|
19
20
|
/**
|
|
20
21
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
21
22
|
* @see buildForm() for more information.
|
|
@@ -25,13 +26,20 @@ import { buildForm } from '../utils';
|
|
|
25
26
|
* @param readOnly - Applies read-only mode to all items in the form view
|
|
26
27
|
* @param terminologyServerUrl - Terminology server url to fetch terminology. If not provided, the default terminology server will be used. (optional)
|
|
27
28
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
29
|
+
* @param rendererStyling - Renderer styling to be applied to the form. See docs for styling options. (optional)
|
|
30
|
+
* @param customComponents - FIXME add comment
|
|
28
31
|
*
|
|
29
32
|
* @author Sean Fong
|
|
30
33
|
*/
|
|
31
|
-
function useBuildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables) {
|
|
34
|
+
function useBuildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, rendererStyling, customComponents) {
|
|
32
35
|
const [isBuilding, setIsBuilding] = useState(true);
|
|
36
|
+
const setRendererStyling = useRendererStylingStore.use.setRendererStyling();
|
|
33
37
|
useLayoutEffect(() => {
|
|
34
|
-
|
|
38
|
+
// Set optional renderer styling
|
|
39
|
+
if (rendererStyling) {
|
|
40
|
+
setRendererStyling(rendererStyling);
|
|
41
|
+
}
|
|
42
|
+
buildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, customComponents).then(() => {
|
|
35
43
|
setIsBuilding(false);
|
|
36
44
|
});
|
|
37
45
|
}, [additionalVariables, questionnaire, questionnaireResponse, readOnly, terminologyServerUrl]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuildForm.js","sourceRoot":"","sources":["../../src/hooks/useBuildForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"useBuildForm.js","sourceRoot":"","sources":["../../src/hooks/useBuildForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAiB,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAmB,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE1F;;;;;;;;;;;;;GAaG;AACH,SAAS,YAAY,CACnB,aAA4B,EAC5B,qBAA6C,EAC7C,QAAkB,EAClB,oBAA6B,EAC7B,mBAA4C,EAC5C,eAAiC,EACjC,gBAAqD;IAErD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IAE5E,eAAe,CAAC,GAAG,EAAE;QACnB,gCAAgC;QAChC,IAAI,eAAe,EAAE;YACnB,kBAAkB,CAAC,eAAe,CAAC,CAAC;SACrC;QAED,SAAS,CACP,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,CACjB,CAAC,IAAI,CAAC,GAAG,EAAE;YACV,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,mBAAmB,EAAE,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAEhG,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,eAAe,YAAY,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export type { Tab, Tabs, Variables, VariableXFhirQuery, LaunchContext } from './interfaces';
|
|
1
|
+
export type { Tab, Tabs, Variables, VariableXFhirQuery, LaunchContext, CustomComponentProps } from './interfaces';
|
|
2
2
|
export type { SmartFormsRendererProps } from './components';
|
|
3
|
-
export { SmartFormsRenderer, BaseRenderer, SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate } from './components';
|
|
3
|
+
export { SmartFormsRenderer, BaseRenderer, SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate, ItemFieldGrid, StringField, FullWidthFormComponentBox } from './components';
|
|
4
4
|
export type { QuestionnaireStoreType, QuestionnaireResponseStoreType, SmartConfigStoreType, TerminologyServerStoreType } from './stores';
|
|
5
5
|
export { questionnaireStore, useQuestionnaireStore, questionnaireResponseStore, useQuestionnaireResponseStore, smartConfigStore, useSmartConfigStore, terminologyServerStore, useTerminologyServerStore } from './stores';
|
|
6
|
-
export { useHidden, useBuildForm, useRendererQueryClient } from './hooks';
|
|
6
|
+
export { useHidden, useReadOnly, useBuildForm, useRendererQueryClient, useRenderingExtensions, useValidationFeedback, useStringCalculatedExpression } from './hooks';
|
|
7
7
|
export type { ItemToRepopulate } from './utils';
|
|
8
|
-
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, removeInternalIdsFromResponse, isSpecificItemControl, isRepeatItemAndNotCheckbox, initialiseQuestionnaireResponse, generateItemsToRepopulate, repopulateResponse, extractObservationBased } from './utils';
|
|
8
|
+
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, removeInternalIdsFromResponse, createEmptyQrItem, isSpecificItemControl, isRepeatItemAndNotCheckbox, initialiseQuestionnaireResponse, generateItemsToRepopulate, repopulateResponse, extractObservationBased } from './utils';
|
|
9
9
|
export { RendererThemeProvider } from './theme';
|
|
10
10
|
export type { InitialiseFormWrapperProps } from './stories/storybookWrappers';
|
|
11
11
|
export { InitialiseFormWrapperForStorybook } from './stories/storybookWrappers';
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { SmartFormsRenderer, BaseRenderer, SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate } from './components';
|
|
1
|
+
export { SmartFormsRenderer, BaseRenderer, SingleItem, RepeatItem, RepeatGroup, GroupTable, GridGroup, parseFhirDateToDisplayDate, ItemFieldGrid, StringField, FullWidthFormComponentBox } from './components';
|
|
2
2
|
export { questionnaireStore, useQuestionnaireStore, questionnaireResponseStore, useQuestionnaireResponseStore, smartConfigStore, useSmartConfigStore, terminologyServerStore, useTerminologyServerStore } from './stores';
|
|
3
3
|
// hooks exports
|
|
4
|
-
export { useHidden, useBuildForm, useRendererQueryClient } from './hooks';
|
|
5
|
-
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, removeInternalIdsFromResponse, isSpecificItemControl, isRepeatItemAndNotCheckbox, initialiseQuestionnaireResponse, generateItemsToRepopulate, repopulateResponse, extractObservationBased } from './utils';
|
|
4
|
+
export { useHidden, useReadOnly, useBuildForm, useRendererQueryClient, useRenderingExtensions, useValidationFeedback, useStringCalculatedExpression } from './hooks';
|
|
5
|
+
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, removeInternalIdsFromResponse, createEmptyQrItem, isSpecificItemControl, isRepeatItemAndNotCheckbox, initialiseQuestionnaireResponse, generateItemsToRepopulate, repopulateResponse, extractObservationBased } from './utils';
|
|
6
6
|
// theme provider exports
|
|
7
7
|
export { RendererThemeProvider } from './theme';
|
|
8
8
|
export { InitialiseFormWrapperForStorybook } from './stories/storybookWrappers';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,0BAA0B,EAC1B,aAAa,EACb,WAAW,EACX,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAStB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB,gBAAgB;AAChB,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAIjB,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,8BAA8B,EAC9B,6BAA6B,EAC7B,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,yBAAyB;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIhD,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,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"}
|
|
@@ -2,3 +2,4 @@ export type { Tab, Tabs } from './tab.interface';
|
|
|
2
2
|
export type { Variables, VariableXFhirQuery } from './variables.interface';
|
|
3
3
|
export type { LaunchContext } from './populate.interface';
|
|
4
4
|
export type { EnableWhenItems, EnableWhenExpressions } from './enableWhen.interface';
|
|
5
|
+
export type { CustomComponentProps } from './customComponent.interface';
|
|
@@ -7,6 +7,8 @@ import type { AnswerExpression } from '../interfaces/answerExpression.interface'
|
|
|
7
7
|
import type { Tabs } from '../interfaces/tab.interface';
|
|
8
8
|
import type { Pages } from '../interfaces/page.interface';
|
|
9
9
|
import type { InitialExpression } from '../interfaces/initialExpression.interface';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { CustomComponentProps } from '../interfaces/customComponent.interface';
|
|
10
12
|
/**
|
|
11
13
|
* QuestionnaireStore properties and methods
|
|
12
14
|
* Properties can be accessed for fine-grain details.
|
|
@@ -74,9 +76,10 @@ export interface QuestionnaireStoreType {
|
|
|
74
76
|
cachedValueSetCodings: Record<string, Coding[]>;
|
|
75
77
|
fhirPathContext: Record<string, any>;
|
|
76
78
|
populatedContext: Record<string, any>;
|
|
79
|
+
customComponents: Record<string, React.ComponentType<CustomComponentProps>>;
|
|
77
80
|
focusedLinkId: string;
|
|
78
81
|
readOnly: boolean;
|
|
79
|
-
buildSourceQuestionnaire: (questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>, terminologyServerUrl?: string, readOnly?: boolean) => Promise<void>;
|
|
82
|
+
buildSourceQuestionnaire: (questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>, terminologyServerUrl?: string, readOnly?: boolean, customComponents?: Record<string, React.ComponentType<any>>) => Promise<void>;
|
|
80
83
|
destroySourceQuestionnaire: () => void;
|
|
81
84
|
switchTab: (newTabIndex: number) => void;
|
|
82
85
|
switchPage: (newPageIndex: number) => void;
|
|
@@ -131,9 +134,10 @@ export declare const useQuestionnaireStore: import("zustand/vanilla").StoreApi<Q
|
|
|
131
134
|
cachedValueSetCodings: () => Record<string, Coding[]>;
|
|
132
135
|
fhirPathContext: () => Record<string, any>;
|
|
133
136
|
populatedContext: () => Record<string, any>;
|
|
137
|
+
customComponents: () => Record<string, React.ComponentType<CustomComponentProps>>;
|
|
134
138
|
focusedLinkId: () => string;
|
|
135
139
|
readOnly: () => boolean;
|
|
136
|
-
buildSourceQuestionnaire: () => (questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>, terminologyServerUrl?: string, readOnly?: boolean) => Promise<void>;
|
|
140
|
+
buildSourceQuestionnaire: () => (questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, additionalVariables?: Record<string, object>, terminologyServerUrl?: string, readOnly?: boolean, customComponents?: Record<string, React.ComponentType<any>>) => Promise<void>;
|
|
137
141
|
destroySourceQuestionnaire: () => () => void;
|
|
138
142
|
switchTab: () => (newTabIndex: number) => void;
|
|
139
143
|
switchPage: () => (newPageIndex: number) => void;
|