@aehrc/smart-forms-renderer 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +0 -1
  2. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
  3. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +12 -0
  4. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +39 -0
  5. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -0
  6. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +3 -3
  7. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +14 -27
  8. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
  9. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +13 -0
  10. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +42 -0
  11. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -0
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +4 -3
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +14 -22
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +2 -2
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +3 -3
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.d.ts +12 -0
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +27 -0
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -0
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +1 -1
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +9 -24
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +14 -0
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +42 -0
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -0
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +1 -1
  28. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +8 -21
  29. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
  30. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +10 -0
  31. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +41 -0
  32. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -0
  33. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +7 -23
  34. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
  35. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +12 -0
  36. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +42 -0
  37. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -0
  38. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +8 -18
  39. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
  40. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +4 -4
  41. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
  42. package/lib/components/FormComponents/Item.styles.d.ts +2 -2
  43. package/lib/components/FormComponents/Item.styles.js +2 -2
  44. package/lib/components/FormComponents/Item.styles.js.map +1 -1
  45. package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.d.ts +8 -0
  46. package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js +37 -0
  47. package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js.map +1 -0
  48. package/lib/components/FormComponents/ItemParts/RadioButtons.d.ts +8 -0
  49. package/lib/components/FormComponents/ItemParts/RadioButtons.js +37 -0
  50. package/lib/components/FormComponents/ItemParts/RadioButtons.js.map +1 -0
  51. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.d.ts +8 -0
  52. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js +37 -0
  53. package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js.map +1 -0
  54. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +20 -0
  55. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +49 -0
  56. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -0
  57. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts +0 -0
  58. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js +2 -0
  59. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map +1 -0
  60. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +11 -35
  61. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
  62. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +17 -0
  63. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +42 -0
  64. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -0
  65. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +3 -3
  66. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +23 -36
  67. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
  68. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +2 -2
  69. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +3 -3
  70. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
  71. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +15 -0
  72. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +29 -0
  73. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -0
  74. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +1 -1
  75. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +3 -23
  76. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
  77. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +11 -0
  78. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +14 -0
  79. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -0
  80. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +0 -0
  81. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +2 -0
  82. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map +1 -0
  83. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +18 -23
  84. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
  85. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +12 -0
  86. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +16 -0
  87. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -0
  88. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +8 -14
  89. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
  90. package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
  91. package/lib/components/FormComponents/SingleItem/SingleItem.js +2 -2
  92. package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
  93. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.d.ts +2 -2
  94. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +3 -3
  95. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  96. package/lib/components/FormComponents/Tables/AddItemButton.d.ts +8 -0
  97. package/lib/components/FormComponents/Tables/AddItemButton.js +28 -0
  98. package/lib/components/FormComponents/Tables/AddItemButton.js.map +1 -0
  99. package/lib/components/FormComponents/Tables/AddRowButton.d.ts +8 -0
  100. package/lib/components/FormComponents/Tables/AddRowButton.js +28 -0
  101. package/lib/components/FormComponents/Tables/AddRowButton.js.map +1 -0
  102. package/lib/components/FormComponents/Tables/GroupTable.d.ts +10 -0
  103. package/lib/components/FormComponents/Tables/GroupTable.js +108 -0
  104. package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -0
  105. package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +10 -0
  106. package/lib/components/FormComponents/Tables/GroupTableRow.js +46 -0
  107. package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -0
  108. package/lib/components/FormComponents/Tables/index.d.ts +1 -1
  109. package/lib/components/FormComponents/Tables/index.js +1 -1
  110. package/lib/components/FormComponents/Tables/index.js.map +1 -1
  111. package/lib/components/Renderer/FormBodyTabbed.js +1 -1
  112. package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
  113. package/lib/components/Tabs/FormBodySingleTab.js +1 -1
  114. package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
  115. package/lib/components/Tabs/FormBodyTabList.d.ts +1 -0
  116. package/lib/components/Tabs/FormBodyTabList.js +3 -4
  117. package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
  118. package/lib/components/Tabs/FormBodyTabListWrapper.d.ts +1 -1
  119. package/lib/components/Tabs/FormBodyTabListWrapper.js +6 -13
  120. package/lib/components/Tabs/FormBodyTabListWrapper.js.map +1 -1
  121. package/lib/components/Tabs/ShowCompletedTabsSection.d.ts +7 -0
  122. package/lib/components/Tabs/ShowCompletedTabsSection.js +34 -0
  123. package/lib/components/Tabs/ShowCompletedTabsSection.js.map +1 -0
  124. package/lib/hooks/useContextDisplayItems.d.ts +6 -0
  125. package/lib/hooks/useContextDisplayItems.js +30 -0
  126. package/lib/hooks/useContextDisplayItems.js.map +1 -0
  127. package/lib/hooks/useInitialiseRenderer.js +2 -2
  128. package/lib/hooks/useInitialiseRenderer.js.map +1 -1
  129. package/lib/hooks/useInitialiseRepeatGroups.d.ts +1 -1
  130. package/lib/hooks/useNumberInput.d.ts +1 -1
  131. package/lib/hooks/useNumberInput.js.map +1 -1
  132. package/lib/hooks/useStringInput.d.ts +1 -1
  133. package/lib/hooks/useStringInput.js.map +1 -1
  134. package/lib/hooks/useTerminologyServerQuery.js +3 -6
  135. package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
  136. package/lib/index.js +2 -2
  137. package/lib/index.js.map +1 -1
  138. package/lib/interfaces/renderProps.interface.d.ts +3 -0
  139. package/lib/stores/useQuestionnaireResponseStore.d.ts +2 -1
  140. package/lib/stores/useQuestionnaireResponseStore.js +5 -3
  141. package/lib/stores/useQuestionnaireResponseStore.js.map +1 -1
  142. package/lib/utils/qrItem.d.ts +2 -3
  143. package/lib/utils/qrItem.js +2 -3
  144. package/lib/utils/qrItem.js.map +1 -1
  145. package/lib/utils/repopulateIntoResponse.d.ts +2 -2
  146. package/lib/utils/repopulateItems.js +0 -1
  147. package/lib/utils/repopulateItems.js.map +1 -1
  148. package/package.json +7 -7
  149. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +0 -1
  150. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +85 -0
  151. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +35 -58
  152. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +79 -0
  153. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +37 -50
  154. package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +10 -5
  155. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +48 -0
  156. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +25 -53
  157. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +83 -0
  158. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +27 -49
  159. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +81 -0
  160. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +19 -54
  161. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +97 -0
  162. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +22 -60
  163. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +4 -4
  164. package/src/components/FormComponents/Item.styles.ts +2 -2
  165. package/src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx +72 -0
  166. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +131 -0
  167. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +38 -93
  168. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +112 -0
  169. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +57 -76
  170. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +8 -5
  171. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +72 -0
  172. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +12 -59
  173. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +54 -0
  174. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +40 -64
  175. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +63 -0
  176. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +22 -50
  177. package/src/components/FormComponents/SingleItem/SingleItem.tsx +6 -3
  178. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +7 -3
  179. package/src/components/FormComponents/Tables/AddRowButton.tsx +49 -0
  180. package/src/components/FormComponents/Tables/{QItemGroupTable.tsx → GroupTable.tsx} +6 -17
  181. package/src/components/FormComponents/Tables/{QItemGroupTableRow.tsx → GroupTableRow.tsx} +2 -2
  182. package/src/components/FormComponents/Tables/index.ts +1 -1
  183. package/src/components/Renderer/FormBodyTabbed.tsx +1 -1
  184. package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
  185. package/src/components/Tabs/FormBodyTabList.tsx +5 -8
  186. package/src/components/Tabs/FormBodyTabListWrapper.tsx +15 -26
  187. package/src/components/Tabs/ShowCompletedTabsSection.tsx +52 -0
  188. package/src/hooks/useContextDisplayItems.ts +40 -0
  189. package/src/hooks/useInitialiseRenderer.ts +2 -2
  190. package/src/hooks/useInitialiseRepeatGroups.ts +1 -1
  191. package/src/hooks/useNumberInput.ts +2 -1
  192. package/src/hooks/useStringInput.ts +2 -1
  193. package/src/hooks/useTerminologyServerQuery.ts +3 -6
  194. package/src/index.ts +2 -2
  195. package/src/interfaces/renderProps.interface.ts +4 -0
  196. package/src/stores/useQuestionnaireResponseStore.ts +5 -4
  197. package/src/utils/qrItem.ts +4 -3
  198. package/src/utils/repopulateIntoResponse.ts +2 -2
  199. package/src/utils/repopulateItems.ts +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceRadioAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAYjD,SAAS,+BAA+B,CAAC,KAA2C;IAClF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAElG,IAAI,OAAO,CAAC,MAAM,G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
