@aehrc/smart-forms-renderer 0.8.0 → 0.9.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 (477) 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 +3 -3
  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 +3 -3
  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 +3 -3
  10. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +15 -14
  11. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +3 -3
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +15 -14
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +3 -3
  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 +3 -3
  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 +3 -3
  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 +3 -3
  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 +3 -3
  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/CustomDateItem/CustomDateField2.d.ts +18 -0
  37. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js +31 -0
  38. package/lib/components/FormComponents/CustomDateItem/CustomDateField2.js.map +1 -0
  39. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.d.ts +9 -0
  40. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js +68 -0
  41. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +1 -0
  42. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.d.ts +9 -0
  43. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js +75 -0
  44. package/lib/components/FormComponents/CustomDateItem/CustomDateTimeField.js.map +1 -0
  45. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.d.ts +9 -0
  46. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js +75 -0
  47. package/lib/components/FormComponents/CustomDateItem/CustomDateTimePickerText2.js.map +1 -0
  48. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.d.ts +18 -0
  49. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.js +33 -0
  50. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.js.map +1 -0
  51. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.d.ts +11 -0
  52. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.js +55 -0
  53. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.js.map +1 -0
  54. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.d.ts +9 -0
  55. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js +13 -0
  56. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.js.map +1 -0
  57. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.d.ts +5 -0
  58. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.js +20 -0
  59. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/MuiDatePicker.js.map +1 -0
  60. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.d.ts +5 -0
  61. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js +27 -0
  62. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/hooks/useParseDates.js.map +1 -0
  63. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.d.ts +1 -0
  64. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.js +18 -0
  65. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/index.js.map +1 -0
  66. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.d.ts +1 -0
  67. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js +18 -0
  68. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.js.map +1 -0
  69. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.d.ts +9 -0
  70. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.js +121 -0
  71. package/lib/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.js.map +1 -0
  72. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.d.ts +9 -0
  73. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js +71 -0
  74. package/lib/components/FormComponents/CustomDateItem/customDateTimePickerText.js.map +1 -0
  75. package/lib/components/FormComponents/CustomDateItem/index.d.ts +1 -0
  76. package/lib/components/FormComponents/CustomDateItem/index.js +18 -0
  77. package/lib/components/FormComponents/CustomDateItem/index.js.map +1 -0
  78. package/lib/components/FormComponents/DateItem/DateItem.d.ts +3 -3
  79. package/lib/components/FormComponents/DateItem/DateItem.js +5 -4
  80. package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -1
  81. package/lib/components/FormComponents/DateItem/DatePicker.d.ts +2 -0
  82. package/lib/components/FormComponents/DateItem/DatePicker.js +42 -0
  83. package/lib/components/FormComponents/DateItem/DatePicker.js.map +1 -0
  84. package/lib/components/FormComponents/DateItem/DatePickerField.d.ts +8 -0
  85. package/lib/components/FormComponents/DateItem/DatePickerField.js +24 -0
  86. package/lib/components/FormComponents/DateItem/DatePickerField.js.map +1 -0
  87. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.d.ts +3 -3
  88. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +5 -4
  89. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -1
  90. package/lib/components/FormComponents/DecimalItem/DecimalItem.d.ts +3 -3
  91. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +7 -7
  92. package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
  93. package/lib/components/FormComponents/DisplayItem/DisplayBox.d.ts +0 -0
  94. package/lib/components/FormComponents/DisplayItem/DisplayBox.js +2 -0
  95. package/lib/components/FormComponents/DisplayItem/DisplayBox.js.map +1 -0
  96. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.d.ts +4 -0
  97. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js +35 -0
  98. package/lib/components/FormComponents/DisplayItem/DisplayBox.styles.js.map +1 -0
  99. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.d.ts +3 -1
  100. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js +2 -2
  101. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.js.map +1 -1
  102. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.d.ts +2 -7
  103. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js +0 -1
  104. package/lib/components/FormComponents/DisplayItem/DisplayInstructions.styles.js.map +1 -1
  105. package/lib/components/FormComponents/DisplayItem/DisplayItem.js +2 -2
  106. package/lib/components/FormComponents/DisplayItem/DisplayItem.js.map +1 -1
  107. package/lib/components/FormComponents/GridGroup/GridGroup.d.ts +3 -3
  108. package/lib/components/FormComponents/GridGroup/GridGroup.js +16 -9
  109. package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
  110. package/lib/components/FormComponents/GridGroup/GridRow.d.ts +3 -3
  111. package/lib/components/FormComponents/GridGroup/GridRow.js +4 -4
  112. package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -1
  113. package/lib/components/FormComponents/GridGroup/GridTable.d.ts +3 -2
  114. package/lib/components/FormComponents/GridGroup/GridTable.js +9 -4
  115. package/lib/components/FormComponents/GridGroup/GridTable.js.map +1 -1
  116. package/lib/components/FormComponents/GridGroup/index.d.ts +1 -0
  117. package/lib/components/FormComponents/GridGroup/index.js +18 -0
  118. package/lib/components/FormComponents/GridGroup/index.js.map +1 -0
  119. package/lib/components/FormComponents/GroupItem/GroupHeading.d.ts +1 -0
  120. package/lib/components/FormComponents/GroupItem/GroupHeading.js +6 -5
  121. package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
  122. package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +3 -4
  123. package/lib/components/FormComponents/GroupItem/GroupItem.js +7 -5
  124. package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
  125. package/lib/components/FormComponents/GroupItem/GroupItem.styles.d.ts +2 -6
  126. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.d.ts +3 -3
  127. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +11 -12
  128. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
  129. package/lib/components/FormComponents/IntegerItem/IntegerItem.d.ts +3 -3
  130. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +7 -7
  131. package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
  132. package/lib/components/FormComponents/IntegerItem/SliderItem.d.ts +9 -0
  133. package/lib/components/FormComponents/IntegerItem/SliderItem.js +75 -0
  134. package/lib/components/FormComponents/IntegerItem/SliderItem.js.map +1 -0
  135. package/lib/components/FormComponents/Item.styles.d.ts +0 -4
  136. package/lib/components/FormComponents/Item.styles.js +0 -4
  137. package/lib/components/FormComponents/Item.styles.js.map +1 -1
  138. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +2 -2
  139. package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js.map +1 -1
  140. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +3 -2
  141. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +3 -3
  142. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
  143. package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +1 -0
  144. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +4 -6
  145. package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
  146. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +1 -0
  147. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +2 -2
  148. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
  149. package/lib/components/FormComponents/Lists.styles.d.ts +2 -9
  150. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +3 -2
  151. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +2 -3
  152. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -1
  153. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.d.ts +3 -3
  154. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +8 -7
  155. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
  156. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +3 -3
  157. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +16 -15
  158. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
  159. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +3 -3
  160. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +6 -6
  161. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
  162. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +3 -3
  163. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +7 -6
  164. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
  165. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +3 -2
  166. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +2 -2
  167. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -1
  168. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.d.ts +3 -3
  169. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +7 -6
  170. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
  171. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +3 -2
  172. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +2 -2
  173. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -1
  174. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.d.ts +3 -3
  175. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +8 -7
  176. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
  177. package/lib/components/FormComponents/RepeatGroup/AddItemButton.d.ts +1 -0
  178. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +2 -2
  179. package/lib/components/FormComponents/RepeatGroup/AddItemButton.js.map +1 -1
  180. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +1 -0
  181. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +2 -2
  182. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +1 -1
  183. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +2 -2
  184. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +20 -7
  185. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
  186. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.d.ts +2 -2
  187. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js +5 -3
  188. package/lib/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +1 -1
  189. package/lib/components/FormComponents/RepeatItem/AddItemButton.d.ts +1 -0
  190. package/lib/components/FormComponents/RepeatItem/AddItemButton.js +2 -2
  191. package/lib/components/FormComponents/RepeatItem/AddItemButton.js.map +1 -1
  192. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.d.ts +1 -0
  193. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js +2 -2
  194. package/lib/components/FormComponents/RepeatItem/DeleteItemButton.js.map +1 -1
  195. package/lib/components/FormComponents/RepeatItem/RepeatField.d.ts +3 -3
  196. package/lib/components/FormComponents/RepeatItem/RepeatField.js +5 -3
  197. package/lib/components/FormComponents/RepeatItem/RepeatField.js.map +1 -1
  198. package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +4 -3
  199. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +15 -5
  200. package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
  201. package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.d.ts +4 -18
  202. package/lib/components/FormComponents/RepeatItem/index.d.ts +1 -0
  203. package/lib/components/FormComponents/RepeatItem/index.js +18 -0
  204. package/lib/components/FormComponents/RepeatItem/index.js.map +1 -0
  205. package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +3 -3
  206. package/lib/components/FormComponents/SingleItem/SingleItem.js +4 -2
  207. package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
  208. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.d.ts +3 -3
  209. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +20 -15
  210. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  211. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.d.ts +4 -0
  212. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js +35 -0
  213. package/lib/components/FormComponents/SliderItem/DisplayBox.styles.js.map +1 -0
  214. package/lib/components/FormComponents/SliderItem/Slider.styles.d.ts +6 -0
  215. package/lib/components/FormComponents/SliderItem/Slider.styles.js +33 -0
  216. package/lib/components/FormComponents/SliderItem/Slider.styles.js.map +1 -0
  217. package/lib/components/FormComponents/SliderItem/SliderDisplayValue.d.ts +8 -0
  218. package/lib/components/FormComponents/SliderItem/SliderDisplayValue.js +28 -0
  219. package/lib/components/FormComponents/SliderItem/SliderDisplayValue.js.map +1 -0
  220. package/lib/components/FormComponents/SliderItem/SliderField.d.ts +16 -0
  221. package/lib/components/FormComponents/SliderItem/SliderField.js +41 -0
  222. package/lib/components/FormComponents/SliderItem/SliderField.js.map +1 -0
  223. package/lib/components/FormComponents/SliderItem/SliderItem.d.ts +9 -0
  224. package/lib/components/FormComponents/SliderItem/SliderItem.js +56 -0
  225. package/lib/components/FormComponents/SliderItem/SliderItem.js.map +1 -0
  226. package/lib/components/FormComponents/SliderItem/SliderLabels.d.ts +7 -0
  227. package/lib/components/FormComponents/SliderItem/SliderLabels.js +32 -0
  228. package/lib/components/FormComponents/SliderItem/SliderLabels.js.map +1 -0
  229. package/lib/components/FormComponents/StringItem/StringItem.d.ts +3 -3
  230. package/lib/components/FormComponents/StringItem/StringItem.js +5 -4
  231. package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
  232. package/lib/components/FormComponents/Tables/AddRowButton.d.ts +1 -0
  233. package/lib/components/FormComponents/Tables/AddRowButton.js +2 -2
  234. package/lib/components/FormComponents/Tables/AddRowButton.js.map +1 -1
  235. package/lib/components/FormComponents/Tables/DeleteRowButton.d.ts +1 -0
  236. package/lib/components/FormComponents/Tables/DeleteRowButton.js +2 -2
  237. package/lib/components/FormComponents/Tables/DeleteRowButton.js.map +1 -1
  238. package/lib/components/FormComponents/Tables/GroupTable.d.ts +4 -3
  239. package/lib/components/FormComponents/Tables/GroupTable.js +25 -6
  240. package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
  241. package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +3 -3
  242. package/lib/components/FormComponents/Tables/GroupTableRow.js +4 -4
  243. package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
  244. package/lib/components/FormComponents/Tables/QItemGroupTable.js +5 -7
  245. package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +1 -1
  246. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +2 -2
  247. package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +1 -1
  248. package/lib/components/FormComponents/TextItem/TextItem.d.ts +3 -3
  249. package/lib/components/FormComponents/TextItem/TextItem.js +5 -4
  250. package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
  251. package/lib/components/FormComponents/TimeItem/TimeItem.d.ts +3 -3
  252. package/lib/components/FormComponents/TimeItem/TimeItem.js +5 -4
  253. package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
  254. package/lib/components/FormComponents/UrlItem/UrlItem.d.ts +3 -3
  255. package/lib/components/FormComponents/UrlItem/UrlItem.js +5 -4
  256. package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
  257. package/lib/components/FormComponents/index.d.ts +3 -0
  258. package/lib/components/FormComponents/index.js +3 -0
  259. package/lib/components/FormComponents/index.js.map +1 -1
  260. package/lib/components/Lists.styles.d.ts +2 -9
  261. package/lib/components/Renderer/BaseRenderer.js +3 -5
  262. package/lib/components/Renderer/BaseRenderer.js.map +1 -1
  263. package/lib/components/Renderer/FormBodyCollapsible.d.ts +2 -2
  264. package/lib/components/Renderer/FormBodyCollapsible.js +6 -5
  265. package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -1
  266. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.d.ts +2 -2
  267. package/lib/components/Renderer/FormBodySingleCollapsibleWrapper.js.map +1 -1
  268. package/lib/components/Renderer/FormBodyTabbed.d.ts +2 -2
  269. package/lib/components/Renderer/FormBodyTabbed.js +6 -5
  270. package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
  271. package/lib/components/Renderer/FormTopLevelItem.d.ts +2 -2
  272. package/lib/components/Renderer/FormTopLevelItem.js +9 -5
  273. package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
  274. package/lib/components/Tabs/FormBodySingleTab.js +1 -1
  275. package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
  276. package/lib/components/Tabs/ShowCompletedTabsSection.js +1 -1
  277. package/lib/components/Tabs/ShowCompletedTabsSection.js.map +1 -1
  278. package/lib/hooks/useDateSeparatorValidation.d.ts +2 -0
  279. package/lib/hooks/useDateSeparatorValidation.js +25 -0
  280. package/lib/hooks/useDateSeparatorValidation.js.map +1 -0
  281. package/lib/hooks/useDateValidation.d.ts +2 -0
  282. package/lib/hooks/useDateValidation.js +61 -0
  283. package/lib/hooks/useDateValidation.js.map +1 -0
  284. package/lib/hooks/useDecimalCalculatedExpression.d.ts +0 -1
  285. package/lib/hooks/useDecimalCalculatedExpression.js +3 -3
  286. package/lib/hooks/useDecimalCalculatedExpression.js.map +1 -1
  287. package/lib/hooks/useInitialiseRepeatAnswers.d.ts +1 -1
  288. package/lib/hooks/useInitialiseRepeatAnswers.js.map +1 -1
  289. package/lib/hooks/useIntegerCalculatedExpression.d.ts +0 -1
  290. package/lib/hooks/useIntegerCalculatedExpression.js +3 -3
  291. package/lib/hooks/useIntegerCalculatedExpression.js.map +1 -1
  292. package/lib/hooks/useMinimalStringCalculatedExpression.d.ts +11 -0
  293. package/lib/hooks/useMinimalStringCalculatedExpression.js +37 -0
  294. package/lib/hooks/useMinimalStringCalculatedExpression.js.map +1 -0
  295. package/lib/hooks/useReadOnly.d.ts +3 -0
  296. package/lib/hooks/useReadOnly.js +26 -0
  297. package/lib/hooks/useReadOnly.js.map +1 -0
  298. package/lib/hooks/useSliderExtensions.d.ts +10 -0
  299. package/lib/hooks/useSliderExtensions.js +37 -0
  300. package/lib/hooks/useSliderExtensions.js.map +1 -0
  301. package/lib/hooks/useTerminologyServerQuery.js +0 -1
  302. package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
  303. package/lib/index.d.ts +3 -3
  304. package/lib/index.js +15 -6
  305. package/lib/index.js.map +1 -1
  306. package/lib/interfaces/calculatedExpression.interface.d.ts +1 -1
  307. package/lib/interfaces/index.d.ts +2 -0
  308. package/lib/interfaces/index.js +18 -0
  309. package/lib/interfaces/index.js.map +1 -0
  310. package/lib/interfaces/questionnaireStore.interface.d.ts +1 -0
  311. package/lib/interfaces/renderProps.interface.d.ts +7 -3
  312. package/lib/stores/useQuestionnaireStore.d.ts +1 -0
  313. package/lib/stores/useQuestionnaireStore.js +28 -12
  314. package/lib/stores/useQuestionnaireStore.js.map +1 -1
  315. package/lib/test.d.ts +4 -0
  316. package/lib/test.js +18 -0
  317. package/lib/test.js.map +1 -0
  318. package/lib/theme/customGlobalStyles.js +0 -4
  319. package/lib/theme/customGlobalStyles.js.map +1 -1
  320. package/lib/theme/overrides/Typography.d.ts +13 -0
  321. package/lib/theme/overrides/Typography.js +31 -0
  322. package/lib/theme/overrides/Typography.js.map +1 -0
  323. package/lib/theme/typography.d.ts +0 -2
  324. package/lib/theme/typography.js +3 -5
  325. package/lib/theme/typography.js.map +1 -1
  326. package/lib/utils/calculatedExpression.d.ts +17 -1
  327. package/lib/utils/calculatedExpression.js +71 -20
  328. package/lib/utils/calculatedExpression.js.map +1 -1
  329. package/lib/utils/dayjsExtend.d.ts +1 -0
  330. package/lib/utils/dayjsExtend.js +22 -0
  331. package/lib/utils/dayjsExtend.js.map +1 -0
  332. package/lib/utils/enableWhenExpression.d.ts +5 -1
  333. package/lib/utils/enableWhenExpression.js +26 -21
  334. package/lib/utils/enableWhenExpression.js.map +1 -1
  335. package/lib/utils/fhirpath.d.ts +3 -1
  336. package/lib/utils/fhirpath.js +25 -15
  337. package/lib/utils/fhirpath.js.map +1 -1
  338. package/lib/utils/index.d.ts +1 -0
  339. package/lib/utils/index.js +1 -0
  340. package/lib/utils/index.js.map +1 -1
  341. package/lib/utils/initialiseForm.d.ts +2 -0
  342. package/lib/utils/initialiseForm.js +13 -5
  343. package/lib/utils/initialiseForm.js.map +1 -1
  344. package/lib/utils/itemControl.d.ts +12 -0
  345. package/lib/utils/itemControl.js +30 -0
  346. package/lib/utils/itemControl.js.map +1 -1
  347. package/lib/utils/launchContext.d.ts +0 -0
  348. package/lib/utils/launchContext.js +2 -0
  349. package/lib/utils/launchContext.js.map +1 -0
  350. package/lib/utils/mapItem.d.ts +1 -1
  351. package/lib/utils/qrItem.d.ts +1 -7
  352. package/lib/utils/qrItem.js +1 -12
  353. package/lib/utils/qrItem.js.map +1 -1
  354. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +4 -2
  355. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
  356. package/lib/utils/removeHidden.js +2 -1
  357. package/lib/utils/removeHidden.js.map +1 -1
  358. package/lib/utils/repopulateIntoResponse.js +90 -29
  359. package/lib/utils/repopulateIntoResponse.js.map +1 -1
  360. package/lib/utils/repopulateItems.d.ts +14 -1
  361. package/lib/utils/repopulateItems.js +251 -70
  362. package/lib/utils/repopulateItems.js.map +1 -1
  363. package/lib/utils/repopulateRepeatGroup.js +9 -1
  364. package/lib/utils/repopulateRepeatGroup.js.map +1 -1
  365. package/lib/utils/slider.d.ts +28 -0
  366. package/lib/utils/slider.js +89 -0
  367. package/lib/utils/slider.js.map +1 -0
  368. package/package.json +20 -18
  369. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +10 -7
  370. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +11 -8
  371. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +46 -35
  372. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +48 -37
  373. package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +21 -11
  374. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +11 -10
  375. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +12 -9
  376. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +3 -2
  377. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +16 -11
  378. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +3 -2
  379. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +14 -9
  380. package/src/components/FormComponents/CustomDateItem/CustomDateItem.tsx +140 -0
  381. package/src/components/FormComponents/CustomDateItem/customDateTimePicker/CustomDateField.tsx +96 -0
  382. package/src/components/FormComponents/CustomDateItem/customDateTimePicker/DatePicker.tsx +81 -0
  383. package/src/components/FormComponents/CustomDateItem/customDateTimePicker/DatePickerButton.tsx +33 -0
  384. package/src/components/FormComponents/{Typography.styles.ts → CustomDateItem/customDateTimePicker/MuiDatePicker.ts} +4 -7
  385. package/src/components/FormComponents/CustomDateItem/customDateTimePicker/index.ts +18 -0
  386. package/src/components/FormComponents/CustomDateItem/customDateTimePicker/utils/index.ts +18 -0
  387. package/src/components/FormComponents/CustomDateItem/customDateTimePicker/utils/parseDates.ts +154 -0
  388. package/src/components/FormComponents/CustomDateItem/index.ts +18 -0
  389. package/src/components/FormComponents/DateItem/DateItem.tsx +10 -8
  390. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +10 -8
  391. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +11 -10
  392. package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts +0 -1
  393. package/src/components/FormComponents/DisplayItem/DisplayInstructions.tsx +8 -3
  394. package/src/components/FormComponents/DisplayItem/DisplayItem.tsx +2 -2
  395. package/src/components/FormComponents/GridGroup/GridGroup.tsx +49 -15
  396. package/src/components/FormComponents/GridGroup/GridRow.tsx +12 -7
  397. package/src/components/FormComponents/GridGroup/GridTable.tsx +32 -8
  398. package/src/components/FormComponents/GridGroup/index.ts +18 -0
  399. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +12 -6
  400. package/src/components/FormComponents/GroupItem/GroupItem.tsx +13 -8
  401. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +33 -11
  402. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +11 -10
  403. package/src/components/FormComponents/Item.styles.ts +0 -5
  404. package/src/components/FormComponents/ItemParts/FadingCheckIcon.tsx +2 -2
  405. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +6 -5
  406. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +10 -5
  407. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +3 -2
  408. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +10 -4
  409. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +15 -9
  410. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +58 -47
  411. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +15 -6
  412. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +13 -10
  413. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +10 -4
  414. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +12 -7
  415. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +10 -4
  416. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +14 -9
  417. package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +3 -2
  418. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +3 -2
  419. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +61 -10
  420. package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.tsx +23 -7
  421. package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +3 -2
  422. package/src/components/FormComponents/RepeatItem/DeleteItemButton.tsx +3 -2
  423. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +33 -9
  424. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +44 -7
  425. package/src/components/FormComponents/RepeatItem/index.ts +18 -0
  426. package/src/components/FormComponents/SingleItem/SingleItem.tsx +12 -6
  427. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +41 -11
  428. package/src/components/FormComponents/SliderItem/Slider.styles.ts +34 -0
  429. package/src/components/FormComponents/SliderItem/SliderDisplayValue.tsx +43 -0
  430. package/src/components/FormComponents/SliderItem/SliderField.tsx +88 -0
  431. package/src/components/FormComponents/SliderItem/SliderItem.tsx +115 -0
  432. package/src/components/FormComponents/SliderItem/SliderLabels.tsx +53 -0
  433. package/src/components/FormComponents/StringItem/StringItem.tsx +9 -7
  434. package/src/components/FormComponents/Tables/AddRowButton.tsx +3 -2
  435. package/src/components/FormComponents/Tables/DeleteRowButton.tsx +3 -2
  436. package/src/components/FormComponents/Tables/GroupTable.tsx +70 -7
  437. package/src/components/FormComponents/Tables/GroupTableRow.tsx +12 -7
  438. package/src/components/FormComponents/TextItem/TextItem.tsx +9 -7
  439. package/src/components/FormComponents/TimeItem/TimeItem.tsx +10 -8
  440. package/src/components/FormComponents/UrlItem/UrlItem.tsx +9 -7
  441. package/src/components/FormComponents/index.ts +3 -0
  442. package/src/components/Renderer/BaseRenderer.tsx +5 -12
  443. package/src/components/Renderer/FormBodyCollapsible.tsx +9 -7
  444. package/src/components/Renderer/FormBodySingleCollapsibleWrapper.tsx +2 -3
  445. package/src/components/Renderer/FormBodyTabbed.tsx +9 -7
  446. package/src/components/Renderer/FormTopLevelItem.tsx +21 -13
  447. package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
  448. package/src/components/Tabs/ShowCompletedTabsSection.tsx +1 -1
  449. package/src/hooks/useDateValidation.tsx +79 -0
  450. package/src/hooks/useDecimalCalculatedExpression.ts +3 -4
  451. package/src/hooks/useInitialiseRepeatAnswers.ts +1 -1
  452. package/src/hooks/useIntegerCalculatedExpression.ts +3 -4
  453. package/src/hooks/useReadOnly.ts +30 -0
  454. package/src/hooks/useSliderExtensions.ts +50 -0
  455. package/src/hooks/useTerminologyServerQuery.ts +0 -2
  456. package/src/index.ts +12 -9
  457. package/src/interfaces/calculatedExpression.interface.ts +1 -1
  458. package/src/interfaces/questionnaireStore.interface.ts +1 -0
  459. package/src/interfaces/renderProps.interface.ts +8 -3
  460. package/src/stores/useQuestionnaireStore.ts +39 -16
  461. package/src/theme/customGlobalStyles.tsx +0 -4
  462. package/src/theme/typography.ts +3 -5
  463. package/src/utils/calculatedExpression.ts +104 -35
  464. package/src/utils/dayjsExtend.ts +23 -0
  465. package/src/utils/enableWhenExpression.ts +49 -34
  466. package/src/utils/fhirpath.ts +50 -31
  467. package/src/utils/index.ts +1 -0
  468. package/src/utils/initialiseForm.ts +15 -5
  469. package/src/utils/itemControl.ts +32 -0
  470. package/src/utils/mapItem.ts +1 -1
  471. package/src/utils/qrItem.ts +1 -16
  472. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +4 -2
  473. package/src/utils/removeHidden.ts +2 -1
  474. package/src/utils/repopulateIntoResponse.ts +134 -43
  475. package/src/utils/repopulateItems.ts +379 -101
  476. package/src/utils/slider.ts +112 -0
  477. package/src/utils/repopulateRepeatGroup.ts +0 -68
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DateItem/DatePickerField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAOpD,SAAS,eAAe,CAAC,KAAsB;IAC7C,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAEvC,OAAO,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,CAAC;AAChG,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -1,9 +1,9 @@
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 DateTimeItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
4
+ interface DateTimeItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
7
  }
