@aehrc/smart-forms-renderer 0.8.0 → 0.8.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 (264) hide show
  1. package/lib/components/Alert.styles.d.ts +2 -7
  2. package/lib/components/Box.styles.d.ts +6 -21
  3. package/lib/components/FormComponents/BooleanItem/BooleanItem.d.ts +2 -2
  4. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +5 -4
  5. package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
  6. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.d.ts +2 -2
  7. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +6 -5
  8. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
  9. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +2 -2
  10. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +7 -6
  11. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +2 -2
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +7 -6
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +2 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +8 -8
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +2 -2
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +6 -6
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +2 -2
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +6 -5
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +1 -0
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +2 -2
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -1
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.d.ts +2 -2
  28. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +8 -7
  29. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
  30. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +1 -0
  31. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +2 -2
  32. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -1
  33. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.d.ts +2 -2
  34. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +8 -7
  35. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
  36. package/lib/components/FormComponents/DateItem/DateItem.d.ts +2 -1
  37. package/lib/components/FormComponents/DateItem/DateItem.js +5 -4
  38. package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -1
  39. package/lib/components/FormComponents/DateItem/DatePicker.d.ts +2 -0
  40. package/lib/components/FormComponents/DateItem/DatePicker.js +42 -0
  41. package/lib/components/FormComponents/DateItem/DatePicker.js.map +1 -0
  42. package/lib/components/FormComponents/DateItem/DatePickerField.d.ts +8 -0
  43. package/{src/components/FormComponents/Typography.styles.ts → lib/components/FormComponents/DateItem/DatePickerField.js} +8 -9
  44. package/lib/components/FormComponents/DateItem/DatePickerField.js.map +1 -0
  45. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.d.ts +2 -2
  46. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +5 -4
  47. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -1
  48. package/lib/components/FormComponents/DecimalItem/DecimalItem.d.ts +2 -2
  49. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +5 -4
  50. package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
  51. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.d.ts +1 -0
  52. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +2 -2
  53. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js.map +1 -1
  54. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.d.ts +2 -7
  55. package/lib/components/FormComponents/DisplayItem/DisplayItem.js +2 -2
  56. package/lib/components/FormComponents/DisplayItem/DisplayItem.js.map +1 -1
  57. package/lib/components/FormComponents/GridGroup/GridGroup.d.ts +2 -2
  58. package/lib/components/FormComponents/GridGroup/GridGroup.js +6 -4
  59. package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
  60. package/lib/components/FormComponents/GridGroup/GridRow.d.ts +2 -1
  61. package/lib/components/FormComponents/GridGroup/GridRow.js +2 -2
  62. package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -1
  63. package/lib/components/FormComponents/GridGroup/GridTable.d.ts +2 -1
  64. package/lib/components/FormComponents/GridGroup/GridTable.js +2 -2
  65. package/lib/components/FormComponents/GridGroup/GridTable.js.map +1 -1
  66. package/lib/components/FormComponents/GroupItem/GroupHeading.d.ts +1 -0
  67. package/lib/components/FormComponents/GroupItem/GroupHeading.js +6 -5
  68. package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
  69. package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +2 -3
  70. package/lib/components/FormComponents/GroupItem/GroupItem.js +5 -3
  71. package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
  72. package/lib/components/FormComponents/GroupItem/GroupItem.styles.d.ts +2 -6
  73. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.d.ts +2 -2
  74. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +10 -10
  75. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
  76. package/lib/components/FormComponents/IntegerItem/IntegerItem.d.ts +2 -2
  77. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +5 -4
  78. package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
  79. package/lib/components/FormComponents/Item.styles.d.ts +0 -4
  80. package/lib/components/FormComponents/Item.styles.js +0 -4
  81. package/lib/components/FormComponents/Item.styles.js.map +1 -1
  82. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +1 -0
  83. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +3 -3
  84. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
  85. package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +1 -0
  86. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +4 -6
  87. package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
  88. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +1 -0
  89. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +2 -2
  90. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
  91. package/lib/components/FormComponents/Lists.styles.d.ts +2 -9
  92. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +3 -2
  93. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +2 -3
  94. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -1
  95. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.d.ts +2 -2
  96. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +8 -7
  97. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
  98. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +2 -2
  99. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +8 -7
  100. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
  101. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +2 -2
  102. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +6 -6
  103. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
  104. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +2 -2
  105. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +7 -6
  106. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
  107. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +3 -2
  108. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +2 -2
  109. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -1
  110. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.d.ts +2 -2
  111. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +7 -6
  112. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
  113. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +3 -2
  114. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +2 -2
  115. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -1
  116. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.d.ts +2 -2
  117. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +8 -7
  118. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
  119. package/lib/components/FormComponents/RepeatGroup/AddItemButton.d.ts +1 -0
  120. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +2 -2
  121. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js.map +1 -1
  122. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +1 -0
  123. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +2 -2
  124. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +1 -1
  125. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +2 -2
  126. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +8 -6
  127. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
  128. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.d.ts +2 -2
  129. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +5 -3
  130. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
  131. package/lib/components/FormComponents/RepeatItem/AddItemButton.d.ts +1 -0
  132. package/lib/components/FormComponents/RepeatItem/AddItemButton.js +2 -2
  133. package/lib/components/FormComponents/RepeatItem/AddItemButton.js.map +1 -1
  134. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +1 -0
  135. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +2 -2
  136. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +1 -1
  137. package/lib/components/FormComponents/RepeatItem/RepeatField.d.ts +2 -2
  138. package/lib/components/FormComponents/RepeatItem/RepeatField.js +5 -3
  139. package/lib/components/FormComponents/RepeatItem/RepeatField.js.map +1 -1
  140. package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +2 -2
  141. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +6 -5
  142. package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
  143. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.d.ts +4 -18
  144. package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
  145. package/lib/components/FormComponents/SingleItem/SingleItem.js +4 -2
  146. package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
  147. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.d.ts +2 -2
  148. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +12 -12
  149. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  150. package/lib/components/FormComponents/StringItem/StringItem.d.ts +2 -2
  151. package/lib/components/FormComponents/StringItem/StringItem.js +5 -4
  152. package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
  153. package/lib/components/FormComponents/Tables/AddRowButton.d.ts +1 -0
  154. package/lib/components/FormComponents/Tables/AddRowButton.js +2 -2
  155. package/lib/components/FormComponents/Tables/AddRowButton.js.map +1 -1
  156. package/lib/components/FormComponents/Tables/DeleteRowButton.d.ts +1 -0
  157. package/lib/components/FormComponents/Tables/DeleteRowButton.js +2 -2
  158. package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +1 -1
  159. package/lib/components/FormComponents/Tables/GroupTable.d.ts +2 -2
  160. package/lib/components/FormComponents/Tables/GroupTable.js +8 -6
  161. package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
  162. package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +2 -1
  163. package/lib/components/FormComponents/Tables/GroupTableRow.js +2 -2
  164. package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
  165. package/lib/components/FormComponents/Tables/QItemGroupTable.js +5 -7
  166. package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +1 -1
  167. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +2 -2
  168. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +1 -1
  169. package/lib/components/FormComponents/TextItem/TextItem.d.ts +2 -2
  170. package/lib/components/FormComponents/TextItem/TextItem.js +5 -4
  171. package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
  172. package/lib/components/FormComponents/TimeItem/TimeItem.d.ts +2 -2
  173. package/lib/components/FormComponents/TimeItem/TimeItem.js +5 -4
  174. package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
  175. package/lib/components/FormComponents/UrlItem/UrlItem.d.ts +2 -2
  176. package/lib/components/FormComponents/UrlItem/UrlItem.js +5 -4
  177. package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
  178. package/lib/components/Lists.styles.d.ts +2 -9
  179. package/lib/components/Renderer/FormTopLevelItem.js +7 -5
  180. package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
  181. package/lib/components/Tabs/FormBodySingleTab.js +1 -1
  182. package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
  183. package/lib/components/Tabs/ShowCompletedTabsSection.js +1 -1
  184. package/lib/components/Tabs/ShowCompletedTabsSection.js.map +1 -1
  185. package/lib/hooks/useMinimalStringCalculatedExpression.d.ts +11 -0
  186. package/lib/hooks/useMinimalStringCalculatedExpression.js +37 -0
  187. package/lib/hooks/useMinimalStringCalculatedExpression.js.map +1 -0
  188. package/lib/hooks/useReadOnly.d.ts +3 -0
  189. package/lib/hooks/useReadOnly.js +26 -0
  190. package/lib/hooks/useReadOnly.js.map +1 -0
  191. package/lib/interfaces/calculatedExpression.interface.d.ts +1 -1
  192. package/lib/interfaces/renderProps.interface.d.ts +3 -0
  193. package/lib/theme/overrides/Typography.d.ts +13 -0
  194. package/lib/theme/overrides/Typography.js +31 -0
  195. package/lib/theme/overrides/Typography.js.map +1 -0
  196. package/lib/theme/typography.d.ts +0 -2
  197. package/lib/theme/typography.js +3 -5
  198. package/lib/theme/typography.js.map +1 -1
  199. package/lib/utils/calculatedExpression.d.ts +12 -0
  200. package/lib/utils/calculatedExpression.js +54 -8
  201. package/lib/utils/calculatedExpression.js.map +1 -1
  202. package/package.json +12 -12
  203. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +8 -5
  204. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +9 -6
  205. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +18 -7
  206. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +18 -7
  207. package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +17 -7
  208. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +9 -8
  209. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +10 -7
  210. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +3 -2
  211. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +14 -9
  212. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +3 -2
  213. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +12 -7
  214. package/src/components/FormComponents/DateItem/DateItem.tsx +8 -6
  215. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +8 -6
  216. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +7 -5
  217. package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +6 -2
  218. package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +2 -2
  219. package/src/components/FormComponents/GridGroup/GridGroup.tsx +13 -5
  220. package/src/components/FormComponents/GridGroup/GridRow.tsx +6 -2
  221. package/src/components/FormComponents/GridGroup/GridTable.tsx +6 -2
  222. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +12 -6
  223. package/src/components/FormComponents/GroupItem/GroupItem.tsx +8 -2
  224. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +27 -4
  225. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +7 -5
  226. package/src/components/FormComponents/Item.styles.ts +0 -5
  227. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +4 -3
  228. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +10 -5
  229. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +3 -2
  230. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +10 -4
  231. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +13 -7
  232. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +20 -9
  233. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +11 -2
  234. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +11 -8
  235. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +10 -4
  236. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +10 -5
  237. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +10 -4
  238. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +12 -7
  239. package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +3 -2
  240. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +3 -2
  241. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +17 -9
  242. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +13 -2
  243. package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +3 -2
  244. package/src/components/FormComponents/RepeatItem/DeleteItemButton.tsx +3 -2
  245. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +21 -3
  246. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +13 -6
  247. package/src/components/FormComponents/SingleItem/SingleItem.tsx +8 -2
  248. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +16 -2
  249. package/src/components/FormComponents/StringItem/StringItem.tsx +7 -5
  250. package/src/components/FormComponents/Tables/AddRowButton.tsx +3 -2
  251. package/src/components/FormComponents/Tables/DeleteRowButton.tsx +3 -2
  252. package/src/components/FormComponents/Tables/GroupTable.tsx +17 -6
  253. package/src/components/FormComponents/Tables/GroupTableRow.tsx +6 -2
  254. package/src/components/FormComponents/TextItem/TextItem.tsx +7 -5
  255. package/src/components/FormComponents/TimeItem/TimeItem.tsx +8 -6
  256. package/src/components/FormComponents/UrlItem/UrlItem.tsx +7 -5
  257. package/src/components/Renderer/FormTopLevelItem.tsx +9 -4
  258. package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
  259. package/src/components/Tabs/ShowCompletedTabsSection.tsx +1 -1
  260. package/src/hooks/useReadOnly.ts +30 -0
  261. package/src/interfaces/calculatedExpression.interface.ts +1 -1
  262. package/src/interfaces/renderProps.interface.ts +4 -0
  263. package/src/theme/typography.ts +3 -5
  264. package/src/utils/calculatedExpression.ts +68 -12