- import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
2
+ import type { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
3
3
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
4
  import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
5
5
  interface ChoiceRadioAnswerValueSetItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
@@ -16,57 +16,44 @@
16
16
  */
17
17
  import React from 'react';
18
18
  import Grid from '@mui/material/Grid';
19
- import Typography from '@mui/material/Typography';
20
- import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
21
19
  import { findInAnswerValueSetCodings } from '../../../utils/choice';
22
- import ChoiceRadioSingle from './ChoiceRadioSingle';
23
20
  import { createEmptyQrItem } from '../../../utils/qrItem';
24
- import { QRadioGroup } from '../Item.styles';
25
21
  import { FullWidthFormComponentBox } from '../../Box.styles';
26
22
  import useValueSetCodings from '../../../hooks/useValueSetCodings';
27
23
  import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
28
- import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
29
- import { StyledAlert } from '../../Alert.styles';
30
24
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
31
25
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
26
+ import ChoiceRadioAnswerValueSetFields from './ChoiceRadioAnswerValueSetFields';
32
27
  function ChoiceRadioAnswerValueSetItem(props) {
33
- var _a;
28
+ var _a, _b;
34
29
  const { qItem, qrItem, isRepeated, onQrItemChange, orientation } = props;
35
30
  // Init input value
36
31
  const qrChoiceRadio = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
37
- let valueRadio;
32
+ let valueRadio = null;
38
33
  if (qrChoiceRadio.answer) {
39
- valueRadio = (_a = qrChoiceRadio.answer[0].valueCoding) === null || _a === void 0 ? void 0 : _a.code;
34
+ valueRadio = (_b = (_a = qrChoiceRadio.answer[0].valueCoding) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : null;
40
35
  }
41
36
  // Get additional rendering extensions
42
37
  const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
43
38
  // Get codings/options from valueSet
44
39
  const { codings, serverError } = useValueSetCodings(qItem);
45
- function handleChange(event) {
40
+ function handleChange(newValue) {
46
41
  if (codings.length > 0) {
47
- const qrAnswer = findInAnswerValueSetCodings(codings, event.target.value);
42
+ const qrAnswer = findInAnswerValueSetCodings(codings, newValue);
48
43
  if (qrAnswer) {
49
44
  onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueCoding: qrAnswer }] }));
50
45
  }
51
46
  }