8
8
  declare function DateTimeItem(props: DateTimeItemProps): React.JSX.Element;
9
9
  export default DateTimeItem;
@@ -21,10 +21,11 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
21
21
  import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
22
22
  import DateTimeField from './DateTimeField';
23
23
  import dayjs from 'dayjs';
24
+ import useReadOnly from '../../../hooks/useReadOnly';
24
25
  function DateTimeItem(props) {
25
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
26
- // Get additional rendering extensions
27
- const { displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
26
+ const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
27
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
28
+ const { displayPrompt, displayInstructions, entryFormat } = useRenderingExtensions(qItem);
28
29
  // Init input value
29
30
  let dateTimeString = null;
30
31
  if (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) {
@@ -50,7 +51,7 @@ function DateTimeItem(props) {
50
51
  return (React.createElement(DateTimeField, { value: dateTimeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onDateTimeChange: handleDateTimeChange, isTabled: isTabled }));
51
52
  }
52
53
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-date-time-box" },
53
- React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
54
+ React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
54
55
  React.createElement(DateTimeField, { value: dateTimeDayJs, displayPrompt: displayPrompt, entryFormat: entryFormat, readOnly: readOnly, onDateTimeChange: handleDateTimeChange, isTabled: isTabled }))));
55
56
  }
56
57
  export default DateTimeItem;
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DateTimeItem/DateTimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,SAAS,YAAY,CAAC,KAAwB;IAC5C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EA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AAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,oBAAoB,EACtC,QAAQ,EAAE,QAAQ,GAClB,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -1,9 +1,9 @@
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 DecimalItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
4
+ interface DecimalItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
7
  }
