@aehrc/smart-forms-renderer 1.2.2 → 1.2.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/hooks/useCalculatedExpressionUpdated.js +3 -1
- package/lib/hooks/useCalculatedExpressionUpdated.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useCalculatedExpressionUpdated.ts +3 -1
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.d.ts +0 -7
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +0 -26
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +0 -8
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js +0 -63
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +0 -8
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +0 -53
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +0 -1
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +0 -10
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +0 -30
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +0 -1
- package/lib/components/Iconify/Iconify.d.ts +0 -10
- package/lib/components/Iconify/Iconify.js +0 -26
- package/lib/components/Iconify/Iconify.js.map +0 -1
- package/lib/components/Renderer/FormBodyPage.d.ts +0 -9
- package/lib/components/Renderer/FormBodyPage.js +0 -43
- package/lib/components/Renderer/FormBodyPage.js.map +0 -1
- package/lib/components/Renderer/FormTitle.d.ts +0 -7
- package/lib/components/Renderer/FormTitle.js +0 -30
- package/lib/components/Renderer/FormTitle.js.map +0 -1
- package/lib/components/Renderer/FormTopLevelPage.d.ts +0 -9
- package/lib/components/Renderer/FormTopLevelPage.js +0 -29
- package/lib/components/Renderer/FormTopLevelPage.js.map +0 -1
- package/lib/hooks/useBooleanCalculatedExpression.d.ts +0 -12
- package/lib/hooks/useBooleanCalculatedExpression.js +0 -53
- package/lib/hooks/useBooleanCalculatedExpression.js.map +0 -1
- package/lib/hooks/useDecimalCalculatedExpression.d.ts +0 -13
- package/lib/hooks/useDecimalCalculatedExpression.js +0 -59
- package/lib/hooks/useDecimalCalculatedExpression.js.map +0 -1
- package/lib/hooks/useIntegerCalculatedExpression.d.ts +0 -12
- package/lib/hooks/useIntegerCalculatedExpression.js +0 -56
- package/lib/hooks/useIntegerCalculatedExpression.js.map +0 -1
- package/lib/hooks/useQuantityCalculatedExpression.d.ts +0 -14
- package/lib/hooks/useQuantityCalculatedExpression.js +0 -107
- package/lib/hooks/useQuantityCalculatedExpression.js.map +0 -1
- package/lib/hooks/useStringCalculatedExpression.d.ts +0 -12
- package/lib/hooks/useStringCalculatedExpression.js +0 -58
- package/lib/hooks/useStringCalculatedExpression.js.map +0 -1
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.d.ts +0 -31
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js +0 -67
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js.map +0 -1
- package/lib/stories/storybookWrappers/index.d.ts +0 -2
- package/lib/stories/storybookWrappers/index.js +0 -18
- package/lib/stories/storybookWrappers/index.js.map +0 -1
- package/lib/theme/Theme.d.ts +0 -44
- package/lib/theme/Theme.js +0 -43
- package/lib/theme/Theme.js.map +0 -1
- package/lib/theme/customGlobalStyles.d.ts +0 -2
- package/lib/theme/customGlobalStyles.js +0 -61
- package/lib/theme/customGlobalStyles.js.map +0 -1
- package/lib/theme/overrides/Accordion.d.ts +0 -14
- package/lib/theme/overrides/Accordion.js +0 -32
- package/lib/theme/overrides/Accordion.js.map +0 -1
- package/lib/theme/overrides/Autocomplete.d.ts +0 -10
- package/lib/theme/overrides/Autocomplete.js +0 -28
- package/lib/theme/overrides/Autocomplete.js.map +0 -1
- package/lib/theme/overrides/Button.d.ts +0 -33
- package/lib/theme/overrides/Button.js +0 -52
- package/lib/theme/overrides/Button.js.map +0 -1
- package/lib/theme/overrides/Card.d.ts +0 -35
- package/lib/theme/overrides/Card.js +0 -49
- package/lib/theme/overrides/Card.js.map +0 -1
- package/lib/theme/overrides/Input.d.ts +0 -64
- package/lib/theme/overrides/Input.js +0 -81
- package/lib/theme/overrides/Input.js.map +0 -1
- package/lib/theme/overrides/Overrides.d.ts +0 -3
- package/lib/theme/overrides/Overrides.js +0 -29
- package/lib/theme/overrides/Overrides.js.map +0 -1
- package/lib/theme/overrides/Paper.d.ts +0 -12
- package/lib/theme/overrides/Paper.js +0 -31
- package/lib/theme/overrides/Paper.js.map +0 -1
- package/lib/theme/overrides/SpeedDial.d.ts +0 -16
- package/lib/theme/overrides/SpeedDial.js +0 -34
- package/lib/theme/overrides/SpeedDial.js.map +0 -1
- package/lib/theme/overrides/Table.d.ts +0 -12
- package/lib/theme/overrides/Table.js +0 -30
- package/lib/theme/overrides/Table.js.map +0 -1
- package/lib/theme/palette.d.ts +0 -27
- package/lib/theme/palette.js +0 -63
- package/lib/theme/palette.js.map +0 -1
- package/lib/theme/shadows.d.ts +0 -2
- package/lib/theme/shadows.js +0 -52
- package/lib/theme/shadows.js.map +0 -1
- package/lib/utils/dayjsExtend.d.ts +0 -1
- package/lib/utils/dayjsExtend.js +0 -22
- package/lib/utils/dayjsExtend.js.map +0 -1
- package/lib/utils/itemControl.d.ts +0 -103
- package/lib/utils/itemControl.js +0 -350
- package/lib/utils/itemControl.js.map +0 -1
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.d.ts +0 -2
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +0 -43
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +0 -1
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.d.ts +0 -3
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +0 -101
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +0 -1
- package/lib/utils/validateQuestionnaire.d.ts +0 -66
- package/lib/utils/validateQuestionnaire.js +0 -559
- package/lib/utils/validateQuestionnaire.js.map +0 -1
|
@@ -8,9 +8,11 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
8
8
|
export function useCalculatedExpressionUpdated(answerKey) {
|
|
9
9
|
const [animating, setAnimating] = useState(false);
|
|
10
10
|
const previousAnswerKey = useRef(null);
|
|
11
|
+
const mounted = useRef(false);
|
|
11
12
|
useEffect(() => {
|
|
12
13
|
// Skip the first render — just store the current key
|
|
13
|
-
if (
|
|
14
|
+
if (!mounted.current) {
|
|
15
|
+
mounted.current = true;
|
|
14
16
|
previousAnswerKey.current = answerKey ?? null;
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCalculatedExpressionUpdated.js","sourceRoot":"","sources":["../../src/hooks/useCalculatedExpressionUpdated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,SAA6B;IAC1E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"useCalculatedExpressionUpdated.js","sourceRoot":"","sources":["../../src/hooks/useCalculatedExpressionUpdated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,SAA6B;IAC1E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAE9B,SAAS,CAAC,GAAG,EAAE;QACb,qDAAqD;QACrD,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;YACvB,iBAAiB,CAAC,OAAO,GAAG,SAAS,IAAI,IAAI,CAAC;YAC9C,OAAO;QACT,CAAC;QAED,2DAA2D;QAC3D,IACE,SAAS;YACT,SAAS,KAAK,iBAAiB,CAAC,OAAO;YACvC,kJAAkJ;YAClJ,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAC1C,CAAC;YACD,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;YACtC,YAAY,CAAC,IAAI,CAAC,CAAC;YAEnB,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;YAEzD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -9,10 +9,12 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
9
9
|
export function useCalculatedExpressionUpdated(answerKey: string | undefined): boolean {
|
|
10
10
|
const [animating, setAnimating] = useState(false);
|
|
11
11
|
const previousAnswerKey = useRef<string | null>(null);
|
|
12
|
+
const mounted = useRef(false);
|
|
12
13
|
|
|
13
14
|
useEffect(() => {
|
|
14
15
|
// Skip the first render — just store the current key
|
|
15
|
-
if (
|
|
16
|
+
if (!mounted.current) {
|
|
17
|
+
mounted.current = true;
|
|
16
18
|
previousAnswerKey.current = answerKey ?? null;
|
|
17
19
|
return;
|
|
18
20
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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 Fade from '@mui/material/Fade';
|
|
19
|
-
import SyncIcon from '@mui/icons-material/Sync';
|
|
20
|
-
function FadingCheckIcon(props) {
|
|
21
|
-
const { fadeIn, disabled } = props;
|
|
22
|
-
return (React.createElement(Fade, { in: fadeIn, timeout: { enter: 100, exit: 300 } },
|
|
23
|
-
React.createElement(SyncIcon, { color: "success", fontSize: "small", sx: Object.assign({}, (disabled ? { color: 'text.disabled' } : null)) })));
|
|
24
|
-
}
|
|
25
|
-
export default FadingCheckIcon;
|
|
26
|
-
//# sourceMappingURL=FadingCheckIcon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FadingCheckIcon.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/FadingCheckIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAOhD,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEnC,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE;QAClD,oBAAC,QAAQ,IACP,KAAK,EAAC,SAAS,EACf,QAAQ,EAAC,OAAO,EAChB,EAAE,oBAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IACvD,CACG,CACR,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem } from 'fhir/r4';
|
|
3
|
-
interface ItemLabelTextProps {
|
|
4
|
-
qItem: QuestionnaireItem;
|
|
5
|
-
readOnly?: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const ItemLabelText: React.NamedExoticComponent<ItemLabelTextProps>;
|
|
8
|
-
export default ItemLabelText;
|
|
@@ -1,63 +0,0 @@
|
|
|
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, { memo } from 'react';
|
|
18
|
-
import { getMarkdownString, getXHtmlString } from '../../../utils/itemControl';
|
|
19
|
-
import { default as htmlParse } from 'html-react-parser';
|
|
20
|
-
import Box from '@mui/material/Box';
|
|
21
|
-
import ReactMarkdown from 'react-markdown';
|
|
22
|
-
import Typography from '@mui/material/Typography';
|
|
23
|
-
import useDisplayCqfAndCalculatedExpression from '../../../hooks/useDisplayCqfAndCalculatedExpression';
|
|
24
|
-
import { structuredDataCapture } from 'fhir-sdc-helpers';
|
|
25
|
-
import { default as styleParse } from 'style-to-js';
|
|
26
|
-
const ItemLabelText = memo(function ItemLabelText(props) {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const { qItem, readOnly } = props;
|
|
29
|
-
let labelText = (_a = qItem.text) !== null && _a !== void 0 ? _a : '';
|
|
30
|
-
// Use calculatedExpressionString if available
|
|
31
|
-
const calculatedExpressionString = (_b = useDisplayCqfAndCalculatedExpression(qItem)) !== null && _b !== void 0 ? _b : '';
|
|
32
|
-
if (calculatedExpressionString) {
|
|
33
|
-
labelText = calculatedExpressionString;
|
|
34
|
-
}
|
|
35
|
-
// parse xHTML if found
|
|
36
|
-
const xHtmlString = getXHtmlString(qItem);
|
|
37
|
-
if (xHtmlString) {
|
|
38
|
-
return React.createElement(Box, null, htmlParse(xHtmlString));
|
|
39
|
-
}
|
|
40
|
-
// parse markdown if found
|
|
41
|
-
const markdownString = getMarkdownString(qItem);
|
|
42
|
-
if (markdownString) {
|
|
43
|
-
return (React.createElement(Box, null,
|
|
44
|
-
React.createElement(ReactMarkdown, null, markdownString)));
|
|
45
|
-
}
|
|
46
|
-
// labelText is empty, return null
|
|
47
|
-
if (!labelText) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
// parse styles if found
|
|
51
|
-
const stylesString = structuredDataCapture.getStyle(qItem._text);
|
|
52
|
-
if (stylesString) {
|
|
53
|
-
const styles = styleParse(stylesString);
|
|
54
|
-
return React.createElement("div", { style: styles }, labelText);
|
|
55
|
-
}
|
|
56
|
-
if (qItem.type === 'group') {
|
|
57
|
-
return React.createElement(React.Fragment, null, labelText);
|
|
58
|
-
}
|
|
59
|
-
// parse regular text
|
|
60
|
-
return (React.createElement(Typography, { color: readOnly ? 'text.disabled' : 'text.primary', sx: { mt: 0.25 } }, labelText));
|
|
61
|
-
});
|
|
62
|
-
export default ItemLabelText;
|
|
63
|
-
//# sourceMappingURL=ItemLabelText.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,gBAAgB,CAAC;AAC3C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,oCAAoC,MAAM,qDAAqD,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAOpD,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,aAAa,CAAC,KAAyB;;IACzE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAElC,IAAI,SAAS,GAAG,MAAA,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC;IAEjC,8CAA8C;IAC9C,MAAM,0BAA0B,GAAG,MAAA,oCAAoC,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAC;IACrF,IAAI,0BAA0B,EAAE,CAAC;QAC/B,SAAS,GAAG,0BAA0B,CAAC;IACzC,CAAC;IAED,uBAAuB;IACvB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
|
7
|
-
declare function ItemLabelWrapper(props: LabelWrapperProps): React.JSX.Element;
|
|
8
|
-
export default ItemLabelWrapper;
|
|
@@ -1,53 +0,0 @@
|
|
|
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 Box from '@mui/material/Box';
|
|
19
|
-
import ContextDisplayItem from './ContextDisplayItem';
|
|
20
|
-
import { getContextDisplays } from '../../../utils/tabs';
|
|
21
|
-
import ItemLabelText from './ItemLabelText';
|
|
22
|
-
import Tooltip from '@mui/material/Tooltip';
|
|
23
|
-
import Typography from '@mui/material/Typography';
|
|
24
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
25
|
-
import Iconify from '../../Iconify/Iconify';
|
|
26
|
-
function ItemLabelWrapper(props) {
|
|
27
|
-
const { qItem, readOnly } = props;
|
|
28
|
-
const { required, displayFlyover } = useRenderingExtensions(qItem);
|
|
29
|
-
const contextDisplayItems = getContextDisplays(qItem);
|
|
30
|
-
return (React.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "space-between" },
|
|
31
|
-
React.createElement(Tooltip, { title: displayFlyover, placement: "top", slotProps: {
|
|
32
|
-
popper: {
|
|
33
|
-
modifiers: [
|
|
34
|
-
{
|
|
35
|
-
name: 'offset',
|
|
36
|
-
options: {
|
|
37
|
-
offset: [0, -8]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
} },
|
|
43
|
-
React.createElement("span", null,
|
|
44
|
-
React.createElement(Box, { display: "flex", columnGap: 0.4, justifyContent: "space-between", alignItems: "center" },
|
|
45
|
-
required ? (React.createElement(Typography, { color: "red", sx: { ml: -1.15 } }, "*")) : null,
|
|
46
|
-
React.createElement(ItemLabelText, { qItem: qItem, readOnly: readOnly }),
|
|
47
|
-
displayFlyover !== '' ? (React.createElement(Iconify, { icon: "mdi:information-outline", sx: { height: 16, width: 16, mt: 0.25, ml: 0.25, color: 'text.secondary' } })) : null))),
|
|
48
|
-
React.createElement(Box, { display: "flex", columnGap: 0.5 }, contextDisplayItems.map((item) => {
|
|
49
|
-
return React.createElement(ContextDisplayItem, { key: item.linkId, displayItem: item });
|
|
50
|
-
}))));
|
|
51
|
-
}
|
|
52
|
-
export default ItemLabelWrapper;
|
|
53
|
-
//# sourceMappingURL=ItemLabelWrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AACpC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAO5C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,CACC;QAEV,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,GAAG,IAC/B,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAChC,OAAO,oBAAC,kBAAkB,IAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,GAAI,CAAC;QACrE,CAAC,CAAC,CACE,CACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
interface DeleteItemButtonProps {
|
|
4
|
-
nullableQrItem: QuestionnaireResponseItem | null;
|
|
5
|
-
numOfRepeatGroups: number;
|
|
6
|
-
readOnly: boolean;
|
|
7
|
-
onDeleteItem: () => void;
|
|
8
|
-
}
|
|
9
|
-
declare function DeleteItemButton(props: DeleteItemButtonProps): React.JSX.Element;
|
|
10
|
-
export default DeleteItemButton;
|
|
@@ -1,30 +0,0 @@
|
|
|
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 { RepeatDeleteTooltip } from '../RepeatItem/RepeatItem.styles';
|
|
19
|
-
import IconButton from '@mui/material/IconButton';
|
|
20
|
-
import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline';
|
|
21
|
-
function DeleteItemButton(props) {
|
|
22
|
-
const { nullableQrItem, numOfRepeatGroups, readOnly, onDeleteItem } = props;
|
|
23
|
-
const isDisabled = nullableQrItem === null || numOfRepeatGroups === 1 || readOnly;
|
|
24
|
-
return (React.createElement(RepeatDeleteTooltip, { className: "repeat-group-delete", title: "Remove item" },
|
|
25
|
-
React.createElement("span", null,
|
|
26
|
-
React.createElement(IconButton, { size: "small", color: "error", disabled: isDisabled, onClick: onDeleteItem },
|
|
27
|
-
React.createElement(RemoveCircleOutlineIcon, null)))));
|
|
28
|
-
}
|
|
29
|
-
export default DeleteItemButton;
|
|
30
|
-
//# sourceMappingURL=DeleteItemButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteItemButton.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,uBAAuB,MAAM,yCAAyC,CAAC;AAU9E,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE5E,MAAM,UAAU,GAAG,cAAc,KAAK,IAAI,IAAI,iBAAiB,KAAK,CAAC,IAAI,QAAQ,CAAC;IAElF,OAAO,CACL,oBAAC,mBAAmB,IAAC,SAAS,EAAC,qBAAqB,EAAC,KAAK,EAAC,aAAa;QACtE;YACE,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY;gBAChF,oBAAC,uBAAuB,OAAG,CAChB,CACR,CACa,CACvB,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
-
interface IconifyProps {
|
|
4
|
-
icon: string;
|
|
5
|
-
width?: number;
|
|
6
|
-
height?: number;
|
|
7
|
-
sx?: SxProps<Theme>;
|
|
8
|
-
}
|
|
9
|
-
declare const Iconify: React.NamedExoticComponent<IconifyProps & React.RefAttributes<unknown>>;
|
|
10
|
-
export default Iconify;
|
|
@@ -1,26 +0,0 @@
|
|
|
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, { forwardRef, memo } from 'react';
|
|
18
|
-
import { Icon } from '@iconify/react';
|
|
19
|
-
import Box from '@mui/material/Box';
|
|
20
|
-
const Iconify = memo(forwardRef(function Iconify(props, ref) {
|
|
21
|
-
// eslint-disable-next-line react/prop-types
|
|
22
|
-
const { icon, width = 20, height = 20, sx } = props;
|
|
23
|
-
return React.createElement(Box, { ref: ref, component: Icon, icon: icon, sx: Object.assign({ width, height }, sx) });
|
|
24
|
-
}));
|
|
25
|
-
export default Iconify;
|
|
26
|
-
//# sourceMappingURL=Iconify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Iconify.js","sourceRoot":"","sources":["../../../src/components/Iconify/Iconify.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AASpC,MAAM,OAAO,GAAG,IAAI,CAClB,UAAU,CAAC,SAAS,OAAO,CAAC,KAAmB,EAAE,GAAG;IAClD,4CAA4C;IAC5C,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IACpD,OAAO,oBAAC,GAAG,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,kBAAI,KAAK,EAAE,MAAM,IAAK,EAAE,IAAM,CAAC;AACtF,CAAC,CAAC,CACH,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
|
|
4
|
-
interface FormBodyPageProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
-
topLevelQItem: QuestionnaireItem;
|
|
6
|
-
topLevelQRItem: QuestionnaireResponseItem | null;
|
|
7
|
-
}
|
|
8
|
-
declare function FormBodyPage(props: FormBodyPageProps): React.JSX.Element;
|
|
9
|
-
export default FormBodyPage;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } 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 { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
|
|
8
|
-
import { createEmptyQrGroup, updateQrItemsInGroup } from '../../utils/qrItem';
|
|
9
|
-
function FormBodyPage(props) {
|
|
10
|
-
const { topLevelQItem, topLevelQRItem, parentIsReadOnly, onQrItemChange } = props;
|
|
11
|
-
const pages = useQuestionnaireStore.use.pages();
|
|
12
|
-
const currentPage = useQuestionnaireStore.use.currentPageIndex();
|
|
13
|
-
const indexMap = useMemo(() => mapQItemsIndex(topLevelQItem), [topLevelQItem]);
|
|
14
|
-
const nonNullTopLevelQRItem = topLevelQRItem !== null && topLevelQRItem !== void 0 ? topLevelQRItem : createEmptyQrGroup(topLevelQItem);
|
|
15
|
-
const qItems = topLevelQItem.item;
|
|
16
|
-
const qrItems = nonNullTopLevelQRItem.item;
|
|
17
|
-
function handleQrGroupChange(qrItem) {
|
|
18
|
-
updateQrItemsInGroup(qrItem, null, nonNullTopLevelQRItem, indexMap);
|
|
19
|
-
onQrItemChange(nonNullTopLevelQRItem);
|
|
20
|
-
}
|
|
21
|
-
if (!qItems || !qrItems) {
|
|
22
|
-
return React.createElement(React.Fragment, null, "Unable to load form");
|
|
23
|
-
}
|
|
24
|
-
const qrItemsByIndex = getQrItemsIndex(qItems, qrItems, indexMap);
|
|
25
|
-
return (React.createElement(Grid, { container: true, spacing: 1.5 },
|
|
26
|
-
React.createElement(TabContext, { value: currentPage.toString() },
|
|
27
|
-
React.createElement(Grid, { item: true, xs: 12, md: 12, lg: 12 }, qItems.map((qItem, i) => {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
const qrItem = qrItemsByIndex[i];
|
|
30
|
-
const isNotRepeatGroup = !Array.isArray(qrItem);
|
|
31
|
-
const isPage = !!pages[qItem.linkId];
|
|
32
|
-
if (!isPage || !isNotRepeatGroup) {
|
|
33
|
-
// Something has gone horribly wrong
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
|
|
37
|
-
const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
|
|
38
|
-
return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
|
|
39
|
-
React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleQrGroupChange })));
|
|
40
|
-
})))));
|
|
41
|
-
}
|
|
42
|
-
export default FormBodyPage;
|
|
43
|
-
//# sourceMappingURL=FormBodyPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormBodyPage.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAK9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAA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
|
-
* 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, { memo } from 'react';
|
|
18
|
-
import parse from 'html-react-parser';
|
|
19
|
-
import { getXHtmlStringFromQuestionnaire } from '../../utils/qItem';
|
|
20
|
-
import { FormTitleWrapper } from '../Box.styles';
|
|
21
|
-
import Typography from '@mui/material/Typography';
|
|
22
|
-
const FormTitle = memo(function FormTitle(props) {
|
|
23
|
-
const { questionnaire } = props;
|
|
24
|
-
const xHtmlString = getXHtmlStringFromQuestionnaire(questionnaire);
|
|
25
|
-
const formTitle = xHtmlString ? parse(xHtmlString) : questionnaire.title;
|
|
26
|
-
return (React.createElement(FormTitleWrapper, null,
|
|
27
|
-
React.createElement(Typography, { variant: "h3", "data-test": "form-heading" }, formTitle)));
|
|
28
|
-
});
|
|
29
|
-
export default FormTitle;
|
|
30
|
-
//# sourceMappingURL=FormTitle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormTitle.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTitle.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAMlD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,SAAS,CAAC,KAAqB;IAC7D,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAEhC,MAAM,WAAW,GAAG,+BAA+B,CAAC,aAAa,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;IAEzE,OAAO,CACL,oBAAC,gBAAgB;QACf,oBAAC,UAAU,IAAC,OAAO,EAAC,IAAI,eAAW,cAAc,IAC9C,SAAS,CACC,CACI,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
|
|
4
|
-
interface FormTopLevelPageProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
-
topLevelQItems: QuestionnaireItem[];
|
|
6
|
-
topLevelQRItems: (QuestionnaireResponseItem | QuestionnaireResponseItem[] | undefined)[];
|
|
7
|
-
}
|
|
8
|
-
declare function FormTopLevelPage(props: FormTopLevelPageProps): React.JSX.Element;
|
|
9
|
-
export default FormTopLevelPage;
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
function FormTopLevelPage(props) {
|
|
8
|
-
const { topLevelQItems, topLevelQRItems, parentIsReadOnly, onQrItemChange } = props;
|
|
9
|
-
const pages = useQuestionnaireStore.use.pages();
|
|
10
|
-
const currentPage = useQuestionnaireStore.use.currentPageIndex();
|
|
11
|
-
return (React.createElement(Grid, { container: true, spacing: 1.5 },
|
|
12
|
-
React.createElement(TabContext, { value: currentPage.toString() },
|
|
13
|
-
React.createElement(Grid, { item: true, xs: 12, md: 12, lg: 12 }, topLevelQItems.map((qItem, i) => {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
const qrItem = topLevelQRItems[i];
|
|
16
|
-
const isNotRepeatGroup = !Array.isArray(qrItem);
|
|
17
|
-
const isPage = !!pages[qItem.linkId];
|
|
18
|
-
if (!isPage || !isNotRepeatGroup) {
|
|
19
|
-
// Something has gone horribly wrong
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
|
|
23
|
-
const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
|
|
24
|
-
return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
|
|
25
|
-
React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
|
|
26
|
-
})))));
|
|
27
|
-
}
|
|
28
|
-
export default FormTopLevelPage;
|
|
29
|
-
//# sourceMappingURL=FormTopLevelPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormTopLevelPage.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormTopLevelPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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C,UAAU,mCAAI,KAAK,CAAC;gBAEvE,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EACZ,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,eACT,qBAAqB;oBAC/B,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,sBAAsB,EAAE,sBAAsB,EAC9C,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,WAAW,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { QuestionnaireItem } from 'fhir/r4';
|
|
2
|
-
interface UseBooleanCalculatedExpression {
|
|
3
|
-
calcExpUpdated: boolean;
|
|
4
|
-
}
|
|
5
|
-
interface UseBooleanCalculatedExpressionProps {
|
|
6
|
-
qItem: QuestionnaireItem;
|
|
7
|
-
booleanValue: boolean | undefined;
|
|
8
|
-
onChangeByCalcExpressionBoolean: (newValueBoolean: boolean) => void;
|
|
9
|
-
onChangeByCalcExpressionNull: () => void;
|
|
10
|
-
}
|
|
11
|
-
declare function useBooleanCalculatedExpression(props: UseBooleanCalculatedExpressionProps): UseBooleanCalculatedExpression;
|
|
12
|
-
export default useBooleanCalculatedExpression;
|
|
@@ -1,53 +0,0 @@
|
|
|
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 { useQuestionnaireStore } from '../stores';
|
|
19
|
-
function useBooleanCalculatedExpression(props) {
|
|
20
|
-
const { qItem, booleanValue, onChangeByCalcExpressionBoolean, onChangeByCalcExpressionNull } = props;
|
|
21
|
-
const calculatedExpressions = useQuestionnaireStore.use.calculatedExpressions();
|
|
22
|
-
const [calcExpUpdated, setCalcExpUpdated] = useState(false);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
var _a;
|
|
25
|
-
const calcExpression = (_a = calculatedExpressions[qItem.linkId]) === null || _a === void 0 ? void 0 : _a.find((exp) => exp.from === 'item');
|
|
26
|
-
if (!calcExpression) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
// only update if calculated value is different from current value
|
|
30
|
-
if (calcExpression.value !== booleanValue &&
|
|
31
|
-
(typeof calcExpression.value === 'boolean' || calcExpression.value === null)) {
|
|
32
|
-
// update ui to show calculated value changes
|
|
33
|
-
setCalcExpUpdated(true);
|
|
34
|
-
const timeoutId = setTimeout(() => {
|
|
35
|
-
setCalcExpUpdated(false);
|
|
36
|
-
}, 500);
|
|
37
|
-
// calculatedExpression value is null
|
|
38
|
-
if (calcExpression.value === null) {
|
|
39
|
-
onChangeByCalcExpressionNull();
|
|
40
|
-
return () => clearTimeout(timeoutId);
|
|
41
|
-
}
|
|
42
|
-
// calculatedExpression value is boolean
|
|
43
|
-
onChangeByCalcExpressionBoolean(calcExpression.value);
|
|
44
|
-
return () => clearTimeout(timeoutId);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
// Only trigger this effect if calculatedExpression of item changes
|
|
48
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
-
[calculatedExpressions]);
|
|
50
|
-
return { calcExpUpdated: calcExpUpdated };
|
|
51
|
-
}
|
|
52
|
-
export default useBooleanCalculatedExpression;
|
|
53
|
-
//# sourceMappingURL=useBooleanCalculatedExpression.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBooleanCalculatedExpression.js","sourceRoot":"","sources":["../../src/hooks/useBooleanCalculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAalD,SAAS,8BAA8B,CACrC,KAA0C;IAE1C,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,GAC1F,KAAK,CAAC;IAER,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAEhF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,SAAS,CACP,GAAG,EAAE;;QACH,MAAM,cAAc,GAAG,MAAA,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,IAAI,CAC9D,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAC7B,CAAC;QAEF,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,kEAAkE;QAClE,IACE,cAAc,CAAC,KAAK,KAAK,YAAY;YACrC,CAAC,OAAO,cAAc,CAAC,KAAK,KAAK,SAAS,IAAI,cAAc,CAAC,KAAK,KAAK,IAAI,CAAC,EAC5E,CAAC;YACD,6CAA6C;YAC7C,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACxB,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBAChC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,EAAE,GAAG,CAAC,CAAC;YAER,qCAAqC;YACrC,IAAI,cAAc,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;gBAClC,4BAA4B,EAAE,CAAC;gBAC/B,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;YACvC,CAAC;YAED,wCAAwC;YACxC,+BAA+B,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YACtD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IACD,mEAAmE;IACnE,uDAAuD;IACvD,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC5C,CAAC;AAED,eAAe,8BAA8B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { QuestionnaireItem } from 'fhir/r4';
|
|
2
|
-
interface UseDecimalCalculatedExpression {
|
|
3
|
-
calcExpUpdated: boolean;
|
|
4
|
-
}
|
|
5
|
-
interface UseDecimalCalculatedExpressionProps {
|
|
6
|
-
qItem: QuestionnaireItem;
|
|
7
|
-
inputValue: string;
|
|
8
|
-
precision: number | null;
|
|
9
|
-
onChangeByCalcExpressionDecimal: (calcExpressionValue: number) => void;
|
|
10
|
-
onChangeByCalcExpressionNull: () => void;
|
|
11
|
-
}
|
|
12
|
-
declare function useDecimalCalculatedExpression(props: UseDecimalCalculatedExpressionProps): UseDecimalCalculatedExpression;
|
|
13
|
-
export default useDecimalCalculatedExpression;
|