@aehrc/smart-forms-renderer 1.3.0 → 1.3.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.
Files changed (179) hide show
  1. package/lib/components/FormComponents/GroupItem/GroupAccordion.d.ts +10 -0
  2. package/lib/components/FormComponents/GroupItem/GroupAccordion.js +71 -0
  3. package/lib/components/FormComponents/GroupItem/GroupAccordion.js.map +1 -0
  4. package/lib/components/FormComponents/GroupItem/GroupAccordion.styles.d.ts +1 -1
  5. package/lib/components/FormComponents/GroupItem/GroupAccordion.styles.js +1 -1
  6. package/lib/components/FormComponents/GroupItem/GroupAccordion.styles.js.map +1 -1
  7. package/lib/components/FormComponents/GroupItem/GroupItemView.js +1 -1
  8. package/lib/components/FormComponents/GroupItem/GroupItemView.js.map +1 -1
  9. package/lib/components/FormComponents/RepeatGroup/RepeatGroupView.js +1 -1
  10. package/lib/components/FormComponents/RepeatGroup/RepeatGroupView.js.map +1 -1
  11. package/lib/components/FormComponents/Tables/GroupTableView.js +1 -1
  12. package/lib/components/FormComponents/Tables/GroupTableView.js.map +1 -1
  13. package/lib/components/Renderer/FormBodySingleCollapsible.js +1 -1
  14. package/lib/components/Renderer/FormBodySingleCollapsible.js.map +1 -1
  15. package/lib/components/Renderer/FormBodyTabbed.js +38 -6
  16. package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
  17. package/lib/components/Tabs/FormBodyTabListWrapper.d.ts +1 -0
  18. package/lib/components/Tabs/FormBodyTabListWrapper.js +2 -2
  19. package/lib/components/Tabs/FormBodyTabListWrapper.js.map +1 -1
  20. package/lib/hooks/index.d.ts +1 -0
  21. package/lib/hooks/index.js +2 -0
  22. package/lib/hooks/index.js.map +1 -1
  23. package/package.json +3 -3
  24. package/src/components/FormComponents/GroupItem/GroupAccordion.styles.ts +1 -1
  25. package/src/components/FormComponents/GroupItem/GroupAccordion.tsx +93 -0
  26. package/src/components/FormComponents/GroupItem/GroupItemView.tsx +1 -1
  27. package/src/components/FormComponents/RepeatGroup/RepeatGroupView.tsx +1 -1
  28. package/src/components/FormComponents/Tables/GroupTableView.tsx +1 -1
  29. package/src/components/Renderer/FormBodySingleCollapsible.tsx +1 -1
  30. package/src/components/Renderer/FormBodyTabbed.tsx +48 -7
  31. package/src/components/Tabs/FormBodyTabListWrapper.tsx +3 -2
  32. package/src/hooks/index.ts +3 -0
  33. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.d.ts +0 -7
  34. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +0 -26
  35. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js.map +0 -1
  36. package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +0 -8
  37. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +0 -63
  38. package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +0 -1
  39. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +0 -8
  40. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +0 -53
  41. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +0 -1
  42. package/lib/components/FormComponents/ItemParts/ItemTextSwitcher copy.d.ts +0 -7
  43. package/lib/components/FormComponents/ItemParts/ItemTextSwitcher copy.js +0 -39
  44. package/lib/components/FormComponents/ItemParts/ItemTextSwitcher copy.js.map +0 -1
  45. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +0 -10
  46. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +0 -30
  47. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +0 -1
  48. package/lib/components/Iconify/Iconify.d.ts +0 -10
  49. package/lib/components/Iconify/Iconify.js +0 -26
  50. package/lib/components/Iconify/Iconify.js.map +0 -1
  51. package/lib/components/Renderer/FormBodyPage.d.ts +0 -9
  52. package/lib/components/Renderer/FormBodyPage.js +0 -43
  53. package/lib/components/Renderer/FormBodyPage.js.map +0 -1
  54. package/lib/components/Renderer/FormTitle.d.ts +0 -7
  55. package/lib/components/Renderer/FormTitle.js +0 -30
  56. package/lib/components/Renderer/FormTitle.js.map +0 -1
  57. package/lib/components/Renderer/FormTopLevelPage.d.ts +0 -9
  58. package/lib/components/Renderer/FormTopLevelPage.js +0 -29
  59. package/lib/components/Renderer/FormTopLevelPage.js.map +0 -1
  60. package/lib/hooks/useBooleanCalculatedExpression.d.ts +0 -12
  61. package/lib/hooks/useBooleanCalculatedExpression.js +0 -52
  62. package/lib/hooks/useBooleanCalculatedExpression.js.map +0 -1
  63. package/lib/hooks/useCalculatedExpressionAnimating.d.ts +0 -1
  64. package/lib/hooks/useCalculatedExpressionAnimating.js +0 -18
  65. package/lib/hooks/useCalculatedExpressionAnimating.js.map +0 -1
  66. package/lib/hooks/useDecimalCalculatedExpression.d.ts +0 -13
  67. package/lib/hooks/useDecimalCalculatedExpression.js +0 -58
  68. package/lib/hooks/useDecimalCalculatedExpression.js.map +0 -1
  69. package/lib/hooks/useInitialiseGroupTable.d.ts +0 -4
  70. package/lib/hooks/useInitialiseGroupTable.js +0 -36
  71. package/lib/hooks/useInitialiseGroupTable.js.map +0 -1
  72. package/lib/hooks/useIntegerCalculatedExpression.d.ts +0 -12
  73. package/lib/hooks/useIntegerCalculatedExpression.js +0 -55
  74. package/lib/hooks/useIntegerCalculatedExpression.js.map +0 -1
  75. package/lib/hooks/useNumberInput.d.ts +0 -3
  76. package/lib/hooks/useNumberInput.js +0 -31
  77. package/lib/hooks/useNumberInput.js.map +0 -1
  78. package/lib/hooks/useRepeatAnswers.d.ts +0 -4
  79. package/lib/hooks/useRepeatAnswers.js +0 -34
  80. package/lib/hooks/useRepeatAnswers.js.map +0 -1
  81. package/lib/hooks/useRepeatGroups.d.ts +0 -4
  82. package/lib/hooks/useRepeatGroups.js +0 -34
  83. package/lib/hooks/useRepeatGroups.js.map +0 -1
  84. package/lib/hooks/useShowFeedback.d.ts +0 -11
  85. package/lib/hooks/useShowFeedback.js +0 -33
  86. package/lib/hooks/useShowFeedback.js.map +0 -1
  87. package/lib/hooks/useStringCalculatedExpression.d.ts +0 -14
  88. package/lib/hooks/useStringCalculatedExpression.js +0 -69
  89. package/lib/hooks/useStringCalculatedExpression.js.map +0 -1
  90. package/lib/hooks/useStringInput.d.ts +0 -3
  91. package/lib/hooks/useStringInput.js +0 -31
  92. package/lib/hooks/useStringInput.js.map +0 -1
  93. package/lib/interfaces/itemPath.interface.d.ts +0 -31
  94. package/lib/interfaces/itemPath.interface.js +0 -2
  95. package/lib/interfaces/itemPath.interface.js.map +0 -1
  96. package/lib/interfaces/repeatItem.interface.d.ts +0 -5
  97. package/lib/interfaces/repeatItem.interface.js +0 -2
  98. package/lib/interfaces/repeatItem.interface.js.map +0 -1
  99. package/lib/stores/rendererStylingStore.d.ts +0 -144
  100. package/lib/stores/rendererStylingStore.js +0 -68
  101. package/lib/stores/rendererStylingStore.js.map +0 -1
  102. package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.d.ts +0 -30
  103. package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js +0 -46
  104. package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js.map +0 -1
  105. package/lib/stories/storybookWrappers/index.d.ts +0 -2
  106. package/lib/stories/storybookWrappers/index.js +0 -18
  107. package/lib/stories/storybookWrappers/index.js.map +0 -1
  108. package/lib/stories/testUtils.d.ts +0 -23
  109. package/lib/stories/testUtils.js +0 -249
  110. package/lib/stories/testUtils.js.map +0 -1
  111. package/lib/theme/Theme.d.ts +0 -44
  112. package/lib/theme/Theme.js +0 -45
  113. package/lib/theme/Theme.js.map +0 -1
  114. package/lib/theme/customGlobalStyles.d.ts +0 -2
  115. package/lib/theme/customGlobalStyles.js +0 -61
  116. package/lib/theme/customGlobalStyles.js.map +0 -1
  117. package/lib/theme/overrides/Accordion.d.ts +0 -14
  118. package/lib/theme/overrides/Accordion.js +0 -32
  119. package/lib/theme/overrides/Accordion.js.map +0 -1
  120. package/lib/theme/overrides/Autocomplete.d.ts +0 -10
  121. package/lib/theme/overrides/Autocomplete.js +0 -28
  122. package/lib/theme/overrides/Autocomplete.js.map +0 -1
  123. package/lib/theme/overrides/Button.d.ts +0 -33
  124. package/lib/theme/overrides/Button.js +0 -52
  125. package/lib/theme/overrides/Button.js.map +0 -1
  126. package/lib/theme/overrides/Card.d.ts +0 -35
  127. package/lib/theme/overrides/Card.js +0 -49
  128. package/lib/theme/overrides/Card.js.map +0 -1
  129. package/lib/theme/overrides/Input.d.ts +0 -64
  130. package/lib/theme/overrides/Input.js +0 -81
  131. package/lib/theme/overrides/Input.js.map +0 -1
  132. package/lib/theme/overrides/Overrides.d.ts +0 -3
  133. package/lib/theme/overrides/Overrides.js +0 -29
  134. package/lib/theme/overrides/Overrides.js.map +0 -1
  135. package/lib/theme/overrides/Paper.d.ts +0 -12
  136. package/lib/theme/overrides/Paper.js +0 -31
  137. package/lib/theme/overrides/Paper.js.map +0 -1
  138. package/lib/theme/overrides/SpeedDial.d.ts +0 -16
  139. package/lib/theme/overrides/SpeedDial.js +0 -34
  140. package/lib/theme/overrides/SpeedDial.js.map +0 -1
  141. package/lib/theme/overrides/Table.d.ts +0 -12
  142. package/lib/theme/overrides/Table.js +0 -30
  143. package/lib/theme/overrides/Table.js.map +0 -1
  144. package/lib/theme/palette.d.ts +0 -27
  145. package/lib/theme/palette.js +0 -67
  146. package/lib/theme/palette.js.map +0 -1
  147. package/lib/theme/shadows.d.ts +0 -2
  148. package/lib/theme/shadows.js +0 -52
  149. package/lib/theme/shadows.js.map +0 -1
  150. package/lib/utils/answerExpression.d.ts +0 -18
  151. package/lib/utils/answerExpression.js +0 -133
  152. package/lib/utils/answerExpression.js.map +0 -1
  153. package/lib/utils/dayjsExtend.d.ts +0 -1
  154. package/lib/utils/dayjsExtend.js +0 -22
  155. package/lib/utils/dayjsExtend.js.map +0 -1
  156. package/lib/utils/dynamicValueSet.d.ts +0 -5
  157. package/lib/utils/dynamicValueSet.js +0 -96
  158. package/lib/utils/dynamicValueSet.js.map +0 -1
  159. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.d.ts +0 -14
  160. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.js +0 -639
  161. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.js.map +0 -1
  162. package/lib/utils/fhirpathAsyncUtils/outcome-utils.d.ts +0 -3
  163. package/lib/utils/fhirpathAsyncUtils/outcome-utils.js +0 -41
  164. package/lib/utils/fhirpathAsyncUtils/outcome-utils.js.map +0 -1
  165. package/lib/utils/itemControl.d.ts +0 -97
  166. package/lib/utils/itemControl.js +0 -336
  167. package/lib/utils/itemControl.js.map +0 -1
  168. package/lib/utils/itemPath.d.ts +0 -57
  169. package/lib/utils/itemPath.js +0 -75
  170. package/lib/utils/itemPath.js.map +0 -1
  171. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.d.ts +0 -2
  172. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +0 -43
  173. package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +0 -1
  174. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.d.ts +0 -3
  175. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +0 -101
  176. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +0 -1
  177. package/lib/utils/validateQuestionnaire.d.ts +0 -66
  178. package/lib/utils/validateQuestionnaire.js +0 -559
  179. package/lib/utils/validateQuestionnaire.js.map +0 -1
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import React, { useMemo } from 'react';
18
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
19
19
  import { Grid } from '@mui/material';