52
47
  }
53
- const choiceRadio = codings.length > 0 ? (React.createElement(QRadioGroup, { row: orientation === ChoiceItemOrientation.Horizontal, name: qItem.text, id: qItem.id, onChange: handleChange, value: valueRadio !== null && valueRadio !== void 0 ? valueRadio : null }, codings.map((coding) => {
54
- var _a, _b, _c;
55
- return (React.createElement(ChoiceRadioSingle, { key: (_a = coding.code) !== null && _a !== void 0 ? _a : '', value: (_b = coding.code) !== null && _b !== void 0 ? _b : '', label: (_c = coding.display) !== null && _c !== void 0 ? _c : `${coding.code}`, readOnly: readOnly }));
56
- }))) : serverError ? (React.createElement(StyledAlert, { color: "error" },
57
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
58
- React.createElement(Typography, { variant: "subtitle2" }, "There was an error fetching options from the terminology server"))) : (React.createElement(StyledAlert, { color: "error" },
59
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
60
- React.createElement(Typography, { variant: "subtitle2" }, "Unable to fetch options from the questionnaire or launch context")));
61
48
  if (isRepeated) {
62
- return React.createElement(React.Fragment, null, choiceRadio);
49
+ return (React.createElement(ChoiceRadioAnswerValueSetFields, { qItem: qItem, codings: codings, valueRadio: valueRadio, orientation: orientation, readOnly: readOnly, serverError: serverError, onCheckedChange: handleChange }));
63
50
  }
64
51
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-radio-answer-value-set-box" },
65
52
  React.createElement(Grid, { container: true, columnSpacing: 6 },
66
53
  React.createElement(Grid, { item: true, xs: 5 },
67
54
  React.createElement(LabelWrapper, { qItem: qItem })),
68
55
  React.createElement(Grid, { item: true, xs: 7 },
69
- choiceRadio,
56
+ React.createElement(ChoiceRadioAnswerValueSetFields, { qItem: qItem, codings: codings, valueRadio: valueRadio, orientation: orientation, readOnly: readOnly, serverError: serverError, onCheckedChange: handleChange }),
70
57
  React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
71
58
  }
72
59
  export default ChoiceRadioAnswerValueSetItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceRadioAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,mB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WAAW;gBACZ,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"ChoiceRadioAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAGtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAK3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAUhF,SAAS,6BAA6B,CAAC,KAAyC;;IAC9E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAEzE,mBAAmB;IACnB,MAAM,aAAa,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAEzD,IAAI,UAAU,GAAkB,IAAI,CAAC;IACrC,IAAI,aAAa,CAAC,MAAM,EAAE;QACxB,UAAU,GAAG,MAAA,MAAA,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,0CAAE,IAAI,mCAAI,IAAI,CAAC;KAChE;IAED,sCAAsC;IACtC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,sB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CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem } from 'fhir/r4';
3
+ import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
4
+ interface ChoiceSelectAnswerOptionFieldsProps extends PropsWithIsTabledAttribute {
5
+ qItem: QuestionnaireItem;
6
+ valueSelect: string;
7
+ onSelectChange: (newValue: string) => void;
8
+ }
9
+ declare function ChoiceSelectAnswerOptionFields(props: ChoiceSelectAnswerOptionFieldsProps): React.JSX.Element;
10
+ export default ChoiceSelectAnswerOptionFields;
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Copyright 2023 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import React, { Fragment } from 'react';
18
+ import InputAdornment from '@mui/material/InputAdornment';
19
+ import MenuItem from '@mui/material/MenuItem';
20
+ import Select from '@mui/material/Select';
21
+ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
22
+ function ChoiceSelectAnswerOptionFields(props) {
23
+ var _a;
24
+ const { qItem, valueSelect, isTabled, onSelectChange } = props;
25
+ const { displayUnit, displayPrompt, readOnly, entryFormat } = useRenderingExtensions(qItem);
26
+ return (React.createElement(Select, { id: qItem.id, name: qItem.text, value: valueSelect, disabled: readOnly, fullWidth: true, placeholder: entryFormat, label: displayPrompt, endAdornment: React.createElement(InputAdornment, { position: 'end' }, displayUnit), sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160 }, size: "small", onChange: (e) => onSelectChange(e.target.value) }, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option, index) => {
27
+ var _a;
28
+ if (option['valueCoding']) {
29
+ return (React.createElement(MenuItem, { key: option.valueCoding.code, value: option.valueCoding.code }, (_a = option.valueCoding.display) !== null && _a !== void 0 ? _a : option.valueCoding.code));
30
+ }
31
+ if (option['valueString']) {
32
+ return (React.createElement(MenuItem, { key: option.valueString, value: option.valueString }, option.valueString));
33
+ }
34
+ if (option['valueInteger']) {
35
+ return (React.createElement(MenuItem, { key: option.valueInteger, value: option.valueInteger.toString() }, option.valueInteger));
36
+ }
37
+ return React.createElement(Fragment, { key: index });
38
+ })));
39
+ }
40
+ export default ChoiceSelectAnswerOptionFields;
41
+ //# sourceMappingURL=ChoiceSelectAnswerOptionFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceSelectAnswerOptionFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAE1C,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAS3E,SAAS,8BAA8B,CAAC,KAA0C;;IAChF,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE/D,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAE5F,OAAO,CACL,oBAAC,MAAM,IACL,EAAE,EAAE,KAAK,CAAC,EAAE,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ACH;QAED,OAAO,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,GAAI,CAAC;IAClC,CAAC,CAAC,CACK,CACV,CAAC;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
@@ -14,19 +14,16 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import React, { Fragment } from 'react';
17
+ import React from 'react';
18
18
  import Grid from '@mui/material/Grid';
