@aehrc/smart-forms-renderer 0.31.4 → 0.31.5

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.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  /**
3
3
  * Main component of the form-rendering engine.
4
- * Renders the Questionnaire and QuestionnaireResponse defined in the state management stpres QuestionnaireStore and QuestionnaireResponseStore respectively.
4
+ * Renders the Questionnaire and QuestionnaireResponse defined in the state management stores QuestionnaireStore and QuestionnaireResponseStore respectively.
5
5
  * Use buildForm() in your wrapping component or in an event handler to initialise the form.
6
6
  *
7
7
  * @author Sean Fong
@@ -24,7 +24,7 @@ import { getQrItemsIndex, mapQItemsIndex } from '../../utils/mapItem';
24
24
  import { updateQrItemsInGroup } from '../../utils/qrItem';
25
25
  /**
26
26
  * Main component of the form-rendering engine.
27
- * Renders the Questionnaire and QuestionnaireResponse defined in the state management stpres QuestionnaireStore and QuestionnaireResponseStore respectively.
27
+ * Renders the Questionnaire and QuestionnaireResponse defined in the state management stores QuestionnaireStore and QuestionnaireResponseStore respectively.
28
28
  * Use buildForm() in your wrapping component or in an event handler to initialise the form.
29
29
  *
30
30
  * @author Sean Fong
package/lib/index.d.ts CHANGED
@@ -7,4 +7,5 @@ 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 type { InitialiseFormWrapperProps } from './stories/storybookWrappers';
10
11
  export { InitialiseFormWrapperForStorybook } from './stories/storybookWrappers';
package/lib/index.js CHANGED
@@ -5,6 +5,5 @@ 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
8
  export { InitialiseFormWrapperForStorybook } from './stories/storybookWrappers';
10
9
  //# 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;AAEhD,gEAAgE;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,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;AAIhD,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
3
3
  import type Client from 'fhirclient/lib/Client';
4
- interface InitialiseFormWrapperProps {
4
+ export interface InitialiseFormWrapperProps {
5
5
  questionnaire: Questionnaire;
6
6
  questionnaireResponse?: QuestionnaireResponse;
7
7
  readOnly?: boolean;
@@ -1 +1,2 @@
1
+ export type { InitialiseFormWrapperProps } from './InitialiseFormWrapperForStorybook';
1
2
  export { default as InitialiseFormWrapperForStorybook } from './InitialiseFormWrapperForStorybook';
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stories/storybookWrappers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,OAAO,IAAI,iCAAiC,EAAE,MAAM,qCAAqC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aehrc/smart-forms-renderer",
3
- "version": "0.31.4",
3
+ "version": "0.31.5",
4
4
  "description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@ import type { QrRepeatGroup } from '../../interfaces/repeatGroup.interface';
28
28
 
29
29
  /**
30
30
  * Main component of the form-rendering engine.
31
- * Renders the Questionnaire and QuestionnaireResponse defined in the state management stpres QuestionnaireStore and QuestionnaireResponseStore respectively.
31
+ * Renders the Questionnaire and QuestionnaireResponse defined in the state management stores QuestionnaireStore and QuestionnaireResponseStore respectively.
32
32
  * Use buildForm() in your wrapping component or in an event handler to initialise the form.
33
33
  *
34
34
  * @author Sean Fong
package/src/index.ts CHANGED
@@ -53,4 +53,5 @@ export {
53
53
  export { RendererThemeProvider } from './theme';
54
54
 
55
55
  // wrapper exports - only for smartforms.csiro.au/standalone use
56
+ export type { InitialiseFormWrapperProps } from './stories/storybookWrappers';
56
57
  export { InitialiseFormWrapperForStorybook } from './stories/storybookWrappers';
@@ -28,7 +28,7 @@ import Box from '@mui/material/Box';
28
28
  import CircularProgress from '@mui/material/CircularProgress';
29
29
  import Typography from '@mui/material/Typography';
30
30
 
31
- interface InitialiseFormWrapperProps {
31
+ export interface InitialiseFormWrapperProps {
32
32
  questionnaire: Questionnaire;
33
33
  questionnaireResponse?: QuestionnaireResponse;
34
34
  readOnly?: boolean;
@@ -15,4 +15,5 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
+ export type { InitialiseFormWrapperProps } from './InitialiseFormWrapperForStorybook';
18
19
  export { default as InitialiseFormWrapperForStorybook } from './InitialiseFormWrapperForStorybook';
@@ -18,6 +18,7 @@
18
18
  import type { Meta, StoryObj } from '@storybook/react';
19
19
  import BuildFormButtonTesterWrapperForStorybook from '../storybookWrappers/BuildFormButtonTesterWrapperForStorybook';
20
20
  import { qButtonTester, qrButtonTesterResponse } from '../assets/questionnaires/QButtonTester';
21
+ import { qBooleanBasic, qrBooleanBasicResponse } from '../assets/questionnaires';
21
22
 
22
23
  // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
23
24
  const meta = {
@@ -33,6 +34,13 @@ type Story = StoryObj<typeof meta>;
33
34
  // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
34
35
 
35
36
  export const BuildFormButtonTester: Story = {
37
+ args: {
38
+ questionnaire: qBooleanBasic,
39
+ questionnaireResponse: qrBooleanBasicResponse
40
+ }
41
+ };
42
+
43
+ export const BuildFormButtonTesterBoolean: Story = {
36
44
  args: {
37
45
  questionnaire: qButtonTester,
38
46
  questionnaireResponse: qrButtonTesterResponse