8
8
  declare function DecimalItem(props: DecimalItemProps): React.JSX.Element;
9
9
  export default DecimalItem;
@@ -20,18 +20,19 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
20
20
  import useValidationError from '../../../hooks/useValidationError';
21
21
  import debounce from 'lodash.debounce';
22
22
  import { DEBOUNCE_DURATION } from '../../../utils/debounce';
23
- import { createEmptyQrItemWithUnit } from '../../../utils/qrItem';
23
+ import { createEmptyQrItem } from '../../../utils/qrItem';
24
24
  import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
25
25
  import DecimalField from './DecimalField';
26
26
  import { parseDecimalStringToFloat, parseDecimalStringWithPrecision } from '../../../utils/parseInputs';
27
27
  import { getDecimalPrecision } from '../../../utils/itemControl';
28
28
  import useDecimalCalculatedExpression from '../../../hooks/useDecimalCalculatedExpression';
29
29
  import useStringInput from '../../../hooks/useStringInput';
30
+ import useReadOnly from '../../../hooks/useReadOnly';
30
31
  function DecimalItem(props) {
31
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
32
- // Get additional rendering extensions
32
+ const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
33
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
33
34
  const precision = getDecimalPrecision(qItem);
34
- const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
35
+ const { displayUnit, displayPrompt, displayInstructions, entryFormat, regexValidation, maxLength } = useRenderingExtensions(qItem);
35
36
  // Init input value
36
37
  let valueDecimal = 0.0;
37
38
  let initialInput = '0';
@@ -51,7 +52,6 @@ function DecimalItem(props) {
51
52
  const { calcExpUpdated } = useDecimalCalculatedExpression({
52
53
  qItem: qItem,
53
54
  inputValue: input,
54
- displayUnit: displayUnit,
55
55
  precision: precision,
56
56
  setInputValue: (newInput) => {
57
57
  setInput(newInput);
@@ -66,7 +66,7 @@ function DecimalItem(props) {
66
66
  }
67
67
  // eslint-disable-next-line react-hooks/exhaustive-deps
68
68
  const updateQrItemWithDebounce = useCallback(debounce((parsedNewInput) => {
69
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItemWithUnit(qItem, displayUnit)), { answer: precision
69
+ onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: precision
70
70
  ? [{ valueDecimal: parseDecimalStringToFloat(parsedNewInput, precision) }]
71
71
  : [{ valueDecimal: parseFloat(parsedNewInput) }] }));
72
72
  }, DEBOUNCE_DURATION), [onQrItemChange, qItem, displayUnit, precision]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
@@ -74,7 +74,7 @@ function DecimalItem(props) {
74
74
  return (React.createElement(DecimalField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }));
75
75
  }
76
76
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-decimal-box" },
77
- React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions },
77
+ React.createElement(ItemFieldGrid, { qItem: qItem, displayInstructions: displayInstructions, readOnly: readOnly },
78
78
  React.createElement(DecimalField, { linkId: qItem.linkId, input: input, feedback: feedback, displayPrompt: displayPrompt, displayUnit: displayUnit, entryFormat: entryFormat, readOnly: readOnly, calcExpUpdated: calcExpUpdated, isTabled: isTabled, onInputChange: handleInputChange }))));