19
- import InputAdornment from '@mui/material/InputAdornment';
20
- import MenuItem from '@mui/material/MenuItem';
21
- import Select from '@mui/material/Select';
22
19
  import { findInAnswerOptions, getQrChoiceValue } from '../../../utils/choice';
23
20
  import { createEmptyQrItem } from '../../../utils/qrItem';
24
21
  import { FullWidthFormComponentBox } from '../../Box.styles';
25
22
  import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
26
23
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
27
24
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
25
+ import ChoiceSelectAnswerOptionFields from './ChoiceSelectAnswerOptionFields';
28
26
  function ChoiceSelectAnswerOptionItem(props) {
29
- var _a;
30
27
  const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
31
28
  // Init input value
32
29
  const qrChoiceSelect = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
@@ -35,11 +32,11 @@ function ChoiceSelectAnswerOptionItem(props) {
35
32
  valueSelect = '';
36
33
  }
37
34
  // Get additional rendering extensions
38
- const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
35
+ const { displayInstructions } = useRenderingExtensions(qItem);
39
36
  // Event handlers
40
- function handleChange(e) {
37
+ function handleChange(newValue) {
41
38
  if (qItem.answerOption) {
42
- const qrAnswer = findInAnswerOptions(qItem.answerOption, e.target.value);
39
+ const qrAnswer = findInAnswerOptions(qItem.answerOption, newValue);
43
40
  if (qrAnswer) {
44
41
  onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [qrAnswer] }));
45
42
  return;
@@ -47,28 +44,15 @@ function ChoiceSelectAnswerOptionItem(props) {
47
44
  }
48
45
  onQrItemChange(createEmptyQrItem(qItem));
49
46
  }
50
- const choiceSelectAnswerOption = (React.createElement(Select, { id: qItem.id, name: qItem.text, value: valueSelect, disabled: readOnly, fullWidth: true, placeholder: entryFormat, label: displayPrompt, endAdornment: React.createElement(InputAdornment, { position: 'end' }, displayUnit), sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160 }, size: "small", onChange: handleChange }, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option, index) => {
51
- var _a;
52
- if (option['valueCoding']) {
53
- return (React.createElement(MenuItem, { key: option.valueCoding.code, value: option.valueCoding.code }, (_a = option.valueCoding.display) !== null && _a !== void 0 ? _a : option.valueCoding.code));
54
- }
55
- if (option['valueString']) {
56
- return (React.createElement(MenuItem, { key: option.valueString, value: option.valueString }, option.valueString));
57
- }
58
- if (option['valueInteger']) {
59
- return (React.createElement(MenuItem, { key: option.valueInteger, value: option.valueInteger.toString() }, option.valueInteger));
60
- }
61
- return React.createElement(Fragment, { key: index });
62
- })));
63
47
  if (isRepeated) {
64
- return React.createElement(React.Fragment, null, choiceSelectAnswerOption);
48
+ return (React.createElement(ChoiceSelectAnswerOptionFields, { qItem: qItem, valueSelect: valueSelect, onSelectChange: handleChange, isTabled: isTabled }));
65
49
  }