20
20
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
21
21
  import TabContext from '@mui/lab/TabContext';
@@ -47,6 +47,44 @@ function FormBodyTabbed(props: FormBodyTabbedProps) {
47
47
  const tabListWidthOrResponsive = useRendererConfigStore.use.tabListWidthOrResponsive();
48
48
  const tabListStickyTop = useRendererConfigStore.use.tabListStickyTop() ?? 0;
49
49
 
50
+ const tabListGridRef = useRef<HTMLDivElement>(null);
51
+ const [tabListMaxHeight, setTabListMaxHeight] = useState<string | undefined>();
52
+
53
+ useEffect(() => {
54
+ const el = tabListGridRef.current;
55
+ if (!el) return;
56
+
57
+ // Walk up the DOM to find the nearest scrollable ancestor (the element that
58
+ // position:sticky sticks relative to). Measure available height directly from
59
+ // the DOM rather than using hardcoded offsets, so it works regardless of what
60
+ // containers the renderer is embedded in.
61
+ const getScrollContainer = (element: HTMLElement): HTMLElement | null => {
62
+ let parent = element.parentElement;
63
+ while (parent && parent !== document.documentElement) {
64
+ const { overflow, overflowY } = getComputedStyle(parent);
65
+ if (/auto|scroll/.test(overflow) || /auto|scroll/.test(overflowY)) return parent;
66
+ parent = parent.parentElement;
67
+ }
68
+ return null;
69
+ };
70
+
71
+ const scrollContainer = getScrollContainer(el);
72
+
73
+ const update = () => {
74
+ const containerBottom = scrollContainer
75
+ ? scrollContainer.getBoundingClientRect().bottom
76
+ : window.innerHeight;
77
+ const elTop = el.getBoundingClientRect().top;
78
+ setTabListMaxHeight(`${Math.max(containerBottom - elTop, 0) - 16}px`);
79
+ };
80
+
81
+ update();
82
+ window.addEventListener('resize', update, { passive: true });
83
+ return () => {
84
+ window.removeEventListener('resize', update);
85
+ };
86
+ }, []);
87
+
50
88
  const indexMap: Record<string, number> = useMemo(
51
89
  () => mapQItemsIndex(topLevelQItem),
52
90
  [topLevelQItem]
@@ -81,8 +119,7 @@ function FormBodyTabbed(props: FormBodyTabbedProps) {
81
119
  flexShrink: 0,
82
120
  position: 'sticky',
83
121
  top: tabListStickyTop,
84
- alignSelf: 'flex-start',
85
- maxHeight: `calc(100vh - ${tabListStickyTop}px)`
122
+ alignSelf: 'flex-start'
86
123
  }
87
124
  }
88
125
  : {
@@ -90,8 +127,7 @@ function FormBodyTabbed(props: FormBodyTabbedProps) {
90
127
  sx: {
91
128
  position: 'sticky',
92
129
  top: tabListStickyTop,
93
- alignSelf: 'flex-start',
94
- maxHeight: `calc(100vh - ${tabListStickyTop}px)`
130
+ alignSelf: 'flex-start'
95
131
  }
96
132
  };
97
133
 
@@ -103,8 +139,13 @@ function FormBodyTabbed(props: FormBodyTabbedProps) {
103
139
  return (
104
140
  <Grid container spacing={1.5} sx={{ flexWrap: 'nowrap' }}>
105
141
  <TabContext value={currentTab.toString()}>
106
- <Grid {...tabListWrapperProps}>
107
- <FormBodyTabListWrapper topLevelItems={qItems} currentTabIndex={currentTab} tabs={tabs} />
142
+ <Grid ref={tabListGridRef} {...tabListWrapperProps}>
143
+ <FormBodyTabListWrapper
144
+ topLevelItems={qItems}
145
+ currentTabIndex={currentTab}
146
+ tabs={tabs}
147
+ maxHeight={tabListMaxHeight}
148
+ />
108
149
  </Grid>
109
150
 
110
151
  <Grid {...qItemTabPanelProps}>
@@ -30,12 +30,13 @@ interface FormBodyTabListWrapperProps {
30
30
  topLevelItems: QuestionnaireItem[];
31
31
  currentTabIndex: number;
32
32
  tabs: Tabs;
33
+ maxHeight?: string | number;
33
34
  }
34
35
 
35
36
  const FormBodyTabListWrapper = memo(function FormBodyTabListWrapper(
36
37
  props: FormBodyTabListWrapperProps
37
38
  ) {
38
- const { topLevelItems, currentTabIndex, tabs } = props;
39
+ const { topLevelItems, currentTabIndex, tabs, maxHeight } = props;
39
40
 
40
41
  const [completedTabsExpanded, setCompletedTabsExpanded] = useState(true);
41
42
 
@@ -43,7 +44,7 @@ const FormBodyTabListWrapper = memo(function FormBodyTabListWrapper(
43
44
  useContextDisplayItems(topLevelItems);
44
45
 
45
46
  return (
46
- <Card sx={{ p: 0.75, mb: 2 }}>
47
+ <Card sx={{ p: 0.75, mb: 2, ...(maxHeight ? { maxHeight, overflowY: 'auto' } : {}) }}>
47
48
  <Box sx={{ flexGrow: 1 }}>
48
49
  <aside aria-label="Form sections">
49
50
  <PrimarySelectableList
@@ -12,3 +12,6 @@ export { default as useDisplayCqfAndCalculatedExpression } from './useDisplayCqf
12
12
  // Responsiveness-related hooks
13
13
  export { default as useResponsive } from './useResponsive';
14
14
  export type { UseResponsiveProps } from './useResponsive';
15
+
16
+ // Focus management hooks
17
+ export { useFocusTabHeading } from './useFocusTabHeading';
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface FadingCheckIconProps {
3
- fadeIn: boolean;
4
- disabled: boolean;
5
- }
6
- declare function FadingCheckIcon(props: FadingCheckIconProps): React.JSX.Element;
7
- export default FadingCheckIcon;
@@ -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,M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,CAAC;QACxC,OAAO,6BAAK,KAAK,EAAE,MAAM,IAAG,SAAS,CAAO,CAAC;KAC9C;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,OAAO,0CAAG,SAAS,CAAI,CAAC;KACzB;IAED,qBAAqB;IACrB,OAAO,CACL,oBAAC,UAAU,IAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAC7E,SAAS,CACC,CACd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem } from 'fhir/r4';
3
- interface LabelWrapperProps {
4
- qItem: QuestionnaireItem;
5
- readOnly: boolean;
6
- }
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,uCAAu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B,EAAE,GAC1E,CACH,CAAC,CAAC,CAAC,IAAI,CACJ,CACD,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,7 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem } from 'fhir/r4';
3
- interface ItemTextSwitcherProps {
4
- qItem: QuestionnaireItem;
5
- }
6
- declare const ItemTextSwitcher: React.NamedExoticComponent<ItemTextSwitcherProps>;
7
- export default ItemTextSwitcher;
@@ -1,39 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { memo } from 'react';
3
- import ReactMarkdown from 'react-markdown';
4
- import { getMarkdownString } from '../../../utils/extensions';
5
- import { useParseXhtml } from '../../../hooks/useParseXhtml';
6
- import useDisplayCqfAndCalculatedExpression from '../../../hooks/useDisplayCqfAndCalculatedExpression';
7
- import { getItemTextToDisplay } from '../../../utils/itemTextToDisplay';
8
- import { structuredDataCapture } from 'fhir-sdc-helpers';
9
- import { default as parseStyleToJs } from 'style-to-js';
10
- const ItemTextSwitcher = memo(function ItemTextSwitcher({ qItem }) {
11
- let itemTextToDisplay = getItemTextToDisplay(qItem);
12
- // Use calculatedExpressionString if available
13
- const calculatedExpressionString = useDisplayCqfAndCalculatedExpression(qItem, 'item._text') ?? '';
14
- if (calculatedExpressionString) {
15
- itemTextToDisplay = calculatedExpressionString;
16
- }
17
- // Get aria-label text if available
18
- const itemTextAriaLabel = useDisplayCqfAndCalculatedExpression(qItem, 'item._text.aria-label') ?? undefined;
19
- // parse XHTML if found
20
- const parsedXhtml = useParseXhtml(qItem);
21
- if (parsedXhtml) {
22
- return _jsx("span", { "aria-label": itemTextAriaLabel, children: parsedXhtml.content });
23
- }
24
- // parse markdown if found
25
- const markdownString = getMarkdownString(qItem);
26
- if (markdownString) {
27
- return (_jsx("span", { "aria-label": itemTextAriaLabel, children: _jsx(ReactMarkdown, { children: markdownString }) }));
28
- }
29
- // labelText is empty, return null
30
- if (!itemTextToDisplay) {
31
- return null;
32
- }
33
- const stylesString = structuredDataCapture.getStyle(qItem._text);
34
- const itemStyles = stylesString ? parseStyleToJs(stylesString) : {};
35
- // parse regular text
36
- return (_jsx("span", { "aria-label": itemTextAriaLabel, style: itemStyles, children: itemTextToDisplay }));
37
- });
38
- export default ItemTextSwitcher;
39
- //# sourceMappingURL=ItemTextSwitcher%20copy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ItemTextSwitcher copy.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/ItemTextSwitcher copy.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,oCAAoC,MAAM,qDAAqD,CAAC;AAEvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAMxD,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,gBAAgB,CAAC,EAAE,KAAK,EAAyB;IACtF,IAAI,iBAAiB,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAEpD,8CAA8C;IAC9C,MAAM,0BAA0B,GAC9B,oCAAoC,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,EAAE,CAAC;IAClE,IAAI,0BAA0B,EAAE,CAAC;QAC/B,iBAAiB,GAAG,0BAA0B,CAAC;IACjD,CAAC;IAED,mCAAmC;IACnC,MAAM,iBAAiB,GACrB,oCAAoC,CAAC,KAAK,EAAE,uBAAuB,CAAC,IAAI,SAAS,CAAC;IAEpF,uBAAuB;IACvB,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,6BAAkB,iBAAiB,YAAG,WAAW,CAAC,OAAO,GAAQ,CAAC;IAC3E,CAAC;IAED,0BAA0B;IAC1B,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,CACL,6BAAkB,iBAAiB,YACjC,KAAC,aAAa,cAAE,cAAc,GAAiB,GAC1C,CACR,CAAC;IACJ,CAAC;IAED,kCAAkC;IAClC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,YAAY,GAAG,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE,qBAAqB;IACrB,OAAO,CACL,6BAAkB,iBAAiB,EAAE,KAAK,EAAE,UAAU,YACnD,iBAAiB,GACb,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,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.MemoExoticComponent<React.ForwardRefExoticComponent<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,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAS9E,SAAS,YAAY,CAAC,KAAwB;IAC5C,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAElF,MAAM,KAAK,GAAG,qBAAqB,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IAChD,MAAM,WAAW,GAAG,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAEjE,MAAM,QAAQ,GAA2B,OAAO,CAC9C,GAAG,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,EACnC,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,MAAM,qBAAqB,GAAG,cAAc,aAA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AAC,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,mBAAmB,GACnC,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { Questionnaire } from 'fhir/r4';
3
- interface FormTitleProps {
4
- questionnaire: Questionnaire;
5
- }
6
- declare const FormTitle: React.NamedExoticComponent<FormTitleProps>;
7
- export default FormTitle;
@@ -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, { 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,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;AASrD,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEpF,MAAM,KAAK,GAAG,qBAAqB,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IAChD,MAAM,WAAW,GAAG,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAEjE,OAAO,CACL,oBAAC,IAAI,IAAC,SAAS,QAAC,OAAO,EAAE,GAAG;QAC1B,oBAAC,UAAU,IAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;YACvC,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAC9B,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;;gBAC/B,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;gBAElC,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAChD,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAErC,IAAI,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE;oBAChC,oCAAoC;oBACpC,OAAO,IAAI,CAAC;iBACb;gBAED,MAAM,UAAU,GAAG,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC;gBAC1C,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,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;