79
79
  }
80
80
  export default DecimalItem;
@@ -1 +1 @@
1
- {"version":3,"file":"DecimalItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DecimalItem/DecimalItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;AAC3F,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAU3D,SAAS,WAAW,CAAC,KAAuB;IAC1C,MA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yBAAyB,iBAAW,oBAAoB;QACvD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;YACvF,oBAAC,YAAY,IACX,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,iBAAiB,GAChC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=DisplayBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplayBox.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayBox.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledDisplayBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,35 @@
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 { styled } from '@mui/material/styles';
18
+ import { Box } from '@mui/material';
19
+ export const StyledDisplayBox = styled(Box)(({ theme }) => ({
20
+ display: 'flex',
21
+ alignItems: 'center',
22
+ padding: theme.spacing(0.5),
23
+ borderRadius: Number(theme.shape.borderRadius) * 1.5
24
+ // backgroundColor: alpha(
25
+ // color === 'error' ? theme.palette.error.light : theme.palette.info.light,
26
+ // 0.12
27
+ // ),
28
+ // [theme.breakpoints.up('sm')]: {
29
+ // padding: theme.spacing(1.5)
30
+ // },
31
+ // [theme.breakpoints.up('md')]: {
32
+ // padding: theme.spacing(2)
33
+ // }
34
+ }));
35
+ //# sourceMappingURL=DisplayBox.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplayBox.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayBox.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1D,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,GAAG;IACpD,0BAA0B;IAC1B,8EAA8E;IAC9E,SAAS;IACT,KAAK;IACL,kCAAkC;IAClC,gCAAgC;IAChC,KAAK;IACL,kCAAkC;IAClC,8BAA8B;IAC9B,IAAI;CACL,CAAC,CAAC,CAAC"}
@@ -1,6 +1,8 @@
1
+ import type { ReactElement } from 'react';
1
2
  import React from 'react';
2
3
  interface DisplayInstructionsProps {
3
- displayInstructions: string;
4
+ displayInstructions: string | ReactElement;
5
+ readOnly: boolean;
4
6
  }
5
7
  declare const DisplayInstructions: React.NamedExoticComponent<DisplayInstructionsProps>;
6
8
  export default DisplayInstructions;
@@ -18,9 +18,9 @@ import React, { memo } from 'react';
18
18
  import Typography from '@mui/material/Typography';
19
19
  import { DisplayInstructionsWrapper } from './DisplayInstructions.styles';
20
20
  const DisplayInstructions = memo(function DisplayInstructions(props) {
21
- const { displayInstructions } = props;
21
+ const { displayInstructions, readOnly } = props;
22
22
  return displayInstructions ? (React.createElement(DisplayInstructionsWrapper, null,
23
- React.createElement(Typography, { variant: "caption", fontSize: 10.5 }, displayInstructions))) : null;
23
+ React.createElement(Typography, { variant: "caption", fontSize: 10.5, color: readOnly ? 'text.secondary' : 'text.primary' }, displayInstructions))) : null;
24
24
  });