66
50
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-select-answer-option-box" },
67
51
  React.createElement(Grid, { container: true, columnSpacing: 6 },
68
52
  React.createElement(Grid, { item: true, xs: 5 },
69
53
  React.createElement(LabelWrapper, { qItem: qItem })),
70
54
  React.createElement(Grid, { item: true, xs: 7 },
71
- choiceSelectAnswerOption,
55
+ React.createElement(ChoiceSelectAnswerOptionFields, { qItem: qItem, valueSelect: valueSelect, onSelectChange: handleChange, isTabled: isTabled }),
72
56
  React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
73
57
  }
74
58
  export default ChoiceSelectAnswerOptionItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceSelectAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAM3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAUzD,SAAS,4BAA4B,CAAC,KAAwC;;IAC5E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEtE,mBAAmB;IACnB,MAAM,cAAc,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1D,IAAI,WAAW,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;IACnD,IAAI,WAAW,KAAK,IAAI,EAAE;QACxB,WAAW,GAAG,EAAE,CAAC;KAClB;IAED,sCAAsC;IACtC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,GAC9E,sBAAsB,CAAC,KAAK,CAAC,CA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ACZ,CAAC;SACH;QAED,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,IACzD,MAAM,CAAC,WAAW,CACV,CACZ,CAAC;SACH;QAED,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,IACtE,MAAM,CAAC,YAAY,CACX,CACZ,CAAC;SACH;QAED,OAAO,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,GAAI,CAAC;IAClC,CAAC,CAAC,CACK,CACV,CAAC;IAEF,IAAI,UAAU,EAAE;QACd,OAAO,0CAAG,wBAAwB,CAAI,CAAC;KACxC;IAED,OAAO,CACL,oBAAC,yBAAyB,iBAAW,wCAAwC;QAC3E,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACb,wBAAwB;gBACzB,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"ChoiceSelectAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAGtC,OAA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EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,YAAY,EAC5B,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBAAW,wCAAwC;QAC3E,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,8BAA8B,IAC7B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,YAAY,EAC5B,QAAQ,EAAE,QAAQ,GAClB;gBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { Coding, QuestionnaireItem } from 'fhir/r4';
3
+ import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
4
+ interface ChoiceSelectAnswerValueSetFieldsProps extends PropsWithIsTabledAttribute {
5
+ qItem: QuestionnaireItem;
6
+ codings: Coding[];
7
+ valueCoding: Coding | null;
8
+ serverError: Error | null;
9
+ onSelectChange: (newValue: Coding | null) => void;
10
+ }
11
+ declare function ChoiceSelectAnswerValueSetFields(props: ChoiceSelectAnswerValueSetFieldsProps): React.JSX.Element;
12
+ export default ChoiceSelectAnswerValueSetFields;
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright 2023 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import React from 'react';
18
+ import Autocomplete from '@mui/material/Autocomplete';
19
+ import { StandardTextField } from '../Textfield.styles';
20
+ import { StyledAlert } from '../../Alert.styles';
21
+ import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
22
+ import Typography from '@mui/material/Typography';
23
+ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
24
+ function ChoiceSelectAnswerValueSetFields(props) {
25
+ const { qItem, codings, valueCoding, serverError, isTabled, onSelectChange } = props;
26
+ const { displayUnit, displayPrompt, readOnly, entryFormat } = useRenderingExtensions(qItem);
27
+ if (codings.length > 0) {
28
+ return (React.createElement(Autocomplete, { id: qItem.id, options: codings, getOptionLabel: (option) => `${option.display}`, value: valueCoding !== null && valueCoding !== void 0 ? valueCoding : null, onChange: (_, newValue) => onSelectChange(newValue), openOnFocus: true, autoHighlight: true, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160, flexGrow: 1 }, size: "small", disabled: readOnly, placeholder: entryFormat, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({ isTabled: isTabled, label: displayPrompt }, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: (React.createElement(React.Fragment, null,
29
+ params.InputProps.endAdornment,
30
+ displayUnit)) }), "data-test": "q-item-choice-dropdown-answer-value-set-field" }))) }));
31
+ }
32
+ if (serverError) {
33
+ return (React.createElement(StyledAlert, { color: "error" },
34
+ React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
35
+ React.createElement(Typography, { variant: "subtitle2" }, "There was an error fetching options from the terminology server")));
36
+ }
37
+ return (React.createElement(StyledAlert, { color: "error" },
38
+ React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
39
+ React.createElement(Typography, { variant: "subtitle2" }, "Unable to fetch options from the questionnaire or launch context")));
40
+ }
41
+ export default ChoiceSelectAnswerValueSetFields;
42
+ //# sourceMappingURL=ChoiceSelectAnswerValueSetFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceSelectAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAW3E,SAAS,gCAAgC,CAAC,KAA4C;IACpF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAErF,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAE5F,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,OAAO,CACL,oBAAC,YAAY,IACX,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,EAC/C,KAAK,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,IAAI,EAC1B,QAAQ,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EACnD,WAAW,QACX,aAAa,QACb,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,EACpE,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,oBAAC,iBAAiB,kBAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,IAChB,MAAM,IACV,UAAU,kCACL,MAAM,CAAC,UAAU,KACpB,YAAY,EAAE,CACZ;wBACG,MAAM,CAAC,UAAU,CAAC,YAAY;wBAC9B,WAAW,CACX,CACJ,kBAEO,+CAA+C,IACzD,CACH,GACD,CACH,CAAC;KACH;IAED,IAAI,WAAW,EAAE;QACf,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;YACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,sEAElB,CACD,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,gCAAgC,CAAC"}
@@ -15,28 +15,25 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { useEffect, useMemo } from 'react';
18
- import Autocomplete from '@mui/material/Autocomplete';
19
18
  import Grid from '@mui/material/Grid';