@@ -1,12 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledAlert: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
- children?: import("react").ReactNode;
4
- component?: import("react").ElementType<any> | undefined;
5
- ref?: import("react").Ref<unknown> | undefined;
6
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
7
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
+ export declare const StyledAlert: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
3
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
9
- }, ("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") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
10
5
  color: 'info' | 'error';
11
6
  }, {}, {}>;
12
7
  export declare const StyledNavItemIcon: import("@emotion/styled").StyledComponent<import("@mui/material/ListItemIcon").ListItemIconProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -1,29 +1,14 @@
1
1
  /// <reference types="react" />
2
- export declare const QGroupContainerBox: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
- children?: import("react").ReactNode;
4
- component?: import("react").ElementType<any> | undefined;
5
- ref?: import("react").Ref<unknown> | undefined;
6
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
7
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
+ export declare const QGroupContainerBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
3
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
9
- }, ("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") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
10
5
  cardElevation: number;
11
6
  isRepeated: boolean;
12
7
  }, {}, {}>;
13
- export declare const FullWidthFormComponentBox: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
14
- children?: import("react").ReactNode;
15
- component?: import("react").ElementType<any> | undefined;
16
- ref?: import("react").Ref<unknown> | undefined;
17
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
18
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
+ export declare const FullWidthFormComponentBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
9
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
20
- }, ("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") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
21
- export declare const FormTitleWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
22
- children?: import("react").ReactNode;
23
- component?: import("react").ElementType<any> | undefined;
24
- ref?: import("react").Ref<unknown> | undefined;
25
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
26
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
11
+ export declare const FormTitleWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
27
12
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
28
- }, ("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") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
13
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
29
14
  export declare const StyledFormControlLabel: import("@emotion/styled").StyledComponent<import("@mui/material/FormControlLabel").FormControlLabelProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
