@aehrc/smart-forms-renderer 0.30.2 → 0.31.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 (255) hide show
  1. package/README.md +6 -6
  2. package/lib/components/FormComponents/BooleanItem/BooleanField.js +5 -4
  3. package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
  4. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +5 -4
  5. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
  6. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +5 -4
  7. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
  8. package/lib/components/FormComponents/DateTimeItems/index.d.ts +1 -1
  9. package/lib/components/FormComponents/DateTimeItems/index.js +1 -1
  10. package/lib/components/FormComponents/DateTimeItems/index.js.map +1 -1
  11. package/lib/components/FormComponents/DateTimeItems/utils/parseDate.d.ts +5 -0
  12. package/lib/components/FormComponents/DateTimeItems/utils/parseDate.js +5 -0
  13. package/lib/components/FormComponents/DateTimeItems/utils/parseDate.js.map +1 -1
  14. package/lib/components/FormComponents/GridGroup/GridGroup.d.ts +6 -0
  15. package/lib/components/FormComponents/GridGroup/GridGroup.js +6 -0
  16. package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
  17. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +6 -0
  18. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +6 -0
  19. package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
  20. package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +5 -0
  21. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +5 -0
  22. package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
  23. package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +6 -0
  24. package/lib/components/FormComponents/SingleItem/SingleItem.js +6 -0
  25. package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
  26. package/lib/components/FormComponents/Tables/GroupTable.d.ts +6 -0
  27. package/lib/components/FormComponents/Tables/GroupTable.js +6 -0
  28. package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
  29. package/lib/components/FormComponents/index.d.ts +6 -6
  30. package/lib/components/FormComponents/index.js +6 -6
  31. package/lib/components/FormComponents/index.js.map +1 -1
  32. package/lib/components/Renderer/BaseRenderer.d.ts +7 -0
  33. package/lib/components/Renderer/BaseRenderer.js +7 -0
  34. package/lib/components/Renderer/BaseRenderer.js.map +1 -1
  35. package/lib/components/Renderer/SmartFormsRenderer.d.ts +22 -1
  36. package/lib/components/Renderer/SmartFormsRenderer.js +16 -6
  37. package/lib/components/Renderer/SmartFormsRenderer.js.map +1 -1
  38. package/lib/components/Renderer/index.d.ts +1 -0
  39. package/lib/components/Renderer/index.js.map +1 -1
  40. package/lib/components/index.d.ts +3 -2
  41. package/lib/components/index.js +2 -2
  42. package/lib/components/index.js.map +1 -1
  43. package/lib/hooks/index.d.ts +2 -0
  44. package/lib/hooks/index.js +2 -0
  45. package/lib/hooks/index.js.map +1 -1
  46. package/lib/hooks/useBuildForm.d.ts +15 -0
  47. package/lib/hooks/useBuildForm.js +41 -0
  48. package/lib/hooks/useBuildForm.js.map +1 -0
  49. package/lib/hooks/useHidden.d.ts +6 -0
  50. package/lib/hooks/useHidden.js +6 -0
  51. package/lib/hooks/useHidden.js.map +1 -1
  52. package/lib/hooks/useInitaliseFhirClient.d.ts +1 -0
  53. package/lib/hooks/useInitaliseFhirClient.js +55 -0
  54. package/lib/hooks/useInitaliseFhirClient.js.map +1 -0
  55. package/lib/hooks/useInitialiseForm.d.ts +20 -0
  56. package/lib/hooks/useInitialiseForm.js +72 -0
  57. package/lib/hooks/useInitialiseForm.js.map +1 -0
  58. package/lib/hooks/useInitialiseRenderer.d.ts +1 -1
  59. package/lib/hooks/useInitialiseRenderer.js +8 -31
  60. package/lib/hooks/useInitialiseRenderer.js.map +1 -1
  61. package/lib/hooks/useRendererQueryClient.d.ts +10 -0
  62. package/lib/hooks/useRendererQueryClient.js +36 -0
  63. package/lib/hooks/useRendererQueryClient.js.map +1 -0
  64. package/lib/hooks/useValueSetCodings.js +1 -0
  65. package/lib/hooks/useValueSetCodings.js.map +1 -1
  66. package/lib/index.d.ts +10 -40
  67. package/lib/index.js +8 -77
  68. package/lib/index.js.map +1 -1
  69. package/lib/interfaces/calculatedExpression.interface.d.ts +7 -0
  70. package/lib/interfaces/calculatedExpression.interface.js +16 -0
  71. package/lib/interfaces/calculatedExpression.interface.js.map +1 -1
  72. package/lib/interfaces/enableWhen.interface.d.ts +12 -0
  73. package/lib/interfaces/index.d.ts +4 -1
  74. package/lib/interfaces/index.js +16 -0
  75. package/lib/interfaces/index.js.map +1 -1
  76. package/lib/interfaces/populate.interface.d.ts +6 -0
  77. package/lib/interfaces/repopulateItems.interface.d.ts +0 -0
  78. package/lib/interfaces/repopulateItems.interface.js +2 -0
  79. package/lib/interfaces/repopulateItems.interface.js.map +1 -0
  80. package/lib/interfaces/tab.interface.d.ts +10 -0
  81. package/lib/interfaces/tab.interface.js +16 -0
  82. package/lib/interfaces/tab.interface.js.map +1 -1
  83. package/lib/interfaces/variables.interface.d.ts +12 -0
  84. package/lib/stores/index.d.ts +4 -0
  85. package/lib/stores/index.js.map +1 -1
  86. package/lib/stores/questionnaireResponseStore.d.ts +37 -2
  87. package/lib/stores/questionnaireResponseStore.js +72 -22
  88. package/lib/stores/questionnaireResponseStore.js.map +1 -1
  89. package/lib/stores/questionnaireStore.d.ts +59 -3
  90. package/lib/stores/questionnaireStore.js +18 -0
  91. package/lib/stores/questionnaireStore.js.map +1 -1
  92. package/lib/stores/smartConfigStore.d.ts +37 -0
  93. package/lib/stores/smartConfigStore.js +21 -0
  94. package/lib/stores/smartConfigStore.js.map +1 -1
  95. package/lib/stores/terminologyServerStore.d.ts +28 -2
  96. package/lib/stores/terminologyServerStore.js +16 -0
  97. package/lib/stores/terminologyServerStore.js.map +1 -1
  98. package/lib/stories/InitialiseFormWrapperForStorybook.d.ts +29 -0
  99. package/lib/stories/InitialiseFormWrapperForStorybook.js +65 -0
  100. package/lib/stories/InitialiseFormWrapperForStorybook.js.map +1 -0
  101. package/lib/stories/StorybookWrappers/BuildFormButtonForStorybook.d.ts +8 -0
  102. package/lib/stories/StorybookWrappers/BuildFormButtonForStorybook.js +44 -0
  103. package/lib/stories/StorybookWrappers/BuildFormButtonForStorybook.js.map +1 -0
  104. package/lib/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.d.ts +18 -0
  105. package/lib/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.js +48 -0
  106. package/lib/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.js.map +1 -0
  107. package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.d.ts +31 -0
  108. package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.js +67 -0
  109. package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.js.map +1 -0
  110. package/lib/stories/StorybookWrappers/PrePopButtonForStorybook.d.ts +7 -0
  111. package/lib/stories/StorybookWrappers/PrePopButtonForStorybook.js +32 -0
  112. package/lib/stories/StorybookWrappers/PrePopButtonForStorybook.js.map +1 -0
  113. package/lib/stories/StorybookWrappers/PrePopWrapperForStorybook.d.ts +21 -0
  114. package/lib/stories/StorybookWrappers/PrePopWrapperForStorybook.js +83 -0
  115. package/lib/stories/StorybookWrappers/PrePopWrapperForStorybook.js.map +1 -0
  116. package/lib/stories/StorybookWrappers/index.d.ts +3 -0
  117. package/lib/stories/StorybookWrappers/index.js +20 -0
  118. package/lib/stories/StorybookWrappers/index.js.map +1 -0
  119. package/lib/stories/StorybookWrappers/populateCallbackForStorybook.d.ts +8 -0
  120. package/lib/stories/StorybookWrappers/populateCallbackForStorybook.js +46 -0
  121. package/lib/stories/StorybookWrappers/populateCallbackForStorybook.js.map +1 -0
  122. package/lib/stories/index.d.ts +1 -0
  123. package/lib/stories/index.js +18 -0
  124. package/lib/stories/index.js.map +1 -0
  125. package/lib/theme/Theme.d.ts +8 -2
  126. package/lib/theme/Theme.js +8 -2
  127. package/lib/theme/Theme.js.map +1 -1
  128. package/lib/theme/index.d.ts +1 -0
  129. package/lib/theme/index.js +2 -0
  130. package/lib/theme/index.js.map +1 -0
  131. package/lib/utils/enableWhen.d.ts +1 -1
  132. package/lib/utils/enableWhenExpression.d.ts +1 -1
  133. package/lib/utils/fhirpath.d.ts +1 -1
  134. package/lib/utils/index.d.ts +5 -3
  135. package/lib/utils/index.js +4 -3
  136. package/lib/utils/index.js.map +1 -1
  137. package/lib/utils/initialise.d.ts +2 -2
  138. package/lib/utils/initialise.js +1 -1
  139. package/lib/utils/manageForm.d.ts +45 -0
  140. package/lib/utils/manageForm.js +101 -0
  141. package/lib/utils/manageForm.js.map +1 -0
  142. package/lib/utils/qItem.d.ts +1 -1
  143. package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.d.ts +1 -1
  144. package/lib/utils/removeEmptyAnswers.d.ts +1 -1
  145. package/lib/utils/repopulateIntoResponse.d.ts +6 -0
  146. package/lib/utils/repopulateIntoResponse.js +11 -0
  147. package/lib/utils/repopulateIntoResponse.js.map +1 -1
  148. package/lib/utils/repopulateItems.d.ts +19 -1
  149. package/lib/utils/repopulateItems.js +23 -0
  150. package/lib/utils/repopulateItems.js.map +1 -1
  151. package/lib/utils/tabs.d.ts +2 -2
  152. package/lib/utils/tabs.js +1 -1
  153. package/lib/utils/validateQuestionnaire.d.ts +0 -4
  154. package/lib/utils/validateQuestionnaire.js +9 -5
  155. package/lib/utils/validateQuestionnaire.js.map +1 -1
  156. package/package.json +1 -1
  157. package/src/components/FormComponents/BooleanItem/BooleanField.tsx +11 -9
  158. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +11 -9
  159. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +11 -9
  160. package/src/components/FormComponents/DateTimeItems/index.ts +1 -1
  161. package/src/components/FormComponents/DateTimeItems/utils/parseDate.ts +5 -0
  162. package/src/components/FormComponents/GridGroup/GridGroup.tsx +6 -0
  163. package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +6 -0
  164. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +5 -0
  165. package/src/components/FormComponents/SingleItem/SingleItem.tsx +6 -0
  166. package/src/components/FormComponents/Tables/GroupTable.tsx +6 -0
  167. package/src/components/FormComponents/index.ts +6 -6
  168. package/src/components/Renderer/BaseRenderer.tsx +7 -0
  169. package/src/components/Renderer/SmartFormsRenderer.tsx +34 -11
  170. package/src/components/Renderer/index.ts +1 -0
  171. package/src/components/index.ts +10 -2
  172. package/src/hooks/index.ts +2 -0
  173. package/src/hooks/useBuildForm.ts +58 -0
  174. package/src/hooks/useHidden.ts +6 -0
  175. package/src/hooks/useInitialiseForm.ts +93 -0
  176. package/src/hooks/{useQueryClient.ts → useRendererQueryClient.ts} +9 -2
  177. package/src/hooks/useValueSetCodings.ts +1 -0
  178. package/src/index.ts +59 -96
  179. package/src/interfaces/calculatedExpression.interface.ts +24 -0
  180. package/src/interfaces/enableWhen.interface.ts +12 -0
  181. package/src/interfaces/index.ts +21 -10
  182. package/src/interfaces/populate.interface.ts +6 -0
  183. package/src/interfaces/tab.interface.ts +12 -0
  184. package/src/interfaces/variables.interface.ts +12 -0
  185. package/src/stores/index.ts +7 -0
  186. package/src/stores/questionnaireResponseStore.ts +90 -19
  187. package/src/stores/questionnaireStore.ts +62 -2
  188. package/src/stores/smartConfigStore.ts +37 -0
  189. package/src/stores/terminologyServerStore.ts +28 -1
  190. package/src/stories/{BuildFormButtonForStorybook.tsx → StorybookWrappers/BuildFormButtonForStorybook.tsx} +12 -5
  191. package/src/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx +70 -0
  192. package/src/stories/{BuildFormWrapper.tsx → StorybookWrappers/BuildFormWrapperForStorybook.tsx} +11 -12
  193. package/src/stories/{BuildFormButtonTesterWrapper.tsx → StorybookWrappers/FormValidationTesterWrapperForStorybook.tsx} +22 -19
  194. package/src/stories/{useBuildFormForStorybook.ts → StorybookWrappers/FormValidationViewerForStorybook.tsx} +7 -16
  195. package/src/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.tsx +105 -0
  196. package/src/stories/{PrePopButtonForStorybook.tsx → StorybookWrappers/PrePopButtonForStorybook.tsx} +12 -10
  197. package/src/stories/{PrePopWrapper.tsx → StorybookWrappers/PrePopWrapperForStorybook.tsx} +22 -14
  198. package/src/stories/StorybookWrappers/ValidateFormButtonForStorybook.tsx +41 -0
  199. package/src/stories/StorybookWrappers/index.ts +20 -0
  200. package/src/stories/{populateCallbackForStorybook.ts → StorybookWrappers/populateCallbackForStorybook.ts} +8 -2
  201. package/src/stories/assets/questionnaires/QButtonTester.ts +380 -0
  202. package/src/stories/assets/questionnaires/QValidateTester.ts +118 -0
  203. package/src/stories/itemTypes/Attachment.stories.tsx +3 -3
  204. package/src/stories/itemTypes/Boolean.stories.tsx +3 -3
  205. package/src/stories/itemTypes/Choice.stories.tsx +3 -3
  206. package/src/stories/itemTypes/Date.stories.tsx +3 -3
  207. package/src/stories/itemTypes/DateTime.stories.tsx +3 -3
  208. package/src/stories/itemTypes/Decimal.stories.tsx +3 -3
  209. package/src/stories/itemTypes/Display.stories.tsx +3 -3
  210. package/src/stories/itemTypes/Group.stories.tsx +3 -3
  211. package/src/stories/itemTypes/Integer.stories.tsx +3 -3
  212. package/src/stories/itemTypes/OpenChoice.stories.tsx +3 -3
  213. package/src/stories/itemTypes/Quantity.stories.tsx +3 -3
  214. package/src/stories/itemTypes/Reference.stories.tsx +3 -3
  215. package/src/stories/itemTypes/String.stories.tsx +3 -3
  216. package/src/stories/itemTypes/Text.stories.tsx +3 -3
  217. package/src/stories/itemTypes/Time.stories.tsx +3 -3
  218. package/src/stories/itemTypes/Url.stories.tsx +3 -3
  219. package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +3 -3
  220. package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +3 -3
  221. package/src/stories/sdc/AdvancedOther.stories.tsx +3 -3
  222. package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +3 -3
  223. package/src/stories/sdc/BehaviorCalculations.stories.tsx +3 -3
  224. package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +3 -3
  225. package/src/stories/sdc/BehaviorOther.stories.tsx +3 -3
  226. package/src/stories/sdc/BehaviorValueConstraints.stories.tsx +3 -3
  227. package/src/stories/sdc/FormPopulation.stories.tsx +3 -3
  228. package/src/stories/sdc/ItemControlDisplay.stories.tsx +3 -3
  229. package/src/stories/sdc/ItemControlGroup.stories.tsx +3 -3
  230. package/src/stories/sdc/ItemControlQuestion.stories.tsx +3 -3
  231. package/src/stories/{rebuildForm/BuildFormTesterWrapper.stories.tsx → testing/BuildFormButtonTesterWrapper.stories.tsx} +6 -9
  232. package/src/stories/testing/PrePopButtonTesterWrapper.stories.tsx +45 -0
  233. package/src/stories/testing/ValidateFormTesterWrapper.stories.tsx +39 -0
  234. package/src/tests/enableWhen.test.ts +6 -2
  235. package/src/theme/Theme.tsx +8 -2
  236. package/src/theme/index.ts +1 -0
  237. package/src/utils/enableWhen.ts +1 -1
  238. package/src/utils/enableWhenExpression.ts +1 -1
  239. package/src/utils/fhirpath.ts +1 -1
  240. package/src/utils/index.ts +5 -7
  241. package/src/utils/initialise.ts +2 -2
  242. package/src/utils/manageForm.ts +110 -0
  243. package/src/utils/qItem.ts +1 -1
  244. package/src/utils/questionnaireStoreUtils/extractOtherExtensions.ts +1 -1
  245. package/src/utils/removeEmptyAnswers.ts +1 -1
  246. package/src/utils/repopulateIntoResponse.ts +17 -0
  247. package/src/utils/repopulateItems.ts +38 -1
  248. package/src/utils/tabs.ts +2 -2
  249. package/src/utils/validateQuestionnaire.ts +12 -17
  250. package/vite.config.ts +1 -1
  251. package/src/hooks/useInitialiseRenderer.ts +0 -114
  252. package/src/stories/assets/questionnaires/QBuildFormButtonTester.ts +0 -270
  253. package/src/stories/populateUtilsForStorybook.ts +0 -545
  254. package/src/utils/buildForm.ts +0 -23
  255. /package/.storybook/{preview.ts → preview.tsx} +0 -0