20
- import Typography from '@mui/material/Typography';
21
19
  import { createEmptyQrItem } from '../../../utils/qrItem';
22
- import { StandardTextField } from '../Textfield.styles';
23
20
  import { FullWidthFormComponentBox } from '../../Box.styles';
24
21
  import useValueSetCodings from '../../../hooks/useValueSetCodings';
25
22
  import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
26
- import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
27
- import { StyledAlert } from '../../Alert.styles';
28
23
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
29
24
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
25
+ import ChoiceSelectAnswerValueSetFields from './ChoiceSelectAnswerValueSetFields';
30
26
  function ChoiceSelectAnswerValueSetItem(props) {
27
+ var _a;
31
28
  const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
32
29
  // Init input value
33
30
  const qrChoiceSelect = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
34
- let valueCoding;
31
+ let valueCoding = null;
35
32
  if (qrChoiceSelect.answer) {
36
- valueCoding = qrChoiceSelect.answer[0].valueCoding;
33
+ valueCoding = (_a = qrChoiceSelect.answer[0].valueCoding) !== null && _a !== void 0 ? _a : null;
37
34
  }
38
35
  // Get additional rendering extensions
39
- const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
36
+ const { displayInstructions } = useRenderingExtensions(qItem);
40
37
  // Get codings/options from valueSet
41
38
  const { codings, serverError } = useValueSetCodings(qItem);
42
39
  valueCoding = useMemo(() => {
@@ -55,29 +52,22 @@ function ChoiceSelectAnswerValueSetItem(props) {
55
52
  // eslint-disable-next-line react-hooks/exhaustive-deps
56
53
  []);
57
54
  // Event handlers
58
- function handleChange(_, newValue) {
55
+ function handleChange(newValue) {
59
56
  if (newValue) {
60
57
  onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueCoding: newValue }] }));
61
58
  return;
62
59
  }
63
60
  onQrItemChange(createEmptyQrItem(qItem));
64
61
  }
65
- const choiceSelectAnswerValueSet = codings.length > 0 ? (React.createElement(Autocomplete, { id: qItem.id, options: codings, getOptionLabel: (option) => `${option.display}`, value: valueCoding !== null && valueCoding !== void 0 ? valueCoding : null, onChange: handleChange, openOnFocus: true, autoHighlight: true, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160, flexGrow: 1 }, size: "small", disabled: readOnly, placeholder: entryFormat, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({ isTabled: isTabled, label: displayPrompt }, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: (React.createElement(React.Fragment, null,
66
- params.InputProps.endAdornment,
67
- displayUnit)) }), "data-test": "q-item-choice-dropdown-answer-value-set-field" }))) })) : serverError ? (React.createElement(StyledAlert, { color: "error" },
68
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
69
- React.createElement(Typography, { variant: "subtitle2" }, "There was an error fetching options from the terminology server"))) : (React.createElement(StyledAlert, { color: "error" },
70
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
71
- React.createElement(Typography, { variant: "subtitle2" }, "Unable to fetch options from the questionnaire or launch context")));
72
62
  if (isRepeated) {
73
- return React.createElement(React.Fragment, null, choiceSelectAnswerValueSet);
63
+ return (React.createElement(ChoiceSelectAnswerValueSetFields, { qItem: qItem, codings: codings, valueCoding: valueCoding, serverError: serverError, isTabled: isTabled, onSelectChange: handleChange }));
74
64
  }