2
+ import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
3
3
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
- interface BooleanItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
4
+ interface BooleanItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
6
6
  qrItem: QuestionnaireResponseItem;
7
7
  }
@@ -21,10 +21,11 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
21
21
  import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
22
22
  import BooleanField from './BooleanField';
23
23
  import Box from '@mui/material/Box';
24
+ import useReadOnly from '../../../hooks/useReadOnly';
24
25
  function BooleanItem(props) {
25
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
26
- // Get additional rendering extensions
27
- const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
26
+ const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
27
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
28
+ const { displayInstructions } = useRenderingExtensions(qItem);
28
29
  // Init input value
29
30
  let checked = false;
30
31
  if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && qrItem.answer[0].valueBoolean) {
@@ -42,7 +43,7 @@ function BooleanItem(props) {
42
43
  return (React.createElement(BooleanField, { checked: checked, readOnly: readOnly, onCheckedChange: handleCheckedChange }));
43
44
  }
44
45
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-boolean-box" },
45
- React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
46
+ React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
46
47
  React.createElement(BooleanField, { checked: checked, readOnly: readOnly, onCheckedChange: handleCheckedChange }))));
47
48
  }
48
49
  export default BooleanItem;
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/BooleanItem/BooleanItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,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MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE;QACnD,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;KACzC;IAED,iBAAiB;IACjB,SAAS,mBAAmB,CAAC,UAAmB;QAC9C,cAAc,iCACT,iBAAiB,CAAC,KAAK,CAAC,KAC3B,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,IACtC,CAAC;IACL,CAAC;IAED,IAAI,QAAQ,EAAE;QACZ,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ;YACzC,oBAAC,YAAY,IAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,GAAI,CACxF,CACP,CAAC;KACH;IAED,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,YAAY,IAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,GAAI,CAC7F,CAAC;KACH;IACD,OAAO,CACL,oBAAC,yBAAyB,iBAAW,oBAAoB;QACvD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;YACvF,oBAAC,YAAY,IAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,GAAI,CAC9E,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface ChoiceAutocompleteItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
3
+ import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
+ interface ChoiceAutocompleteItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
6
6
  qrItem: QuestionnaireResponseItem;