25
25
  export default DisplayInstructions;
26
26
  //# sourceMappingURL=DisplayInstructions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayInstructions.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAM1E,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,mBAAmB,CAAC,KAA+B;IAC3F,MAAM,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;IAEtC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAC3B,oBAAC,0BAA0B;QACzB,oBAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,QAAQ,EAAE,IAAI,IACzC,mBAAmB,CACT,CACc,CAC9B,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"DisplayInstructions.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAO1E,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,mBAAmB,CAAC,KAA+B;IAC3F,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEhD,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAC3B,oBAAC,0BAA0B;QACzB,oBAAC,UAAU,IACT,OAAO,EAAC,SAAS,EACjB,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,IAClD,mBAAmB,CACT,CACc,CAC9B,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const DisplayInstructionsWrapper: 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 DisplayInstructionsWrapper: 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>, {}, {}>;
@@ -18,7 +18,6 @@ import Box from '@mui/material/Box';
18
18
  import { styled } from '@mui/material/styles';
19
19
  export const DisplayInstructionsWrapper = styled(Box)(({ theme }) => ({
20
20
  color: theme.palette.text.secondary,
21
- textTransform: 'capitalize',
22
21
  marginBottom: '8px'
23
22
  }));
24
23
  //# sourceMappingURL=DisplayInstructions.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayInstructions.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACpE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;IACnC,aAAa,EAAE,YAAY;IAC3B,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"DisplayInstructions.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayInstructions.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACpE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;IACnC,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC,CAAC"}
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import React, { memo } from 'react';
18
18
  import { FullWidthFormComponentBox } from '../../Box.styles';