@@ -16,6 +16,16 @@
16
16
  */
17
17
  import { createStore } from 'zustand/vanilla';
18
18
  import { createSelectors } from './selector';
19
+ /**
20
+ * Smart Config state management store. This is only used for answerExpressions.
21
+ * It is recommended to manage the state of the FHIRClient, patient, user, and encounter in the parent application, since the renderer doesn't provide pre-population capabilities.
22
+ * Will be deprecated in version 1.0.0.
23
+ *
24
+ * This is the vanilla version of the store which can be used in non-React environments.
25
+ * @see {SmartConfigStoreType} for available properties and methods.
26
+ *
27
+ * @author Sean Fong
28
+ */
19
29
  export const smartConfigStore = createStore()((set) => ({
20
30
  client: null,
21
31
  patient: null,
@@ -26,5 +36,16 @@ export const smartConfigStore = createStore()((set) => ({
26
36
  setUser: (user) => set(() => ({ user: user })),
27
37
  setEncounter: (encounter) => set(() => ({ encounter: encounter }))
28
38
  }));
39
+ /**
40
+ * Smart Config state management store. This is only used for answerExpressions.
41
+ * It is recommended to manage the state of the FHIRClient, patient, user, and encounter in the parent application, since the renderer doesn't provide pre-population capabilities.
42
+ * Will be deprecated in version 1.0.0.
43
+ *
44
+ * This is the React version of the store which can be used as React hooks in React functional components.
45
+ * @see {SmartConfigStoreType} for available properties and methods.
46
+ * @see {smartConfigStore} for the vanilla store.
47
+ *
48
+ * @author Sean Fong
49
+ */
29
50
  export const useSmartConfigStore = createSelectors(smartConfigStore);
30
51
  //# sourceMappingURL=smartConfigStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"smartConfigStore.js","sourceRoot":"","sources":["../../src/stores/smartConfigStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAa7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,EAAwB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,UAAU,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,OAAO,EAAE,CAAC,IAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,YAAY,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;CAC9E,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"smartConfigStore.js","sourceRoot":"","sources":["../../src/stores/smartConfigStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA6B7C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,EAAwB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,UAAU,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,OAAO,EAAE,CAAC,IAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,YAAY,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;CAC9E,CAAC,CAAC,CAAC;AAEJ;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
@@ -1,9 +1,36 @@
1
- interface TerminologyServerStoreType {
1
+ /**
2
+ * TerminologyServerStore properties and methods
3
+ * Properties can be accessed for fine-grain details.
4
+ * Methods are usually used internally, using them from an external source is not recommended.
5
+ *
6
+ * @property url - The current terminology server URL
7
+ * @method setUrl - Set the terminology server URL
8
+ * @method resetUrl - Reset the terminology server URL to the default
9
+ *
10
+ * @author Sean Fong
11
+ */
12
+ export interface TerminologyServerStoreType {
2
13
  url: string;
3
14
  setUrl: (newUrl: string) => void;
4
15
  resetUrl: () => void;
5
16
  }
17
+ /**
18
+ * Terminology server state management store. This is used for resolving valueSets externally.
19
+ * Defaults to use https://r4.ontoserver.csiro.au/fhir.
20
+ * This is the vanilla version of the store which can be used in non-React environments.
21
+ * @see {TerminologyServerStoreType} for available properties and methods.
22
+ *
23
+ * @author Sean Fong
24
+ */
6
25
  export declare const terminologyServerStore: import("zustand/vanilla").StoreApi<TerminologyServerStoreType>;
26
+ /**
27
+ * Terminology server state management store. This is used for resolving valueSets externally.
28
+ * Defaults to use https://r4.ontoserver.csiro.au/fhir.
29
+ * This is the React version of the store which can be used as React hooks in React functional components.
30
+ * @see {TerminologyServerStoreType} for available properties and methods.
31
+ *
32
+ * @author Sean Fong
33
+ */
7
34
  export declare const useTerminologyServerStore: import("zustand/vanilla").StoreApi<TerminologyServerStoreType> & {
8
35
  use: {
9
36
  url: () => string;
@@ -11,4 +38,3 @@ export declare const useTerminologyServerStore: import("zustand/vanilla").StoreA
11
38
  resetUrl: () => () => void;
12
39
  };
13
40
  };
14
- export {};
@@ -17,10 +17,26 @@
17
17
  import { createStore } from 'zustand/vanilla';
18
18
  import { createSelectors } from './selector';
19
19
  const ONTOSERVER_R4 = 'https://r4.ontoserver.csiro.au/fhir';
20
+ /**
21
+ * Terminology server state management store. This is used for resolving valueSets externally.
22
+ * Defaults to use https://r4.ontoserver.csiro.au/fhir.
23
+ * This is the vanilla version of the store which can be used in non-React environments.
24
+ * @see {TerminologyServerStoreType} for available properties and methods.
25
+ *
26
+ * @author Sean Fong
27
+ */
20
28
  export const terminologyServerStore = createStore()((set) => ({
21
29
  url: ONTOSERVER_R4,
22
30
  setUrl: (newUrl) => set(() => ({ url: newUrl })),
23
31
  resetUrl: () => set(() => ({ url: ONTOSERVER_R4 }))
24
32
  }));
33
+ /**
34
+ * Terminology server state management store. This is used for resolving valueSets externally.
35
+ * Defaults to use https://r4.ontoserver.csiro.au/fhir.
36
+ * This is the React version of the store which can be used as React hooks in React functional components.
37
+ * @see {TerminologyServerStoreType} for available properties and methods.
38
+ *
39
+ * @author Sean Fong
40
+ */
25
41
  export const useTerminologyServerStore = createSelectors(terminologyServerStore);
26
42
  //# sourceMappingURL=terminologyServerStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"terminologyServerStore.js","sourceRoot":"","sources":["../../src/stores/terminologyServerStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAQ5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,EAA8B,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACxF,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACxD,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC;CACpD,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"terminologyServerStore.js","sourceRoot":"","sources":["../../src/stores/terminologyServerStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAmB5D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,EAA8B,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACxF,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACxD,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC;CACpD,CAAC,CAAC,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
3
+ import type Client from 'fhirclient/lib/Client';
4
+ interface InitialiseFormWrapperProps {
5
+ questionnaire: Questionnaire;
6
+ questionnaireResponse?: QuestionnaireResponse;
7
+ readOnly?: boolean;
8
+ terminologyServerUrl?: string;
9
+ additionalVariables?: Record<string, object>;
10
+ fhirClient?: Client;
11
+ }
12
+ /**
13
+ * This is a one-to-one replacement for the SmartFormsRenderer for demo purposes.
14
+ * Instead of using this React component, define your own wrapper component that uses the BaseRenderer directly.
15
+ * Things to note:
16
+ * - It is required to wrap the BaseRenderer with the QueryClientProvider to make requests.
17
+ * - You can wrap the BaseRenderer with the RendererThemeProvider to apply the default renderer theme used in Smart Forms. Optionally, you can define your own ThemeProvider.
18
+ * - Make your buildForm() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
19
+ * - Make your own initialiseFhirClient() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
20
+ * - The initialised FHIRClient is only used for further FHIR calls. It does not provide pre-population capabilities.
21
+ *
22
+ * For button click usage examples of buildForm(), see:
23
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/BuildFormButtonTesterWrapper.tsx#L47
24
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/BuildFormButtonForStorybook.tsx
25
+ *
26
+ * @author Sean Fong
27
+ */
28
+ declare function InitialiseFormWrapperForStorybook(props: InitialiseFormWrapperProps): React.JSX.Element;
29
+ export default InitialiseFormWrapperForStorybook;
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ // @ts-ignore
18
+ import React from 'react';
19
+ import { BaseRenderer } from '../components';
20
+ import { QueryClientProvider } from '@tanstack/react-query';
21
+ import RendererThemeProvider from '../theme/Theme';
22
+ import useRendererQueryClient from '../hooks/useRendererQueryClient';
23
+ import useInitialiseForm from '../hooks/useInitialiseForm';
24
+ import Box from '@mui/material/Box';
25
+ import CircularProgress from '@mui/material/CircularProgress';
26
+ import Typography from '@mui/material/Typography';
27
+ /**
28
+ * This is a one-to-one replacement for the SmartFormsRenderer for demo purposes.
29
+ * Instead of using this React component, define your own wrapper component that uses the BaseRenderer directly.
30
+ * Things to note:
31
+ * - It is required to wrap the BaseRenderer with the QueryClientProvider to make requests.
32
+ * - You can wrap the BaseRenderer with the RendererThemeProvider to apply the default renderer theme used in Smart Forms. Optionally, you can define your own ThemeProvider.
33
+ * - Make your buildForm() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
34
+ * - Make your own initialiseFhirClient() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
35
+ * - The initialised FHIRClient is only used for further FHIR calls. It does not provide pre-population capabilities.
36
+ *
37
+ * For button click usage examples of buildForm(), see:
38
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/BuildFormButtonTesterWrapper.tsx#L47
39
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/BuildFormButtonForStorybook.tsx
40
+ *
41
+ * @author Sean Fong
42
+ */
43
+ function InitialiseFormWrapperForStorybook(props) {
44
+ const { questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, fhirClient } = props;
45
+ // The renderer requires a @tanstack/react-query QueryClientProvider to make requests
46
+ const queryClient = useRendererQueryClient();
47
+ /**
48
+ * The useInitialiseForm hook provides initialisation logic for the form
49
+ * Alternatively (and recommended to do so), you can initialise your form via a button click or other event handler.
50
+ *
51
+ * @see {@link https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/BuildFormButtonForStorybook.tsx} for button click usage examples.
52
+ */
53
+ const isInitialising = useInitialiseForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, fhirClient);
54
+ // Free feel to customise your loading animation here
55
+ if (isInitialising) {
56
+ return (React.createElement(Box, { display: "flex", alignItems: "center", columnGap: 2 },
57
+ React.createElement(CircularProgress, null),
58
+ React.createElement(Typography, null, "Loading questionnaire...")));
59
+ }
60
+ return (React.createElement(RendererThemeProvider, null,
61
+ React.createElement(QueryClientProvider, { client: queryClient },
62
+ React.createElement(BaseRenderer, null))));
63
+ }
64
+ export default InitialiseFormWrapperForStorybook;
65
+ //# sourceMappingURL=InitialiseFormWrapperForStorybook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitialiseFormWrapperForStorybook.js","sourceRoot":"","sources":["../../src/stories/InitialiseFormWrapperForStorybook.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,aAAa;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,qBAAqB,MAAM,gBAAgB,CAAC;AACnD,OAAO,sBAAsB,MAAM,iCAAiC,CAAC;AAErE,OAAO,iBAAiB,MAAM,4BAA4B,CAAC;AAC3D,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAWlD;;;;;;;;;;;;;;;GAeG;AACH,SAAS,iCAAiC,CAAC,KAAiC;IAC1E,MAAM,EACJ,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACX,GAAG,KAAK,CAAC;IAEV,qFAAqF;IACrF,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C;;;;;OAKG;IACH,MAAM,cAAc,GAAG,iBAAiB,CACtC,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,CACX,CAAC;IAEF,qDAAqD;IACrD,IAAI,cAAc,EAAE;QAClB,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC;YAClD,oBAAC,gBAAgB,OAAG;YACpB,oBAAC,UAAU,mCAAsC,CAC7C,CACP,CAAC;KACH;IAED,OAAO,CACL,oBAAC,qBAAqB;QACpB,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;YACtC,oBAAC,YAAY,OAAG,CACI,CACA,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,iCAAiC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
3
+ interface BuildFormButtonProps {
4
+ questionnaire: Questionnaire;
5
+ questionnaireResponse?: QuestionnaireResponse;
6
+ }
7
+ declare function BuildFormButtonForStorybook(props: BuildFormButtonProps): React.JSX.Element;
8
+ export default BuildFormButtonForStorybook;
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ // @ts-ignore
27
+ import React from 'react';
28
+ import { Box, IconButton, Tooltip } from '@mui/material';
29
+ import Iconify from '../../components/Iconify/Iconify';
30
+ import { buildForm } from '../../utils';
31
+ function BuildFormButtonForStorybook(props) {
32
+ const { questionnaire, questionnaireResponse } = props;
33
+ function handleBuildForm() {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ yield buildForm(questionnaire, questionnaireResponse);
36
+ });
37
+ }
38
+ return (React.createElement(Box, { display: "flex", mb: 0.5, alignItems: "center", columnGap: 3 },
39
+ React.createElement(Tooltip, { title: "Build form with questionnaire response", placement: "right" },
40
+ React.createElement(IconButton, { onClick: handleBuildForm, size: "small", color: "primary" },
41
+ React.createElement(Iconify, { icon: "ph:hammer", sx: { mb: 0.5 } })))));
42
+ }
43
+ export default BuildFormButtonForStorybook;
44
+ //# sourceMappingURL=BuildFormButtonForStorybook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildFormButtonForStorybook.js","sourceRoot":"","sources":["../../../src/stories/StorybookWrappers/BuildFormButtonForStorybook.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,aAAa;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,OAAO,MAAM,kCAAkC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAOxC,SAAS,2BAA2B,CAAC,KAA2B;IAC9D,MAAM,EAAE,aAAa,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAEvD,SAAe,eAAe;;YAC5B,MAAM,SAAS,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;QACxD,CAAC;KAAA;IAED,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC;QAC3D,oBAAC,OAAO,IAAC,KAAK,EAAC,wCAAwC,EAAC,SAAS,EAAC,OAAO;YACvE,oBAAC,UAAU,IAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS;gBAChE,oBAAC,OAAO,IAAC,IAAI,EAAC,WAAW,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAI,CAClC,CACL,CACN,CACP,CAAC;AACJ,CAAC;AAED,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
3
+ interface BuildFormButtonTesterWrapperForStorybookProps {
4
+ questionnaire: Questionnaire;
5
+ questionnaireResponse?: QuestionnaireResponse;
6
+ }
7
+ /**
8
+ * This is a demo wrapper which initialises the BaseRenderer with the passed in questionnaire using useBuildForm.
9
+ * It also provides a button to build the form with the passed in questionnaire + questionnaireResponse.
10
+ * It was done as a two-step process for demo purposes.
11
+ *
12
+ * Use this pattern if you already have a pre-populated/pre-filled/draft response.
13
+ * If you want to pre-pop on the fly, see https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/PrePopWrapperForStorybook.tsx instead
14
+ *
15
+ * @author Sean Fong
16
+ */
17
+ declare function BuildFormButtonTesterWrapperForStorybook(props: BuildFormButtonTesterWrapperForStorybookProps): React.JSX.Element;
18
+ export default BuildFormButtonTesterWrapperForStorybook;
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ // @ts-ignore
18
+ import React from 'react';
19
+ import { BaseRenderer } from '../../components';
20
+ import { QueryClientProvider } from '@tanstack/react-query';
21
+ import { RendererThemeProvider } from '../../theme';
22
+ import { useBuildForm, useRendererQueryClient } from '../../hooks';
23
+ import BuildFormButtonForStorybook from './BuildFormButtonForStorybook';
24
+ /**
25
+ * This is a demo wrapper which initialises the BaseRenderer with the passed in questionnaire using useBuildForm.
26
+ * It also provides a button to build the form with the passed in questionnaire + questionnaireResponse.
27
+ * It was done as a two-step process for demo purposes.
28
+ *
29
+ * Use this pattern if you already have a pre-populated/pre-filled/draft response.
30
+ * If you want to pre-pop on the fly, see https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/PrePopWrapperForStorybook.tsx instead
31
+ *
32
+ * @author Sean Fong
33
+ */
34
+ function BuildFormButtonTesterWrapperForStorybook(props) {
35
+ const { questionnaire, questionnaireResponse } = props;
36
+ const queryClient = useRendererQueryClient();
37
+ const isBuilding = useBuildForm(questionnaire);
38
+ if (isBuilding) {
39
+ return React.createElement("div", null, "Loading...");
40
+ }
41
+ return (React.createElement(RendererThemeProvider, null,
42
+ React.createElement(QueryClientProvider, { client: queryClient },
43
+ React.createElement("div", null,
44
+ React.createElement(BuildFormButtonForStorybook, { questionnaire: questionnaire, questionnaireResponse: questionnaireResponse }),
45
+ React.createElement(BaseRenderer, null)))));
46
+ }
47
+ export default BuildFormButtonTesterWrapperForStorybook;
48
+ //# sourceMappingURL=BuildFormButtonTesterWrapperForStorybook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildFormButtonTesterWrapperForStorybook.js","sourceRoot":"","sources":["../../../src/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,aAAa;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AAOxE;;;;;;;;;GASG;AACH,SAAS,wCAAwC,CAC/C,KAAoD;IAEpD,MAAM,EAAE,aAAa,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAEvD,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C,MAAM,UAAU,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;IAE/C,IAAI,UAAU,EAAE;QACd,OAAO,8CAAqB,CAAC;KAC9B;IAED,OAAO,CACL,oBAAC,qBAAqB;QACpB,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;YACtC;gBACE,oBAAC,2BAA2B,IAC1B,aAAa,EAAE,aAAa,EAC5B,qBAAqB,EAAE,qBAAqB,GAC5C;gBACF,oBAAC,YAAY,OAAG,CACZ,CACc,CACA,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,wCAAwC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
3
+ import type Client from 'fhirclient/lib/Client';
4
+ interface InitialiseFormWrapperProps {
5
+ questionnaire: Questionnaire;
6
+ questionnaireResponse?: QuestionnaireResponse;
7
+ readOnly?: boolean;
8
+ terminologyServerUrl?: string;
9
+ additionalVariables?: Record<string, object>;
10
+ fhirClient?: Client;
11
+ }
12
+ /**
13
+ * This is a one-to-one replacement for the SmartFormsRenderer for demo purposes.
14
+ * Instead of using this React component, define your own wrapper component that uses the BaseRenderer directly.
15
+ * Things to note:
16
+ * - It is required to wrap the BaseRenderer with the QueryClientProvider to make requests.
17
+ * - You can wrap the BaseRenderer with the RendererThemeProvider to apply the default renderer theme used in Smart Forms. Optionally, you can define your own ThemeProvider.
18
+ * - Make your buildForm() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
19
+ * - Make your own initialiseFhirClient() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
20
+ * - The initialised FHIRClient is only used for further FHIR calls. It does not provide pre-population capabilities.
21
+ *
22
+ * For button click usage examples of buildForm(), see:
23
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx
24
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/BuildFormButtonForStorybook.tsx
25
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/PrePopWrapperForStorybook.tsx
26
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/PrePopButtonForStorybook.tsx
27
+ *
28
+ * @author Sean Fong
29
+ */
30
+ declare function InitialiseFormWrapperForStorybook(props: InitialiseFormWrapperProps): React.JSX.Element;
31
+ export default InitialiseFormWrapperForStorybook;
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ // @ts-ignore
18
+ import React from 'react';
19
+ import { BaseRenderer } from '../../components';
20
+ import { QueryClientProvider } from '@tanstack/react-query';
21
+ import RendererThemeProvider from '../../theme/Theme';
22
+ import useRendererQueryClient from '../../hooks/useRendererQueryClient';
23
+ import useInitialiseForm from '../../hooks/useInitialiseForm';
24
+ import Box from '@mui/material/Box';
25
+ import CircularProgress from '@mui/material/CircularProgress';
26
+ import Typography from '@mui/material/Typography';
27
+ /**
28
+ * This is a one-to-one replacement for the SmartFormsRenderer for demo purposes.
29
+ * Instead of using this React component, define your own wrapper component that uses the BaseRenderer directly.
30
+ * Things to note:
31
+ * - It is required to wrap the BaseRenderer with the QueryClientProvider to make requests.
32
+ * - You can wrap the BaseRenderer with the RendererThemeProvider to apply the default renderer theme used in Smart Forms. Optionally, you can define your own ThemeProvider.
33
+ * - Make your buildForm() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
34
+ * - Make your own initialiseFhirClient() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
35
+ * - The initialised FHIRClient is only used for further FHIR calls. It does not provide pre-population capabilities.
36
+ *
37
+ * For button click usage examples of buildForm(), see:
38
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx
39
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/BuildFormButtonForStorybook.tsx
40
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/PrePopWrapperForStorybook.tsx
41
+ * - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/PrePopButtonForStorybook.tsx
42
+ *
43
+ * @author Sean Fong
44
+ */
45
+ function InitialiseFormWrapperForStorybook(props) {
46
+ const { questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, fhirClient } = props;
47
+ // The renderer requires a @tanstack/react-query QueryClientProvider to make requests
48
+ const queryClient = useRendererQueryClient();
49
+ /**
50
+ * The useInitialiseForm hook provides initialisation logic for the form
51
+ * Alternatively (and recommended to do so), you can initialise your form via a button click or other event handler.
52
+ *
53
+ * @see {@link https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/BuildFormButtonForStorybook.tsx} for button click usage examples.
54
+ */
55
+ const isInitialising = useInitialiseForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, fhirClient);
56
+ // Free feel to customise your loading animation here
57
+ if (isInitialising) {
58
+ return (React.createElement(Box, { display: "flex", alignItems: "center", columnGap: 2 },
59
+ React.createElement(CircularProgress, null),
60
+ React.createElement(Typography, null, "Loading questionnaire...")));
61
+ }
62
+ return (React.createElement(RendererThemeProvider, null,
63
+ React.createElement(QueryClientProvider, { client: queryClient },
64
+ React.createElement(BaseRenderer, null))));
65
+ }
66
+ export default InitialiseFormWrapperForStorybook;
67
+ //# sourceMappingURL=InitialiseFormWrapperForStorybook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitialiseFormWrapperForStorybook.js","sourceRoot":"","sources":["../../../src/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,aAAa;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,qBAAqB,MAAM,mBAAmB,CAAC;AACtD,OAAO,sBAAsB,MAAM,oCAAoC,CAAC;AAExE,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAC9D,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAWlD;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,iCAAiC,CAAC,KAAiC;IAC1E,MAAM,EACJ,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACX,GAAG,KAAK,CAAC;IAEV,qFAAqF;IACrF,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C;;;;;OAKG;IACH,MAAM,cAAc,GAAG,iBAAiB,CACtC,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,CACX,CAAC;IAEF,qDAAqD;IACrD,IAAI,cAAc,EAAE;QAClB,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC;YAClD,oBAAC,gBAAgB,OAAG;YACpB,oBAAC,UAAU,mCAAsC,CAC7C,CACP,CAAC;KACH;IAED,OAAO,CACL,oBAAC,qBAAqB;QACpB,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;YACtC,oBAAC,YAAY,OAAG,CACI,CACA,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,iCAAiC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface PrePopButtonForStorybookProps {
3
+ isPopulating: boolean;
4
+ onPopulate: () => void;
5
+ }
6
+ declare function PrePopButtonForStorybook(props: PrePopButtonForStorybookProps): React.JSX.Element;
7
+ export default PrePopButtonForStorybook;
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ // @ts-ignore
18
+ import React from 'react';
19
+ import { Box, CircularProgress, Fade, IconButton, Tooltip } from '@mui/material';
20
+ import CloudDownloadIcon from '@mui/icons-material/CloudDownload';
21
+ import Typography from '@mui/material/Typography';
22
+ function PrePopButtonForStorybook(props) {
23
+ const { isPopulating, onPopulate } = props;
24
+ return (React.createElement(Box, { display: "flex", mb: 0.5, alignItems: "center", columnGap: 3 },
25
+ React.createElement(Tooltip, { title: "Pre-populate form", placement: "right" },
26
+ React.createElement("span", null,
27
+ React.createElement(IconButton, { disabled: isPopulating, onClick: onPopulate, size: "small", color: "primary" }, isPopulating ? (React.createElement(CircularProgress, { size: 20, color: "inherit", sx: { mb: 0.5 } })) : (React.createElement(CloudDownloadIcon, null))))),
28
+ isPopulating ? (React.createElement(Fade, { in: true, timeout: 100 },
29
+ React.createElement(Typography, { variant: "body2", color: "text.secondary" }, "Pre-populating form..."))) : null));
30
+ }
31
+ export default PrePopButtonForStorybook;
32
+ //# sourceMappingURL=PrePopButtonForStorybook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrePopButtonForStorybook.js","sourceRoot":"","sources":["../../../src/stories/StorybookWrappers/PrePopButtonForStorybook.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,aAAa;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAOlD,SAAS,wBAAwB,CAAC,KAAoC;IACpE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE3C,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC;QAC3D,oBAAC,OAAO,IAAC,KAAK,EAAC,mBAAmB,EAAC,SAAS,EAAC,OAAO;YAClD;gBACE,oBAAC,UAAU,IAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,IAClF,YAAY,CAAC,CAAC,CAAC,CACd,oBAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,SAAS,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAI,CAChE,CAAC,CAAC,CAAC,CACF,oBAAC,iBAAiB,OAAG,CACtB,CACU,CACR,CACC;QACT,YAAY,CAAC,CAAC,CAAC,CACd,oBAAC,IAAI,IAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG;YAC1B,oBAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,gBAAgB,6BAErC,CACR,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC;AACJ,CAAC;AAED,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { Patient, Practitioner, Questionnaire } from 'fhir/r4';
3
+ import type Client from 'fhirclient/lib/Client';
4
+ interface PrePopWrapperForStorybookProps {
5
+ questionnaire: Questionnaire;
6
+ fhirClient: Client;
7
+ patient: Patient;
8
+ user: Practitioner;
9
+ }
10
+ /**
11
+ * This is a demo wrapper which initialises the BaseRenderer with the passed in questionnaire using useBuildForm.
12
+ * It also provides a button to pre-populate the questionnaire on the fly using populateQuestionnaire() from '@aehrc/sdc-populate'.
13
+ * This does in-app population and you have to define your own callback function to retrieve resources from your source server.
14
+ *
15
+ * Use this pattern if you do not have a pre-populated/pre-filled/draft response and want to pre-populate on the fly.
16
+ * If you already have a questionnaireResponse, see https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx instead
17
+ *
18
+ * @author Sean Fong
19
+ */
20
+ declare function PrePopWrapperForStorybook(props: PrePopWrapperForStorybookProps): React.JSX.Element;
21
+ export default PrePopWrapperForStorybook;
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ // @ts-ignore
27
+ import React, { useState } from 'react';
28
+ import { BaseRenderer } from '../../components';
29
+ import { QueryClientProvider } from '@tanstack/react-query';
30
+ import { RendererThemeProvider } from '../../theme';
31
+ import { useBuildForm, useRendererQueryClient } from '../../hooks';
32
+ import PrePopButtonForStorybook from './PrePopButtonForStorybook';
33
+ import { populateQuestionnaire } from '@aehrc/sdc-populate';
34
+ import { fetchResourceCallback } from './populateCallbackForStorybook';
35
+ import { buildForm } from '../../utils';
36
+ /**
37
+ * This is a demo wrapper which initialises the BaseRenderer with the passed in questionnaire using useBuildForm.
38
+ * It also provides a button to pre-populate the questionnaire on the fly using populateQuestionnaire() from '@aehrc/sdc-populate'.
39
+ * This does in-app population and you have to define your own callback function to retrieve resources from your source server.
40
+ *
41
+ * Use this pattern if you do not have a pre-populated/pre-filled/draft response and want to pre-populate on the fly.
42
+ * If you already have a questionnaireResponse, see https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx instead
43
+ *
44
+ * @author Sean Fong
45
+ */
46
+ function PrePopWrapperForStorybook(props) {
47
+ const { questionnaire, fhirClient, patient, user } = props;
48
+ const [isPopulating, setIsPopulating] = useState(false);
49
+ const isBuilding = useBuildForm(questionnaire);
50
+ const queryClient = useRendererQueryClient();
51
+ function handlePrepopulate() {
52
+ setIsPopulating(true);
53
+ populateQuestionnaire({
54
+ questionnaire: questionnaire,
55
+ fetchResourceCallback: fetchResourceCallback,
56
+ requestConfig: {
57
+ clientEndpoint: fhirClient.state.serverUrl,
58
+ authToken: null
59
+ },
60
+ patient: patient,
61
+ user: user
62
+ }).then(({ populateSuccess, populateResult }) => __awaiter(this, void 0, void 0, function* () {
63
+ if (!populateSuccess || !populateResult) {
64
+ setIsPopulating(false);
65
+ return;
66
+ }
67
+ const { populatedResponse } = populateResult;
68
+ // Call to buildForm to pre-populate the QR which repaints the entire BaseRenderer view
69
+ yield buildForm(questionnaire, populatedResponse);
70
+ setIsPopulating(false);
71
+ }));
72
+ }
73
+ if (isBuilding) {
74
+ return React.createElement("div", null, "Loading...");
75
+ }
76
+ return (React.createElement(RendererThemeProvider, null,
77
+ React.createElement(QueryClientProvider, { client: queryClient },
78
+ React.createElement("div", null,
79
+ React.createElement(PrePopButtonForStorybook, { isPopulating: isPopulating, onPopulate: handlePrepopulate }),
80
+ isPopulating ? null : React.createElement(BaseRenderer, null)))));
81
+ }
82
+ export default PrePopWrapperForStorybook;
83
+ //# sourceMappingURL=PrePopWrapperForStorybook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrePopWrapperForStorybook.js","sourceRoot":"","sources":["../../../src/stories/StorybookWrappers/PrePopWrapperForStorybook.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,aAAa;AACb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC;;;;;;;;;GASG;AACH,SAAS,yBAAyB,CAAC,KAAqC;IACtE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE3D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExD,MAAM,UAAU,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C,SAAS,iBAAiB;QACxB,eAAe,CAAC,IAAI,CAAC,CAAC;QAEtB,qBAAqB,CAAC;YACpB,aAAa,EAAE,aAAa;YAC5B,qBAAqB,EAAE,qBAAqB;YAC5C,aAAa,EAAE;gBACb,cAAc,EAAE,UAAU,CAAC,KAAK,CAAC,SAAS;gBAC1C,SAAS,EAAE,IAAI;aAChB;YACD,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC,IAAI,CAAC,CAAO,EAAE,eAAe,EAAE,cAAc,EAAE,EAAE,EAAE;YACpD,IAAI,CAAC,eAAe,IAAI,CAAC,cAAc,EAAE;gBACvC,eAAe,CAAC,KAAK,CAAC,CAAC;gBACvB,OAAO;aACR;YAED,MAAM,EAAE,iBAAiB,EAAE,GAAG,cAAc,CAAC;YAE7C,uFAAuF;YACvF,MAAM,SAAS,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;YAElD,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;IAED,IAAI,UAAU,EAAE;QACd,OAAO,8CAAqB,CAAC;KAC9B;IAED,OAAO,CACL,oBAAC,qBAAqB;QACpB,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;YACtC;gBACE,oBAAC,wBAAwB,IAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,GAAI;gBACtF,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,YAAY,OAAG,CACnC,CACc,CACA,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as InitialiseFormWrapperForStorybook } from './InitialiseFormWrapperForStorybook';
2
+ export { default as BuildFormButtonTesterWrapperForStorybook } from './BuildFormButtonTesterWrapperForStorybook';
3
+ export { default as PrePopWrapperForStorybook } from './PrePopWrapperForStorybook';