7
7
  }
@@ -34,16 +34,17 @@ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
34
34
  import { AUTOCOMPLETE_DEBOUNCE_DURATION } from '../../../utils/debounce';
35
35
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
36
36
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
37
+ import useReadOnly from '../../../hooks/useReadOnly';
37
38
  function ChoiceAutocompleteItem(props) {
38
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
39
+ const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
39
40
  const qrChoice = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
40
41
  // Init input value
41
42
  let valueCoding;
42
43
  if (qrChoice.answer) {
43
44
  valueCoding = qrChoice.answer[0].valueCoding;
44
45
  }
45
- // Get additional rendering extensions
46
- const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
46
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
47
+ const { displayUnit, displayPrompt, displayInstructions, entryFormat } = useRenderingExtensions(qItem);
47
48
  const maxList = 10;
48
49
  const [input, setInput] = useState('');
49
50
  const debouncedInput = useDebounce(input, AUTOCOMPLETE_DEBOUNCE_DURATION);
@@ -79,10 +80,10 @@ function ChoiceAutocompleteItem(props) {
79
80
  return (React.createElement(FullWidthFormComponentBox, null,
80
81
  React.createElement(Grid, { container: true, columnSpacing: 6 },
81
82
  React.createElement(Grid, { item: true, xs: 5 },
82
- React.createElement(LabelWrapper, { qItem: qItem })),
83
+ React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
83
84
  React.createElement(Grid, { item: true, xs: 7 },
84
85
  choiceAutocomplete,
85
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
86
+ React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })))));
86
87
  }
87
88
  export default ChoiceAutocompleteItem;
88
89
  //# sourceMappingURL=ChoiceAutocompleteItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceAutocompleteItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAG5C,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,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AACjF,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,sBAAsB,MAAM,uCAA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AC,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,kBAAkB;gBACnB,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"ChoiceAutocompleteItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAG5C,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,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AACjF,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAO3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC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C,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC7C;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACb,kBAAkB;gBACnB,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAChF,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
3
3
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
- import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler, PropsWithTextShownAttribute } from '../../../interfaces/renderProps.interface';
5
- interface ChoiceCheckboxAnswerOptionItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithTextShownAttribute {
4
+ import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithTextShownAttribute } from '../../../interfaces/renderProps.interface';
5
+ interface ChoiceCheckboxAnswerOptionItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithTextShownAttribute, PropsWithParentIsReadOnlyAttribute {
6
6
  qItem: QuestionnaireItem;
7
7
  qrItem: QuestionnaireResponseItem;
8
8
  orientation: ChoiceItemOrientation;
@@ -23,13 +23,14 @@ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
23
23
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
24
24
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
25
25
  import ChoiceCheckboxAnswerValueSetFields from './ChoiceCheckboxAnswerOptionFields';
26
+ import useReadOnly from '../../../hooks/useReadOnly';
26
27
  function ChoiceCheckboxAnswerOptionItem(props) {
27
- const { qItem, qrItem, isRepeated, onQrItemChange, orientation, textShown = true } = props;
28
+ const { qItem, qrItem, orientation, isRepeated, textShown = true, parentIsReadOnly, onQrItemChange } = props;
28
29
  // Init input value
29
30
  const qrChoiceCheckbox = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
30
31
  const answers = qrChoiceCheckbox.answer ? qrChoiceCheckbox.answer : [];
31
- // Get additional rendering extensions
32
- const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
32
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
33
+ const { displayInstructions } = useRenderingExtensions(qItem);
33
34
  // Event handlers
34
35
  function handleCheckedChange(changedValue) {
35
36
  const answerOptions = qItem.answerOption;
@@ -44,14 +45,14 @@ function ChoiceCheckboxAnswerOptionItem(props) {
44
45
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-checkbox-answer-option-box" },
45
46
  React.createElement(Grid, { container: true, columnSpacing: 6 },
46
47
  React.createElement(Grid, { item: true, xs: 5 },
47
- React.createElement(LabelWrapper, { qItem: qItem })),
48
+ React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
48
49
  React.createElement(Grid, { item: true, xs: 7 },
49
50
  React.createElement(ChoiceCheckboxAnswerValueSetFields, { qItem: qItem, answers: answers, orientation: orientation, readOnly: readOnly, onCheckedChange: handleCheckedChange }),
50
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
51
+ React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })))));
51
52
  }