19
- import { isSpecificItemControl } from '../../../utils/itemControl';
19
+ import { isSpecificItemControl } from '../../../utils';
20
20
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
21
21
  const DisplayItem = memo(function DisplayItem(props) {
22
22
  const { qItem } = props;
@@ -25,7 +25,7 @@ const DisplayItem = memo(function DisplayItem(props) {
25
25
  return null;
26
26
  }
27
27
  return (React.createElement(FullWidthFormComponentBox, null,
28
- React.createElement(LabelWrapper, { qItem: qItem })));
28
+ React.createElement(LabelWrapper, { qItem: qItem, readOnly: false })));
29
29
  });
30
30
  export default DisplayItem;
31
31
  //# sourceMappingURL=DisplayItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAMzD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,WAAW,CAAC,KAAuB;IACnE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAExB,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACzE,IAAI,gBAAgB,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,oBAAC,yBAAyB;QACxB,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACJ,CAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"DisplayItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DisplayItem/DisplayItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAMzD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,WAAW,CAAC,KAAuB;IACnE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAExB,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACzE,IAAI,gBAAgB,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,oBAAC,yBAAyB;QACxB,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,GAAI,CACrB,CAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface GridGroupProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
3
+ import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
4
+ interface GridGroupProps extends PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
7
  groupCardElevation: number;
8
8
  }
9
9
  declare function GridGroup(props: GridGroupProps): React.JSX.Element | null;
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { useMemo } from 'react';
18
- import { createQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
18
+ import { createEmptyQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
19
19
  import useHidden from '../../../hooks/useHidden';
20
20
  import { QGroupContainerBox } from '../../Box.styles';
21
21
  import Divider from '@mui/material/Divider';
@@ -25,13 +25,15 @@ import Typography from '@mui/material/Typography';
25
25
  import { mapQItemsIndex } from '../../../utils/mapItem';
26
26
  import GridTable from './GridTable';
27
27
  import LabelWrapper from '../ItemParts/ItemLabelWrapper';
28
+ import useReadOnly from '../../../hooks/useReadOnly';
28
29
  function GridGroup(props) {
29
- const { qItem, qrItem, groupCardElevation, onQrItemChange } = props;
30
+ const { qItem, qrItem, groupCardElevation, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
30
31
  const qRowItems = qItem.item;
31
- const qrGroup = qrItem && qrItem.item ? qrItem : createQrGroup(qItem);
32
+ const qrGroup = qrItem && qrItem.item ? qrItem : createEmptyQrGroup(qItem);
32
33
  const qrRowItems = qrGroup.item;
33
34
  const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
34
35
  const columnLabels = useMemo(() => { var _a, _b; return (_b = (_a = qRowItems === null || qRowItems === void 0 ? void 0 : qRowItems[0].item) === null || _a === void 0 ? void 0 : _a.map((firstItem) => { var _a; return (_a = firstItem.text) !== null && _a !== void 0 ? _a : ' '; })) !== null && _b !== void 0 ? _b : []; }, [qRowItems]);
36
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
35
37
  const itemIsHidden = useHidden(qItem);
36
38
  if (itemIsHidden) {
37
39
  return null;
@@ -49,13 +51,18 @@ function GridGroup(props) {
49
51
  updateQrItemsInGroup(newQrItem, null, updatedQrGroup, qItemsIndexMap);
50
52
  onQrItemChange(updatedQrGroup);
51
53
  }
52
- return (React.createElement(React.Fragment, null,
53
- React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
54
- React.createElement(Typography, { fontSize: 13, variant: "h6" },
55
- React.createElement(LabelWrapper, { qItem: qItem })),
56
- React.createElement(Divider, { sx: { my: 1 }, light: true }),
54
+ if (showMinimalView) {
55
+ return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 1 },
57
56
  React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
58
- React.createElement(GridTable, { qItems: qRowItems, qrItems: qrRowItems, qItemsIndexMap: qItemsIndexMap, columnLabels: columnLabels, onQrItemChange: handleRowChange })))));
57
+ React.createElement(GridTable, { qItems: qRowItems, qrItems: qrRowItems, qItemsIndexMap: qItemsIndexMap, columnLabels: columnLabels, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleRowChange }))));
58
+ }
59
+ return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: false, py: 3 },
60
+ qItem.text ? (React.createElement(React.Fragment, null,
61
+ React.createElement(Typography, { fontSize: 13, variant: "h6", color: readOnly ? 'text.secondary' : 'text.primary' },
62
+ React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
63
+ React.createElement(Divider, { sx: { my: 1 }, light: true }))) : null,
64
+ React.createElement(TableContainer, { component: Paper, elevation: groupCardElevation },
65
+ React.createElement(GridTable, { qItems: qRowItems, qrItems: qrRowItems, qItemsIndexMap: qItemsIndexMap, columnLabels: columnLabels, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleRowChange }))));
59
66
  }