75
65
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-dropdown-answer-value-set-box" },
76
66
  React.createElement(Grid, { container: true, columnSpacing: 6 },
77
67
  React.createElement(Grid, { item: true, xs: 5 },
78
68
  React.createElement(LabelWrapper, { qItem: qItem })),
79
69
  React.createElement(Grid, { item: true, xs: 7 },
80
- choiceSelectAnswerValueSet,
70
+ React.createElement(ChoiceSelectAnswerValueSetFields, { qItem: qItem, codings: codings, valueCoding: valueCoding, serverError: serverError, isTabled: isTabled, onSelectChange: handleChange }),
81
71
  React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
82
72
  }
83
73
  export default ChoiceSelectAnswerValueSetItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceSelectAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAMhE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAUzD,SAAS,8BAA8B,CAAC,KAA0C;IAChF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEtE,mBAAmB;IACnB,MAAM,cAAc,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1D,IAAI,WAA+B,CAAC;IACpC,IAAI,cAAc,CAAC,MAAM,EAAE;QACzB,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAA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AC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;IAEJ,IAAI,UAAU,EAAE;QACd,OAAO,0CAAG,0BAA0B,CAAI,CAAC;KAC1C;IAED,OAAO,CACL,oBAAC,yBAAyB,iBAAW,6CAA6C;QAChF,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACb,0BAA0B;gBAC3B,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
1
+ {"version":3,"file":"ChoiceSelectAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAGtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAM3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAUlF,SAAS,8BAA8B,CAAC,KAA0C;;IAChF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAA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AAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,IACnC,CAAC;YACH,OAAO;SACR;QACD,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,gCAAgC,IAC/B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,YAAY,GAC5B,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBAAW,6CAA6C;QAChF,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,gCAAgC,IAC/B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,YAAY,GAC5B;gBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
@@ -15,8 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React from 'react';
18
- import { isSpecificItemControl } from '../../../utils/itemControl';
19
- import QItemGroupTable from '../Tables/QItemGroupTable';
18
+ import { isSpecificItemControl } from '../../../utils';
19
+ import GroupTable from '../Tables/GroupTable';
20
20
  import RepeatGroup from '../RepeatGroup/RepeatGroup';
21
21
  import { isRepeatItemAndNotCheckbox } from '../../../utils/qItem';
22
22
  import RepeatItem from '../RepeatItem/RepeatItem';
@@ -40,7 +40,7 @@ function GroupItemSwitcher(props) {
40
40
  return React.createElement(React.Fragment, null, "Something went wrong here");
41
41
  }
42
42
  if (isSpecificItemControl(qItem, 'gtable')) {
43
- return (React.createElement(QItemGroupTable, { qItem: qItem, qrItems: qrItems, groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
43
+ return (React.createElement(GroupTable, { qItem: qItem, qrItems: qrItems, groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
44
44
  }
45
45
  return (React.createElement(RepeatGroup, { qItem: qItem, qrItems: qrItems, groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
46
46
  }
@@ -56,7 +56,7 @@ function GroupItemSwitcher(props) {
56
56
  // If qItem is RepeatGroup or a groupTable item in this decision branch,
57
57
  // their qrItem array should always be empty
58
58
  if (isSpecificItemControl(qItem, 'gtable')) {
59
- return (React.createElement(QItemGroupTable, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
59
+ return (React.createElement(GroupTable, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
60
60
  }
61
61
  return (React.createElement(RepeatGroup, { qItem: qItem, qrItems: [], groupCardElevation: groupCardElevation + 1, onQrRepeatGroupChange: onQrRepeatGroupChange }));
62
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GroupItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,WAAW,MAAM,4BAA4B,CAAC;A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,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,EACf,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"GroupItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAU/C,SAAS,iBAAiB,CAAC,KAA6B;IACtD,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAElG,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,YAAY,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,gCAAgC;IAChC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxD,IAAI,kBAAkB,EAAE;QACtB,MAAM,OAAO,GAAG,aAAa,CAAC;QAE9B,mEAAmE;QACnE,8EAA8E;QAC9E,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;YAC5C,OAAO,sEAA8B,CAAC;SACvC;QAED,IA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,CACH,CAAC;SACH;QAED,OAAO,oBAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAI,CAAC;KACrF;IAED,wDAAwD;IACxD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,OAAO,CACL,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,KAAK,EACjB,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IAED,qCAAqC;IACrC,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,EACf,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare const QFormGroup: import("@emotion/styled").StyledComponent<import("@mui/material/FormGroup").FormGroupProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
3
- export declare const QRadioGroup: import("@emotion/styled").StyledComponent<import("@mui/material/RadioGroup").RadioGroupProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
2
+ export declare const StyledFormGroup: import("@emotion/styled").StyledComponent<import("@mui/material/FormGroup").FormGroupProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
3
+ export declare const StyledRadioGroup: import("@emotion/styled").StyledComponent<import("@mui/material/RadioGroup").RadioGroupProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
4
4
  export declare const QItemTypography: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
5
5
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
6
6
  }, "display" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "style" | "className" | "children" | "sx" | "classes" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variant" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -18,10 +18,10 @@ import FormGroup from '@mui/material/FormGroup';
18
18
  import RadioGroup from '@mui/material/RadioGroup';
19
19
  import Typography from '@mui/material/Typography';
20
20
  import { styled } from '@mui/material/styles';
21
- export const QFormGroup = styled(FormGroup)(() => ({
21
+ export const StyledFormGroup = styled(FormGroup)(() => ({
22
22
  marginBottom: 4
23
23
  }));
24
- export const QRadioGroup = styled(RadioGroup)(() => ({
24
+ export const StyledRadioGroup = styled(RadioGroup)(() => ({
25
25
  marginBottom: 4
26
26
  }));
27
27
  export const QItemTypography = styled(Typography)(() => ({
@@ -1 +1 @@
1
- {"version":3,"file":"Item.styles.js","sourceRoot":"","sources":["../../../src/components/FormComponents/Item.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACjD,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACnD,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACvD,SAAS,EAAE,CAAC;CACb,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Item.styles.js","sourceRoot":"","sources":["../../../src/components/FormComponents/Item.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACtD,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACxD,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACvD,SAAS,EAAE,CAAC;CACb,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem } from 'fhir/r4';
3
+ interface RadioAnswerOptionButtonsProps {
4
+ qItem: QuestionnaireItem;
5
+ readOnly: boolean;
6
+ }
7
+ declare function RadioAnswerOptionButtons(props: RadioAnswerOptionButtonsProps): React.JSX.Element;
8
+ export default RadioAnswerOptionButtons;
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright 2023 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import React from 'react';
18
+ import ChoiceRadioSingle from '../ChoiceItems/ChoiceRadioSingle';
19
+ function RadioAnswerOptionButtons(props) {
20
+ var _a;
21
+ const { qItem, readOnly } = props;
22
+ return (React.createElement(React.Fragment, null, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option) => {
23
+ var _a, _b, _c;
24
+ if (option['valueCoding']) {
25
+ return (React.createElement(ChoiceRadioSingle, { key: (_a = option.valueCoding.code) !== null && _a !== void 0 ? _a : '', value: (_b = option.valueCoding.code) !== null && _b !== void 0 ? _b : '', label: (_c = option.valueCoding.display) !== null && _c !== void 0 ? _c : `${option.valueCoding.code}`, readOnly: readOnly }));
26
+ }
27
+ if (option['valueString']) {
28
+ return (React.createElement(ChoiceRadioSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly }));
29
+ }
30
+ if (option['valueInteger']) {
31
+ return (React.createElement(ChoiceRadioSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly }));
32
+ }
33
+ return null;
34
+ })));
35
+ }
36
+ export default RadioAnswerOptionButtons;
37
+ //# sourceMappingURL=RadioAnswerOptionButtons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioAnswerOptionButtons.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAQjE,SAAS,wBAAwB,CAAC,KAAoC;;IACpE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACL,0CACG,MAAA,KAAK,CAAC,YAAY,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QAClC,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EAClC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EACpC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,EACjE,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAM,CAAC,WAAW,EACvB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAM,CAAC,YAAY,EACxB,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem } from 'fhir/r4';
3
+ interface RadioButtonsProps {
4
+ qItem: QuestionnaireItem;
5
+ readOnly: boolean;
6
+ }
7
+ declare function RadioButtons(props: RadioButtonsProps): React.JSX.Element;
8
+ export default RadioButtons;
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright 2023 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import React from 'react';
18
+ import ChoiceRadioSingle from '../ChoiceItems/ChoiceRadioSingle';
19
+ function RadioButtons(props) {
20
+ var _a;
21
+ const { qItem, readOnly } = props;
22
+ return (React.createElement(React.Fragment, null, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option) => {
23
+ var _a, _b, _c;
24
+ if (option['valueCoding']) {
25
+ return (React.createElement(ChoiceRadioSingle, { key: (_a = option.valueCoding.code) !== null && _a !== void 0 ? _a : '', value: (_b = option.valueCoding.code) !== null && _b !== void 0 ? _b : '', label: (_c = option.valueCoding.display) !== null && _c !== void 0 ? _c : `${option.valueCoding.code}`, readOnly: readOnly }));
26
+ }
27
+ if (option['valueString']) {
28
+ return (React.createElement(ChoiceRadioSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly }));
29
+ }
30
+ if (option['valueInteger']) {
31
+ return (React.createElement(ChoiceRadioSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly }));
32
+ }
33
+ return null;
34
+ })));
35
+ }
36
+ export default RadioButtons;
37
+ //# sourceMappingURL=RadioButtons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButtons.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/RadioButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAQjE,SAAS,YAAY,CAAC,KAAwB;;IAC5C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACL,0CACG,MAAA,KAAK,CAAC,YAAY,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QAClC,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EAClC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EACpC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,EACjE,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAM,CAAC,WAAW,EACvB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAM,CAAC,YAAY,EACxB,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem } from 'fhir/r4';
3
+ interface RadioButtonsProps {
4
+ qItem: QuestionnaireItem;
5
+ readOnly: boolean;
6
+ }
7
+ declare function RadioButtonsAnswerOption(props: RadioButtonsProps): React.JSX.Element;
8
+ export default RadioButtonsAnswerOption;