52
53
  return (React.createElement(React.Fragment, null,
53
54
  React.createElement(ChoiceCheckboxAnswerValueSetFields, { qItem: qItem, answers: answers, orientation: orientation, readOnly: readOnly, onCheckedChange: handleCheckedChange }),
54
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })));
55
+ React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })));
55
56
  }
56
57
  export default ChoiceCheckboxAnswerOptionItem;
57
58
  //# sourceMappingURL=ChoiceCheckboxAnswerOptionItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceCheckboxAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAGtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,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;AACzD,OAAO,kCAAkC,MAAM,oCAAoC,CAAC;AAWpF,SAAS,8BAA8B,CAAC,KAA0C;IAChF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAE3F,mBAAmB;IACnB,MAAM,gBAAgB,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvE,sCAAsC;IACtC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAExE,iBAAiB;IACjB,SAAS,mBAAmB,CAAC,YAAoB;QAC/C,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,aAAa;YAAE,OAAO,IAAI,CAAC;QAEhC,MAAM,uBAAuB,GAAG,uBAAuB,CACrD,YAAY,EACZ,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,UAAU,CACX,CAAC;QAEF,IAAI,uBAAuB,EAAE;YAC3B,cAAc,CAAC,uBAAuB,CAAC,CAAC;SACzC;IACH,CAAC;IAED,IAAI,SAAS,EAAE;QACb,OAAO,CACL,oBAAC,yBAAyB,iBAAW,0CAA0C;YAC7E,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;gBAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;oBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;gBACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;oBACd,oBAAC,kCAAkC,IACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,mBAAmB,GACpC;oBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;KACH;IAED,OAAO,CACL;QACE,oBAAC,kCAAkC,IACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,mBAAmB,GACpC;QACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAChE,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
1
+ {"version":3,"file":"ChoiceCheckboxAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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QAEF,IAAI,uBAAuB,EAAE;YAC3B,cAAc,CAAC,uBAAuB,CAAC,CAAC;SACzC;IACH,CAAC;IAED,IAAI,SAAS,EAAE;QACb,OAAO,CACL,oBAAC,yBAAyB,iBAAW,0CAA0C;YAC7E,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;gBAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;oBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC7C;gBACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;oBACd,oBAAC,kCAAkC,IACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,mBAAmB,GACpC;oBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAChF,CACF,CACmB,CAC7B,CAAC;KACH;IAED,OAAO,CACL;QACE,oBAAC,kCAAkC,IACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,mBAAmB,GACpC;QACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACpF,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
3
  import type { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
4
- import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler, PropsWithTextShownAttribute } from '../../../interfaces/renderProps.interface';
5
- interface ChoiceCheckboxAnswerValueSetItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithTextShownAttribute {
4
+ import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithTextShownAttribute } from '../../../interfaces/renderProps.interface';
5
+ interface ChoiceCheckboxAnswerValueSetItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithTextShownAttribute, PropsWithParentIsReadOnlyAttribute {
6
6
  qItem: QuestionnaireItem;
7
7
  qrItem: QuestionnaireResponseItem;
8
8
  orientation: ChoiceItemOrientation;
@@ -24,13 +24,14 @@ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
24
24
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
25
25
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
26
26
  import ChoiceCheckboxAnswerValueSetFields from './ChoiceCheckboxAnswerValueSetFields';
27
+ import useReadOnly from '../../../hooks/useReadOnly';
27
28
  function ChoiceCheckboxAnswerValueSetItem(props) {
28
- const { qItem, qrItem, orientation, isRepeated, textShown = true, onQrItemChange } = props;
29
+ const { qItem, qrItem, orientation, isRepeated, textShown = true, parentIsReadOnly, onQrItemChange } = props;
29
30
  // Init input value
30
31
  const qrChoiceCheckbox = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
31
32
  const answers = qrChoiceCheckbox.answer ? qrChoiceCheckbox.answer : [];
32
- // Get additional rendering extensions
33
- const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
33
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
34
+ const { displayInstructions } = useRenderingExtensions(qItem);
34
35
  // Get codings/options from valueSet
35
36
  const { codings, serverError } = useValueSetCodings(qItem);
36
37
  // Event handlers
@@ -46,14 +47,14 @@ function ChoiceCheckboxAnswerValueSetItem(props) {
46
47
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-checkbox-answer-value-set-box" },
47
48
  React.createElement(Grid, { container: true, columnSpacing: 6 },
48
49
  React.createElement(Grid, { item: true, xs: 5 },
49
- React.createElement(LabelWrapper, { qItem: qItem })),
50
+ React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
50
51
  React.createElement(Grid, { item: true, xs: 7 },
51
52
  React.createElement(ChoiceCheckboxAnswerValueSetFields, { codings: codings, answers: answers, orientation: orientation, readOnly: readOnly, serverError: serverError, onCheckedChange: handleCheckedChange }),
52
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
53
+ React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })))));
53
54
  }