60
67
  export default GridGroup;
61
68
  //# sourceMappingURL=GridGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridGroup.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAk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KACtE;IAED,yCAAyC;IACzC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,OAAO,IAAI,CAAC;KACb;IAED,iBAAiB;IACjB,SAAS,eAAe,CAAC,SAAoC;QAC3D,MAAM,cAAc,qBAAmC,OAAO,CAAE,CAAC;QACjE,oBAAoB,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;QACtE,cAAc,CAAC,cAAc,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,CACL;QACE,oBAAC,kBAAkB,IAAC,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YAC7E,oBAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAC,IAAI;gBACpC,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACnB;YACb,oBAAC,OAAO,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,SAAG;YAEhC,oBAAC,cAAc,IAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,kBAAkB;gBAC7D,oBAAC,SAAS,IACR,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,eAAe,GAC/B,CACa,CACE,CACpB,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"GridGroup.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,kBAAkB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,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACvC;YACb,oBAAC,OAAO,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,SAAG,CAC/B,CACJ,CAAC,CAAC,CAAC,IAAI;QAER,oBAAC,cAAc,IAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,kBAAkB;YAC7D,oBAAC,SAAS,IACR,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,eAAe,GAC/B,CACa,CACE,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface GridRowProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
3
+ import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
+ interface GridRowProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
5
5
  qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
7
  columnLabels: string[];
8
8
  numOfColumns: number;
9
9
  }
@@ -15,16 +15,16 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { useMemo } from 'react';
18
- import { createQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
18
+ import { createEmptyQrGroup, updateQrItemsInGroup } from '../../../utils/qrItem';
19
19
  import { GridAnswerTableCell, GridTextTableCell } from '../Tables/Table.styles';
20
20
  import SingleItem from '../SingleItem/SingleItem';
21
21
  import { getQrItemsIndex, mapQItemsIndex } from '../../../utils/mapItem';
22
22
  import Typography from '@mui/material/Typography';
23
23
  import useHidden from '../../../hooks/useHidden';
24
24
  function GridRow(props) {
25
- const { qItem, qrItem, columnLabels, numOfColumns, onQrItemChange } = props;
25
+ const { qItem, qrItem, columnLabels, numOfColumns, parentIsReadOnly, onQrItemChange } = props;
26
26
  const rowQItems = qItem.item;
27
- const row = qrItem && qrItem.item ? qrItem : createQrGroup(qItem);
27
+ const row = qrItem && qrItem.item ? qrItem : createEmptyQrGroup(qItem);
28
28
  const rowQrItems = row.item;
29
29
  const qItemsIndexMap = useMemo(() => mapQItemsIndex(qItem), [qItem]);
30
30
  const itemIsHidden = useHidden(qItem);
@@ -53,7 +53,7 @@ function GridRow(props) {
53
53
  return null;
54
54
  }
55
55
  return (React.createElement(GridAnswerTableCell, { key: index, numOfColumns: numOfColumns },
56
- React.createElement(SingleItem, { qItem: cellQItem, qrItem: cellQrItem, isRepeated: true, isTabled: true, onQrItemChange: handleQrRowItemChange })));
56
+ React.createElement(SingleItem, { qItem: cellQItem, qrItem: cellQrItem !== null && cellQrItem !== void 0 ? cellQrItem : null, isRepeated: true, isTabled: true, showMinimalView: true, parentIsReadOnly: parentIsReadOnly, onQrItemChange: handleQrRowItemChange })));
57
57
  })));
58
58
  }
59
59
  export default GridRow;
