@aehrc/smart-forms-renderer 0.31.2 → 0.31.4
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.
- package/lib/components/Renderer/SmartFormsRenderer.d.ts +1 -1
- package/lib/components/Renderer/SmartFormsRenderer.js +1 -1
- package/lib/hooks/useBuildForm.d.ts +1 -1
- package/lib/hooks/useBuildForm.js +1 -1
- package/lib/hooks/useInitialiseForm.d.ts +1 -1
- package/lib/hooks/useInitialiseForm.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/stores/questionnaireResponseStore.d.ts +3 -3
- package/lib/stores/questionnaireResponseStore.js +3 -3
- package/lib/stores/questionnaireStore.d.ts +3 -3
- package/lib/stores/questionnaireStore.js +3 -3
- package/lib/stores/smartConfigStore.d.ts +3 -3
- package/lib/stores/smartConfigStore.js +3 -3
- package/lib/stores/terminologyServerStore.d.ts +2 -2
- package/lib/stores/terminologyServerStore.js +2 -2
- package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.d.ts +1 -1
- package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.js +1 -1
- package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.js.map +1 -1
- package/lib/stories/StorybookWrappers/index.d.ts +0 -2
- package/lib/stories/StorybookWrappers/index.js +0 -2
- package/lib/stories/StorybookWrappers/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Renderer/SmartFormsRenderer.tsx +1 -1
- package/src/hooks/useBuildForm.ts +1 -1
- package/src/hooks/useInitialiseForm.ts +1 -1
- package/src/index.ts +3 -0
- package/src/stores/questionnaireResponseStore.ts +3 -3
- package/src/stores/questionnaireStore.ts +3 -3
- package/src/stores/smartConfigStore.ts +3 -3
- package/src/stores/terminologyServerStore.ts +2 -2
- package/src/stories/storybookWrappers/InitialiseFormWrapperForStorybook.tsx +1 -1
- package/src/stories/storybookWrappers/index.ts +0 -2
|
@@ -26,7 +26,7 @@ export interface SmartFormsRendererProps {
|
|
|
26
26
|
* Will be deprecated in version 1.0.0. For alternative usage, see:
|
|
27
27
|
* - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.tsx#L40-L51
|
|
28
28
|
*
|
|
29
|
-
* @see
|
|
29
|
+
* @see SmartFormsRendererProps for props.
|
|
30
30
|
*
|
|
31
31
|
* @author Sean Fong
|
|
32
32
|
*/
|
|
@@ -29,7 +29,7 @@ import BaseRenderer from './BaseRenderer';
|
|
|
29
29
|
* Will be deprecated in version 1.0.0. For alternative usage, see:
|
|
30
30
|
* - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.tsx#L40-L51
|
|
31
31
|
*
|
|
32
|
-
* @see
|
|
32
|
+
* @see SmartFormsRendererProps for props.
|
|
33
33
|
*
|
|
34
34
|
* @author Sean Fong
|
|
35
35
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
2
2
|
/**
|
|
3
3
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
4
|
-
* @see
|
|
4
|
+
* @see buildForm() for more information.
|
|
5
5
|
*
|
|
6
6
|
* @param questionnaire - Questionnaire to be rendered
|
|
7
7
|
* @param questionnaireResponse - Pre-populated/draft/loaded QuestionnaireResponse to be rendered (optional)
|
|
@@ -18,7 +18,7 @@ import { useLayoutEffect, useState } from 'react';
|
|
|
18
18
|
import { buildForm } from '../utils';
|
|
19
19
|
/**
|
|
20
20
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
21
|
-
* @see
|
|
21
|
+
* @see buildForm() for more information.
|
|
22
22
|
*
|
|
23
23
|
* @param questionnaire - Questionnaire to be rendered
|
|
24
24
|
* @param questionnaireResponse - Pre-populated/draft/loaded QuestionnaireResponse to be rendered (optional)
|
|
@@ -12,7 +12,7 @@ import type Client from 'fhirclient/lib/Client';
|
|
|
12
12
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
13
13
|
* @param fhirClient - FHIRClient object to perform further FHIR calls. At the moment it's only used in answerExpressions (optional)
|
|
14
14
|
*
|
|
15
|
-
* @see
|
|
15
|
+
* @see buildForm() for more information.
|
|
16
16
|
*
|
|
17
17
|
* @author Sean Fong
|
|
18
18
|
*/
|
|
@@ -30,7 +30,7 @@ import { initialiseFhirClient } from '../utils/manageForm';
|
|
|
30
30
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
31
31
|
* @param fhirClient - FHIRClient object to perform further FHIR calls. At the moment it's only used in answerExpressions (optional)
|
|
32
32
|
*
|
|
33
|
-
* @see
|
|
33
|
+
* @see buildForm() for more information.
|
|
34
34
|
*
|
|
35
35
|
* @author Sean Fong
|
|
36
36
|
*/
|
package/lib/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { useHidden, useBuildForm, useRendererQueryClient } from './hooks';
|
|
|
7
7
|
export type { ItemToRepopulate } from './utils';
|
|
8
8
|
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, isSpecificItemControl, isRepeatItemAndNotCheckbox, initialiseQuestionnaireResponse, generateItemsToRepopulate, repopulateResponse } from './utils';
|
|
9
9
|
export { RendererThemeProvider } from './theme';
|
|
10
|
+
export { InitialiseFormWrapperForStorybook } from './stories/storybookWrappers';
|
package/lib/index.js
CHANGED
|
@@ -5,4 +5,6 @@ export { useHidden, useBuildForm, useRendererQueryClient } from './hooks';
|
|
|
5
5
|
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, isSpecificItemControl, isRepeatItemAndNotCheckbox, initialiseQuestionnaireResponse, generateItemsToRepopulate, repopulateResponse } from './utils';
|
|
6
6
|
// theme provider exports
|
|
7
7
|
export { RendererThemeProvider } from './theme';
|
|
8
|
+
// wrapper exports - only for smartforms.csiro.au/standalone use
|
|
9
|
+
export { InitialiseFormWrapperForStorybook } from './stories/storybookWrappers';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AAStB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB,gBAAgB;AAChB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAI1E,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,8BAA8B,EAC9B,qBAAqB,EACrB,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,yBAAyB;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AAStB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB,gBAAgB;AAChB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAI1E,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,8BAA8B,EAC9B,qBAAqB,EACrB,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,yBAAyB;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,gEAAgE;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -39,7 +39,7 @@ export interface QuestionnaireResponseStoreType {
|
|
|
39
39
|
/**
|
|
40
40
|
* QuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaireResponse.
|
|
41
41
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
42
|
-
* @see
|
|
42
|
+
* @see QuestionnaireResponseStoreType for available properties and methods.
|
|
43
43
|
*
|
|
44
44
|
* @author Sean Fong
|
|
45
45
|
*/
|
|
@@ -47,8 +47,8 @@ export declare const questionnaireResponseStore: import("zustand/vanilla").Store
|
|
|
47
47
|
/**
|
|
48
48
|
* QuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
49
49
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
50
|
-
* @see
|
|
51
|
-
* @see
|
|
50
|
+
* @see QuestionnaireResponseStoreType for available properties and methods.
|
|
51
|
+
* @see questionnaireResponseStore for the vanilla store.
|
|
52
52
|
*
|
|
53
53
|
* @author Sean Fong
|
|
54
54
|
*/
|
|
@@ -25,7 +25,7 @@ import { createQuestionnaireResponseItemMap } from '../utils/questionnaireRespon
|
|
|
25
25
|
/**
|
|
26
26
|
* QuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaireResponse.
|
|
27
27
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
28
|
-
* @see
|
|
28
|
+
* @see QuestionnaireResponseStoreType for available properties and methods.
|
|
29
29
|
*
|
|
30
30
|
* @author Sean Fong
|
|
31
31
|
*/
|
|
@@ -133,8 +133,8 @@ export const questionnaireResponseStore = createStore()((set, get) => ({
|
|
|
133
133
|
/**
|
|
134
134
|
* QuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
135
135
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
136
|
-
* @see
|
|
137
|
-
* @see
|
|
136
|
+
* @see QuestionnaireResponseStoreType for available properties and methods.
|
|
137
|
+
* @see questionnaireResponseStore for the vanilla store.
|
|
138
138
|
*
|
|
139
139
|
* @author Sean Fong
|
|
140
140
|
*/
|
|
@@ -82,7 +82,7 @@ export interface QuestionnaireStoreType {
|
|
|
82
82
|
/**
|
|
83
83
|
* Questionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
84
84
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
85
|
-
* @see
|
|
85
|
+
* @see QuestionnaireStoreType for available properties and methods.
|
|
86
86
|
*
|
|
87
87
|
* @author Sean Fong
|
|
88
88
|
*/
|
|
@@ -90,8 +90,8 @@ export declare const questionnaireStore: import("zustand/vanilla").StoreApi<Ques
|
|
|
90
90
|
/**
|
|
91
91
|
* Questionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
92
92
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
93
|
-
* @see
|
|
94
|
-
* @see
|
|
93
|
+
* @see QuestionnaireStoreType for available properties and methods.
|
|
94
|
+
* @see questionnaireStore for the vanilla store.
|
|
95
95
|
*
|
|
96
96
|
* @author Sean Fong
|
|
97
97
|
*/
|
|
@@ -39,7 +39,7 @@ import { createQuestionnaireResponseItemMap } from '../utils/questionnaireRespon
|
|
|
39
39
|
/**
|
|
40
40
|
* Questionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
41
41
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
42
|
-
* @see
|
|
42
|
+
* @see QuestionnaireStoreType for available properties and methods.
|
|
43
43
|
*
|
|
44
44
|
* @author Sean Fong
|
|
45
45
|
*/
|
|
@@ -220,8 +220,8 @@ export const questionnaireStore = createStore()((set, get) => ({
|
|
|
220
220
|
/**
|
|
221
221
|
* Questionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
222
222
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
223
|
-
* @see
|
|
224
|
-
* @see
|
|
223
|
+
* @see QuestionnaireStoreType for available properties and methods.
|
|
224
|
+
* @see questionnaireStore for the vanilla store.
|
|
225
225
|
*
|
|
226
226
|
* @author Sean Fong
|
|
227
227
|
*/
|
|
@@ -32,7 +32,7 @@ export interface SmartConfigStoreType {
|
|
|
32
32
|
* Will be deprecated in version 1.0.0.
|
|
33
33
|
*
|
|
34
34
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
35
|
-
* @see
|
|
35
|
+
* @see SmartConfigStoreType for available properties and methods.
|
|
36
36
|
*
|
|
37
37
|
* @author Sean Fong
|
|
38
38
|
*/
|
|
@@ -43,8 +43,8 @@ export declare const smartConfigStore: import("zustand/vanilla").StoreApi<SmartC
|
|
|
43
43
|
* Will be deprecated in version 1.0.0.
|
|
44
44
|
*
|
|
45
45
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
46
|
-
* @see
|
|
47
|
-
* @see
|
|
46
|
+
* @see SmartConfigStoreType for available properties and methods.
|
|
47
|
+
* @see smartConfigStore for the vanilla store.
|
|
48
48
|
*
|
|
49
49
|
* @author Sean Fong
|
|
50
50
|
*/
|
|
@@ -22,7 +22,7 @@ import { createSelectors } from './selector';
|
|
|
22
22
|
* Will be deprecated in version 1.0.0.
|
|
23
23
|
*
|
|
24
24
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
25
|
-
* @see
|
|
25
|
+
* @see SmartConfigStoreType for available properties and methods.
|
|
26
26
|
*
|
|
27
27
|
* @author Sean Fong
|
|
28
28
|
*/
|
|
@@ -42,8 +42,8 @@ export const smartConfigStore = createStore()((set) => ({
|
|
|
42
42
|
* Will be deprecated in version 1.0.0.
|
|
43
43
|
*
|
|
44
44
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
45
|
-
* @see
|
|
46
|
-
* @see
|
|
45
|
+
* @see SmartConfigStoreType for available properties and methods.
|
|
46
|
+
* @see smartConfigStore for the vanilla store.
|
|
47
47
|
*
|
|
48
48
|
* @author Sean Fong
|
|
49
49
|
*/
|
|
@@ -18,7 +18,7 @@ export interface TerminologyServerStoreType {
|
|
|
18
18
|
* Terminology server state management store. This is used for resolving valueSets externally.
|
|
19
19
|
* Defaults to use https://r4.ontoserver.csiro.au/fhir.
|
|
20
20
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
21
|
-
* @see
|
|
21
|
+
* @see TerminologyServerStoreType for available properties and methods.
|
|
22
22
|
*
|
|
23
23
|
* @author Sean Fong
|
|
24
24
|
*/
|
|
@@ -27,7 +27,7 @@ export declare const terminologyServerStore: import("zustand/vanilla").StoreApi<
|
|
|
27
27
|
* Terminology server state management store. This is used for resolving valueSets externally.
|
|
28
28
|
* Defaults to use https://r4.ontoserver.csiro.au/fhir.
|
|
29
29
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
30
|
-
* @see
|
|
30
|
+
* @see TerminologyServerStoreType for available properties and methods.
|
|
31
31
|
*
|
|
32
32
|
* @author Sean Fong
|
|
33
33
|
*/
|
|
@@ -21,7 +21,7 @@ const ONTOSERVER_R4 = 'https://r4.ontoserver.csiro.au/fhir';
|
|
|
21
21
|
* Terminology server state management store. This is used for resolving valueSets externally.
|
|
22
22
|
* Defaults to use https://r4.ontoserver.csiro.au/fhir.
|
|
23
23
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
24
|
-
* @see
|
|
24
|
+
* @see TerminologyServerStoreType for available properties and methods.
|
|
25
25
|
*
|
|
26
26
|
* @author Sean Fong
|
|
27
27
|
*/
|
|
@@ -34,7 +34,7 @@ export const terminologyServerStore = createStore()((set) => ({
|
|
|
34
34
|
* Terminology server state management store. This is used for resolving valueSets externally.
|
|
35
35
|
* Defaults to use https://r4.ontoserver.csiro.au/fhir.
|
|
36
36
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
37
|
-
* @see
|
|
37
|
+
* @see TerminologyServerStoreType for available properties and methods.
|
|
38
38
|
*
|
|
39
39
|
* @author Sean Fong
|
|
40
40
|
*/
|
|
@@ -14,7 +14,7 @@ interface InitialiseFormWrapperProps {
|
|
|
14
14
|
* Instead of using this React component, define your own wrapper component that uses the BaseRenderer directly.
|
|
15
15
|
* Things to note:
|
|
16
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.
|
|
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 https://mui.com/material-ui/customization/theming/.
|
|
18
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
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
20
|
* - The initialised FHIRClient is only used for further FHIR calls. It does not provide pre-population capabilities.
|
|
@@ -29,7 +29,7 @@ import Typography from '@mui/material/Typography';
|
|
|
29
29
|
* Instead of using this React component, define your own wrapper component that uses the BaseRenderer directly.
|
|
30
30
|
* Things to note:
|
|
31
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.
|
|
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 https://mui.com/material-ui/customization/theming/.
|
|
33
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
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
35
|
* - The initialised FHIRClient is only used for further FHIR calls. It does not provide pre-population capabilities.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitialiseFormWrapperForStorybook.js","sourceRoot":"","sources":["../../../src/stories/
|
|
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"}
|
|
@@ -1,3 +1 @@
|
|
|
1
1
|
export { default as InitialiseFormWrapperForStorybook } from './InitialiseFormWrapperForStorybook';
|
|
2
|
-
export { default as BuildFormButtonTesterWrapperForStorybook } from './BuildFormButtonTesterWrapperForStorybook';
|
|
3
|
-
export { default as PrePopWrapperForStorybook } from './PrePopWrapperForStorybook';
|
|
@@ -15,6 +15,4 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
export { default as InitialiseFormWrapperForStorybook } from './InitialiseFormWrapperForStorybook';
|
|
18
|
-
export { default as BuildFormButtonTesterWrapperForStorybook } from './BuildFormButtonTesterWrapperForStorybook';
|
|
19
|
-
export { default as PrePopWrapperForStorybook } from './PrePopWrapperForStorybook';
|
|
20
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stories/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stories/storybookWrappers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,iCAAiC,EAAE,MAAM,qCAAqC,CAAC"}
|
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ export interface SmartFormsRendererProps {
|
|
|
56
56
|
* Will be deprecated in version 1.0.0. For alternative usage, see:
|
|
57
57
|
* - https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.tsx#L40-L51
|
|
58
58
|
*
|
|
59
|
-
* @see
|
|
59
|
+
* @see SmartFormsRendererProps for props.
|
|
60
60
|
*
|
|
61
61
|
* @author Sean Fong
|
|
62
62
|
*/
|
|
@@ -21,7 +21,7 @@ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
24
|
-
* @see
|
|
24
|
+
* @see buildForm() for more information.
|
|
25
25
|
*
|
|
26
26
|
* @param questionnaire - Questionnaire to be rendered
|
|
27
27
|
* @param questionnaireResponse - Pre-populated/draft/loaded QuestionnaireResponse to be rendered (optional)
|
|
@@ -34,7 +34,7 @@ import { initialiseFhirClient } from '../utils/manageForm';
|
|
|
34
34
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
35
35
|
* @param fhirClient - FHIRClient object to perform further FHIR calls. At the moment it's only used in answerExpressions (optional)
|
|
36
36
|
*
|
|
37
|
-
* @see
|
|
37
|
+
* @see buildForm() for more information.
|
|
38
38
|
*
|
|
39
39
|
* @author Sean Fong
|
|
40
40
|
*/
|
package/src/index.ts
CHANGED
|
@@ -74,7 +74,7 @@ export interface QuestionnaireResponseStoreType {
|
|
|
74
74
|
/**
|
|
75
75
|
* QuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaireResponse.
|
|
76
76
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
77
|
-
* @see
|
|
77
|
+
* @see QuestionnaireResponseStoreType for available properties and methods.
|
|
78
78
|
*
|
|
79
79
|
* @author Sean Fong
|
|
80
80
|
*/
|
|
@@ -191,8 +191,8 @@ export const questionnaireResponseStore = createStore<QuestionnaireResponseStore
|
|
|
191
191
|
/**
|
|
192
192
|
* QuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
193
193
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
194
|
-
* @see
|
|
195
|
-
* @see
|
|
194
|
+
* @see QuestionnaireResponseStoreType for available properties and methods.
|
|
195
|
+
* @see questionnaireResponseStore for the vanilla store.
|
|
196
196
|
*
|
|
197
197
|
* @author Sean Fong
|
|
198
198
|
*/
|
|
@@ -143,7 +143,7 @@ export interface QuestionnaireStoreType {
|
|
|
143
143
|
/**
|
|
144
144
|
* Questionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
145
145
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
146
|
-
* @see
|
|
146
|
+
* @see QuestionnaireStoreType for available properties and methods.
|
|
147
147
|
*
|
|
148
148
|
* @author Sean Fong
|
|
149
149
|
*/
|
|
@@ -407,8 +407,8 @@ export const questionnaireStore = createStore<QuestionnaireStoreType>()((set, ge
|
|
|
407
407
|
/**
|
|
408
408
|
* Questionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
|
|
409
409
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
410
|
-
* @see
|
|
411
|
-
* @see
|
|
410
|
+
* @see QuestionnaireStoreType for available properties and methods.
|
|
411
|
+
* @see questionnaireStore for the vanilla store.
|
|
412
412
|
*
|
|
413
413
|
* @author Sean Fong
|
|
414
414
|
*/
|
|
@@ -53,7 +53,7 @@ export interface SmartConfigStoreType {
|
|
|
53
53
|
* Will be deprecated in version 1.0.0.
|
|
54
54
|
*
|
|
55
55
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
56
|
-
* @see
|
|
56
|
+
* @see SmartConfigStoreType for available properties and methods.
|
|
57
57
|
*
|
|
58
58
|
* @author Sean Fong
|
|
59
59
|
*/
|
|
@@ -74,8 +74,8 @@ export const smartConfigStore = createStore<SmartConfigStoreType>()((set) => ({
|
|
|
74
74
|
* Will be deprecated in version 1.0.0.
|
|
75
75
|
*
|
|
76
76
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
77
|
-
* @see
|
|
78
|
-
* @see
|
|
77
|
+
* @see SmartConfigStoreType for available properties and methods.
|
|
78
|
+
* @see smartConfigStore for the vanilla store.
|
|
79
79
|
*
|
|
80
80
|
* @author Sean Fong
|
|
81
81
|
*/
|
|
@@ -41,7 +41,7 @@ export interface TerminologyServerStoreType {
|
|
|
41
41
|
* Terminology server state management store. This is used for resolving valueSets externally.
|
|
42
42
|
* Defaults to use https://r4.ontoserver.csiro.au/fhir.
|
|
43
43
|
* This is the vanilla version of the store which can be used in non-React environments.
|
|
44
|
-
* @see
|
|
44
|
+
* @see TerminologyServerStoreType for available properties and methods.
|
|
45
45
|
*
|
|
46
46
|
* @author Sean Fong
|
|
47
47
|
*/
|
|
@@ -55,7 +55,7 @@ export const terminologyServerStore = createStore<TerminologyServerStoreType>()(
|
|
|
55
55
|
* Terminology server state management store. This is used for resolving valueSets externally.
|
|
56
56
|
* Defaults to use https://r4.ontoserver.csiro.au/fhir.
|
|
57
57
|
* This is the React version of the store which can be used as React hooks in React functional components.
|
|
58
|
-
* @see
|
|
58
|
+
* @see TerminologyServerStoreType for available properties and methods.
|
|
59
59
|
*
|
|
60
60
|
* @author Sean Fong
|
|
61
61
|
*/
|
|
@@ -42,7 +42,7 @@ interface InitialiseFormWrapperProps {
|
|
|
42
42
|
* Instead of using this React component, define your own wrapper component that uses the BaseRenderer directly.
|
|
43
43
|
* Things to note:
|
|
44
44
|
* - It is required to wrap the BaseRenderer with the QueryClientProvider to make requests.
|
|
45
|
-
* - 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.
|
|
45
|
+
* - 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 https://mui.com/material-ui/customization/theming/.
|
|
46
46
|
* - Make your buildForm() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
|
|
47
47
|
* - Make your own initialiseFhirClient() call in a button click or other event handler. Alternatively, you can use the useInitialiseForm hook to initialise the form.
|
|
48
48
|
* - The initialised FHIRClient is only used for further FHIR calls. It does not provide pre-population capabilities.
|
|
@@ -16,5 +16,3 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
export { default as InitialiseFormWrapperForStorybook } from './InitialiseFormWrapperForStorybook';
|
|
19
|
-
export { default as BuildFormButtonTesterWrapperForStorybook } from './BuildFormButtonTesterWrapperForStorybook';
|
|
20
|
-
export { default as PrePopWrapperForStorybook } from './PrePopWrapperForStorybook';
|