54
55
  return (React.createElement(React.Fragment, null,
55
56
  React.createElement(ChoiceCheckboxAnswerValueSetFields, { codings: codings, answers: answers, orientation: orientation, readOnly: readOnly, serverError: serverError, onCheckedChange: handleCheckedChange }),
56
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })));
57
+ React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })));
57
58
  }
58
59
  export default ChoiceCheckboxAnswerValueSetItem;
59
60
  //# sourceMappingURL=ChoiceCheckboxAnswerValueSetItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,sBAAsB,MAAM,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AAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;gBACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;oBACd,oBAAC,kCAAkC,IACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,mBAAmB,GACpC;oBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;KACH;IAED,OAAO,CACL;QACE,oBAAC,kCAAkC,IACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,mBAAmB,GACpC;QACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAChE,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,gCAAgC,CAAC"}
1
+ {"version":3,"file":"ChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAO3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,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AAC;oBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC7C;gBACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;oBACd,oBAAC,kCAAkC,IACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,mBAAmB,GACpC;oBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAChF,CACF,CACmB,CAC7B,CAAC;KACH;IAED,OAAO,CACL;QACE,oBAAC,kCAAkC,IACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,mBAAmB,GACpC;QACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACpF,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,gCAAgC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
3
  import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler, PropsWithTextShownAttribute } from '../../../interfaces/renderProps.interface';