@@ -1 +1 @@
1
- {"version":3,"file":"GridRow.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,UAAU,MAAM,0BAA0B,C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UAAU,IACT,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,EAC1B,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,EACd,eAAe,EAAE,IAAI,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,qBAAqB,GACrC,CACkB,CACvB,CAAC;QACJ,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface GridTableProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem> {
3
+ import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
+ import type { PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
5
+ interface GridTableProps extends PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
5
6
  qItems: QuestionnaireItem[];
6
7
  qrItems: QuestionnaireResponseItem[];
7
8
  qItemsIndexMap: Record<string, number>;
@@ -24,22 +24,27 @@ import { HeaderTableCell } from '../Tables/Table.styles';
24
24
  import GridRow from './GridRow';
25
25
  import { getQrItemsIndex } from '../../../utils/mapItem';
26
26
  function GridTable(props) {
27
- const { qItems, qrItems, qItemsIndexMap, columnLabels, onQrItemChange } = props;
27
+ const { qItems, qrItems, qItemsIndexMap, columnLabels, showMinimalView, parentIsReadOnly, onQrItemChange } = props;
28
28
  const qrItemsByIndex = getQrItemsIndex(qItems, qrItems, qItemsIndexMap);
29
29
  const numOfColumns = columnLabels.length;
30
- return (React.createElement(Table, null,
30
+ const minimalViewHeaderCellSx = showMinimalView ? { py: 2 } : null;
31
+ return (React.createElement(Table, { size: showMinimalView ? 'small' : 'medium' },
31
32
  React.createElement(TableHead, null,
32
33
  React.createElement(TableRow, null,
33
34
  React.createElement(HeaderTableCell, null),
34
- columnLabels.map((label) => (React.createElement(HeaderTableCell, { key: label }, label))),
35
+ columnLabels.map((label) => (React.createElement(HeaderTableCell, { key: label, size: "medium", sx: Object.assign({}, minimalViewHeaderCellSx) }, label))),
35
36
  React.createElement(TableCell, null))),
36
37
  React.createElement(TableBody, null, qItems.map((qItem, index) => {
37
38
  const qrItem = qrItemsByIndex[index];
38
39
  if (Array.isArray(qrItem)) {
39
40
  return null;
40
41
  }
42
+ // In minimal view, don't display items with no answers
43
+ if (showMinimalView && !qrItem) {
44
+ return null;
45
+ }
41
46
  return (React.createElement(TableRow, { key: qItem.linkId },
42
- React.createElement(GridRow, { qItem: qItem, qrItem: qrItem, columnLabels: columnLabels, numOfColumns: numOfColumns, onQrItemChange: onQrItemChange })));
47
+ React.createElement(GridRow, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, columnLabels: columnLabels, numOfColumns: numOfColumns, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
43
48
  }))));
44
49
  }
45
50
  export default GridTable;
@@ -1 +1 @@
1
- {"version":3,"file":"GridTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAUzD,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEhF,MAAM,cAAc,GAClB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IAEnD,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;IAEzC,OAAO,CACL,oBAAC,KAAK;QACJ,oBAAC,SAAS;YACR,oBAAC,QAAQ;gBACP,oBAAC,eAAe,OAAG;gBAClB,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC3B,oBAAC,eAAe,IAAC,GAAG,EAAE,KAAK,IAAG,KAAK,CAAmB,CACvD,CAAC;gBACF,oBAAC,SAAS,OAAG,CACJ,CACD;QACZ,oBAAC,SAAS,QACP,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC3B,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YAErC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACzB,OAAO,IAAI,CAAC;aACb;YAED,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,MAAM;gBACzB,oBAAC,OAAO,IACN,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACO,CACZ,CAAC;QACJ,CAAC,CAAC,CACQ,CACN,CACT,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"GridTable.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/GridTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,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AAC;YAErC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACzB,OAAO,IAAI,CAAC;aACb;YAED,uDAAuD;YACvD,IAAI,eAAe,IAAI,CAAC,MAAM,EAAE;gBAC9B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,MAAM;gBACzB,oBAAC,OAAO,IACN,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,GAC9B,CACO,CACZ,CAAC;QACJ,CAAC,CAAC,CACQ,CACN,CACT,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as GridGroup } from './GridGroup';
@@ -0,0 +1,18 @@
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
+ export { default as GridGroup } from './GridGroup';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GridGroup/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -3,6 +3,7 @@ import type { PropsWithIsRepeatedAttribute } from '../../../interfaces/renderPro
3
3
  import type { QuestionnaireItem } from 'fhir/r4';
4
4
  interface GroupHeadingProps extends PropsWithIsRepeatedAttribute {
5
5
  qItem: QuestionnaireItem;
6
+ readOnly: boolean;
6
7
  tabIsMarkedAsComplete?: boolean;
7
8
  }
8
9
  declare const GroupHeading: React.NamedExoticComponent<GroupHeadingProps>;
@@ -17,20 +17,21 @@
17
17
  import React, { memo } from 'react';
18
18
  import Box from '@mui/material/Box';
19
19
  import Divider from '@mui/material/Divider';
20
- import { QGroupHeadingTypography } from '../Typography.styles';
20
+ import Typography from '@mui/material/Typography';
21
21
  import { getContextDisplays } from '../../../utils/tabs';
22
22
  import ContextDisplayItem from '../ItemParts/ContextDisplayItem';
23
- import LabelText from '../ItemParts/ItemLabelText';
23
+ import ItemLabelText from '../ItemParts/ItemLabelText';
24
24
  const GroupHeading = memo(function GroupHeading(props) {
25
- const { qItem, tabIsMarkedAsComplete, isRepeated } = props;
25
+ const { qItem, readOnly, tabIsMarkedAsComplete, isRepeated } = props;
26
26
  const contextDisplayItems = getContextDisplays(qItem);
27
27
  if (isRepeated) {
28
28
  return null;
29
29
  }
30
+ const isTabHeading = tabIsMarkedAsComplete !== undefined;
30
31
  return (React.createElement(React.Fragment, null,
31
32
  React.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "space-between" },
32
- React.createElement(QGroupHeadingTypography, { variant: "h6", isTabHeading: tabIsMarkedAsComplete !== undefined },
33
- React.createElement(LabelText, { qItem: qItem })),
33
+ React.createElement(Typography, { variant: "h6", fontSize: isTabHeading ? 16 : 15, color: readOnly && !isTabHeading ? 'text.secondary' : 'text.primary' },
34
+ React.createElement(ItemLabelText, { qItem: qItem })),
34
35
  React.createElement(Box, { display: "flex", columnGap: 0.5 }, contextDisplayItems.map((item) => {
35
36
  return React.createElement(ContextDisplayItem, { key: item.linkId, displayItem: item });
36
37
  }))),
@@ -1 +1 @@
1
-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C,gBAAgB,CAAC,CAAC,CAAC,cAAc;gBACpE,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,GAAI,CACpB;YAEb,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,GAAG,IAC/B,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBAChC,OAAO,oBAAC,kBAAkB,IAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,GAAI,CAAC;YACrE,CAAC,CAAC,CACE,CACF;QACL,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,OAAO,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,SAAG,CAAC,CAAC,CAAC,IAAI,CAC7D,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -1,15 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
3
+ import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
4
  import type { Tabs } from '../../../interfaces/tab.interface';
5
- interface GroupItemProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
5
+ interface GroupItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute {
6
6
  qItem: QuestionnaireItem;
7
- qrItem: QuestionnaireResponseItem;
7
+ qrItem: QuestionnaireResponseItem | null;
8
8
  groupCardElevation: number;
9
9
  tabIsMarkedAsComplete?: boolean;
10
10
  tabs?: Tabs;
11
11
  currentTabIndex?: number;
12
- goToNextTab?: (nextTabIndex: number) => unknown;
13
12
  }
14
13
  declare function GroupItem(props: GroupItemProps): React.JSX.Element | null;
15
14
  export default GroupItem;