4
- interface ChoiceItemSwitcherProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithTextShownAttribute {
4
+ import type { PropsWithParentIsReadOnlyAttribute } from '../../../interfaces/renderProps.interface';
5
+ interface ChoiceItemSwitcherProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithTextShownAttribute, PropsWithParentIsReadOnlyAttribute {
5
6
  qItem: QuestionnaireItem;
6
7
  qrItem: QuestionnaireResponseItem;
7
8
  }
@@ -26,32 +26,32 @@ import ChoiceRadioAnswerValueSetItem from './ChoiceRadioAnswerValueSetItem';
26
26
  import ChoiceCheckboxAnswerValueSetItem from './ChoiceCheckboxAnswerValueSetItem';
27
27
  function ChoiceItemSwitcher(props) {
28
28
  var _a, _b;
29
- const { qItem, qrItem, isRepeated, isTabled, textShown, onQrItemChange } = props;
29
+ const { qItem, qrItem, isRepeated, isTabled, textShown, parentIsReadOnly, onQrItemChange } = props;
30
30
  const orientation = getChoiceOrientation(qItem);
31
31
  const choiceControlType = getChoiceControlType(qItem);
32
32
  switch (choiceControlType) {
33
33
  case ChoiceItemControl.Radio:
34
34
  if (qItem.answerOption) {
35
- return (React.createElement(ChoiceRadioAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, onQrItemChange: onQrItemChange, orientation: orientation }));
35
+ return (React.createElement(ChoiceRadioAnswerOptionItem, { qItem: qItem, qrItem: qrItem, orientation: orientation, isRepeated: isRepeated, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
36
36
  }
37
37
  else {
38
- return (React.createElement(ChoiceRadioAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, onQrItemChange: onQrItemChange, orientation: orientation }));
38
+ return (React.createElement(ChoiceRadioAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, orientation: orientation, isRepeated: isRepeated, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
39
39
  }
40
40
  case ChoiceItemControl.Checkbox:
41
41
  if (qItem.answerOption) {
42
- return (React.createElement(ChoiceCheckboxAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false, onQrItemChange: onQrItemChange, orientation: orientation, textShown: textShown }));
42
+ return (React.createElement(ChoiceCheckboxAnswerOptionItem, { qItem: qItem, qrItem: qrItem, orientation: orientation, isRepeated: (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false, textShown: textShown, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
43
43
  }
44
44
  else {
45
- return (React.createElement(ChoiceCheckboxAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_b = qItem.repeats) !== null && _b !== void 0 ? _b : false, onQrItemChange: onQrItemChange, orientation: orientation, textShown: textShown }));
45
+ return (React.createElement(ChoiceCheckboxAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: (_b = qItem.repeats) !== null && _b !== void 0 ? _b : false, orientation: orientation, textShown: textShown, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
46
46
  }
47
47
  case ChoiceItemControl.Autocomplete:
48
- return (React.createElement(ChoiceAutocompleteItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
48
+ return (React.createElement(ChoiceAutocompleteItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
49
49
  case ChoiceItemControl.Select:
50
50
  if (qItem.answerOption) {
51
- return (React.createElement(ChoiceSelectAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
51
+ return (React.createElement(ChoiceSelectAnswerOptionItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
52
52
  }
53
53
  else {
54
- return (React.createElement(ChoiceSelectAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
54
+ return (React.createElement(ChoiceSelectAnswerValueSetItem, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
55
55
  }
56
56
  default:
57
57
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceItemSwitcher.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAC5E,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAiBlF,SAAS,kBAAkB,CAAC,KAA8B;;IACxD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEjF,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAEtD,QAAQ,iBAAiB,EAAE;QACzB,KAAK,iBAAiB,CAAC,KAAK;YAC1B,IAAI,KAAK,CAAC,YAAY,EAAE;gBACtB,OAAO,CACL,oBAAC,2BAA2B,IAC1B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;aACH;i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CAAC,YAAY,EAAE;gBACtB,OAAO,CACL,oBAAC,4BAA4B,IAC3B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;aACH;iBAAM;gBACL,OAAO,CACL,oBAAC,8BAA8B,IAC7B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;aACH;QACH;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
3
3
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
- import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
5
- interface ChoiceRadioAnswerOptionItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
4
+ import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
5
+ interface ChoiceRadioAnswerOptionItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
6
6
  qItem: QuestionnaireItem;
7
7
  qrItem: QuestionnaireResponseItem;
8
8
  orientation: ChoiceItemOrientation;
@@ -23,13 +23,14 @@ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
23
23
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
24
24
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
25
25
  import ChoiceRadioAnswerOptionFields from './ChoiceRadioAnswerOptionFields';
26
+ import useReadOnly from '../../../hooks/useReadOnly';
26
27
  function ChoiceRadioAnswerOptionItem(props) {
27
- const { qItem, qrItem, isRepeated, onQrItemChange, orientation } = props;
28
+ const { qItem, qrItem, orientation, isRepeated, parentIsReadOnly, onQrItemChange } = props;
28
29
  // Init input value
29
30
  const qrChoiceRadio = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
30
31
  const valueRadio = getQrChoiceValue(qrChoiceRadio);
31
- // Get additional rendering extensions
32
- const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
32
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
33
+ const { displayInstructions } = useRenderingExtensions(qItem);
33
34
  // Event handlers
34
35
  function handleChange(newValue) {
35
36
  if (qItem.answerOption) {
@@ -39,17 +40,16 @@ function ChoiceRadioAnswerOptionItem(props) {
39
40
  }
40
41
  }
41
42
  }
42
- // TODO need to put in showText? in repopulate
43
43
  if (isRepeated) {
44
44
  return (React.createElement(ChoiceRadioAnswerOptionFields, { qItem: qItem, valueRadio: valueRadio, orientation: orientation, readOnly: readOnly, onCheckedChange: handleChange }));
45
45
  }
46
46
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-radio-answer-option-box" },
47
47
  React.createElement(Grid, { container: true, columnSpacing: 6 },
48
48
  React.createElement(Grid, { item: true, xs: 5 },
49
- React.createElement(LabelWrapper, { qItem: qItem })),
49
+ React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
50
50
  React.createElement(Grid, { item: true, xs: 7 },
51
51
  React.createElement(ChoiceRadioAnswerOptionFields, { qItem: qItem, valueRadio: valueRadio, orientation: orientation, readOnly: readOnly, onCheckedChange: handleChange }),
52
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
52
+ React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })))));
53
53
  }
54
54
  export default ChoiceRadioAnswerOptionItem;
55
55
  //# sourceMappingURL=ChoiceRadioAnswerOptionItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceRadioAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAGtC,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;AAK3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAU5E,SAAS,2BAA2B,CAAC,KAAuC;IAC1E,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;IACzD,MAAM,UAAU,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAEnD,sCAAsC;IACtC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAExE,iBAAiB;IACjB,SAAS,YAAY,CAAC,QAAgB;QACpC,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YACnE,IAAI,QAAQ,EAAE;gBACZ,cAAc,iCAAM,iBAAiB,CAAC,KAAK,CAAC,KAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAG,CAAC;aACrE;SACF;IACH,CAAC;IAED,8CAA8C;IAE9C,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,6BAA6B,IAC5B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,YAAY,GAC7B,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBAAW,uCAAuC;QAC1E,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,6BAA6B,IAC5B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,YAAY,GAC7B;gBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"ChoiceRadioAnswerOptionItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAGtC,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OA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C,yBAAyB,iBAAW,uCAAuC;QAC1E,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC7C;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,6BAA6B,IAC5B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,YAAY,GAC7B;gBACF,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAChF,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,2BAA2B,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
3
3
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
- import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
5
- interface ChoiceRadioAnswerValueSetItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
4
+ import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
5
+ interface ChoiceRadioAnswerValueSetItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
6
6
  qItem: QuestionnaireItem;
7
7
  qrItem: QuestionnaireResponseItem;
8
8
  orientation: ChoiceItemOrientation;
@@ -24,17 +24,18 @@ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
24
24
  import DisplayInstructions from '../DisplayItem/DisplayInstructions';
25
25
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
26
26
  import ChoiceRadioAnswerValueSetFields from './ChoiceRadioAnswerValueSetFields';
27
+ import useReadOnly from '../../../hooks/useReadOnly';
27
28
  function ChoiceRadioAnswerValueSetItem(props) {
28
29
  var _a, _b;
29
- const { qItem, qrItem, isRepeated, onQrItemChange, orientation } = props;
30
+ const { qItem, qrItem, orientation, isRepeated, parentIsReadOnly, onQrItemChange } = props;
31
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
32
+ const { displayInstructions } = useRenderingExtensions(qItem);
30
33
  // Init input value
31
34
  const qrChoiceRadio = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
32
35
  let valueRadio = null;
33
36
  if (qrChoiceRadio.answer) {
34
37
  valueRadio = (_b = (_a = qrChoiceRadio.answer[0].valueCoding) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : null;
35
38
  }
36
- // Get additional rendering extensions
37
- const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
38
39
  // Get codings/options from valueSet
39
40
  const { codings, serverError } = useValueSetCodings(qItem);
40
41
  function handleChange(newValue) {
@@ -51,10 +52,10 @@ function ChoiceRadioAnswerValueSetItem(props) {
51
52
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-radio-answer-value-set-box" },
52
53
  React.createElement(Grid, { container: true, columnSpacing: 6 },
53
54
  React.createElement(Grid, { item: true, xs: 5 },
54
- React.createElement(LabelWrapper, { qItem: qItem })),
55
+ React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
55
56
  React.createElement(Grid, { item: true, xs: 7 },
56
57
  React.createElement(ChoiceRadioAnswerValueSetFields, { qItem: qItem, codings: codings, valueRadio: valueRadio, orientation: orientation, readOnly: readOnly, serverError: serverError, onCheckedChange: handleChange }),
57
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
58
+ React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })))));
58
59
  }
59
60
  export default ChoiceRadioAnswerValueSetItem;
60
61
  //# sourceMappingURL=ChoiceRadioAnswerValueSetItem.js.map
@@ -1 +1 @@
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,sBA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ACmB,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;AAM3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAWrD,SAAS,6BAA6B,CAAC,KAAyC;;IAC9E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE3F,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,EAAE,mBAAmB,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAE9D,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,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IAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAChF,CACF,CACmB,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B,CAAC"}
@@ -4,6 +4,7 @@ import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps
4
4
  interface ChoiceSelectAnswerOptionFieldsProps extends PropsWithIsTabledAttribute {
5
5
  qItem: QuestionnaireItem;
6
6
  valueSelect: string;
7
+ readOnly: boolean;
7
8
  onSelectChange: (newValue: string) => void;
8
9
  }
9
10
  declare function ChoiceSelectAnswerOptionFields(props: ChoiceSelectAnswerOptionFieldsProps): React.JSX.Element;
@@ -21,8 +21,8 @@ import Select from '@mui/material/Select';
21
21
  import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
22
22
  function ChoiceSelectAnswerOptionFields(props) {
23
23
  var _a;
24
- const { qItem, valueSelect, isTabled, onSelectChange } = props;
25
- const { displayUnit, displayPrompt, readOnly, entryFormat } = useRenderingExtensions(qItem);
24
+ const { qItem, valueSelect, readOnly, isTabled, onSelectChange } = props;
25
+ const { displayUnit, displayPrompt, entryFormat } = useRenderingExtensions(qItem);
26
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
27
  var _a;
28
28
  if (option['valueCoding']) {
@@ -1 +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,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AC,OAAO,mCAAI,MAAM,CAAC,WAAW,CAAC,IAAI,CAC7C,CACZ,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;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
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;AAU3E,SAAS,8BAA8B,CAAC,KAA0C;;IAChF,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEzE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAElF,OAAO,CACL,oBAA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,IACtE,MAAM,CAAC,YAAY,CACX,CACZ,CAAC;SACH;QAED,OAAO,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,GAAI,CAAC;IAClC,CAAC,CAAC,CACK,CACV,CAAC;AACJ,CAAC;AAED,eAAe,8BAA8B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface ChoiceSelectAnswerOptionItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
3
+ import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
+ interface ChoiceSelectAnswerOptionItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
6
6
  qrItem: QuestionnaireResponseItem;
7
7
  }