@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.
- package/README.md +6 -6
- package/lib/components/FormComponents/BooleanItem/BooleanField.js +5 -4
- package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +5 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +5 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/index.d.ts +1 -1
- package/lib/components/FormComponents/DateTimeItems/index.js +1 -1
- package/lib/components/FormComponents/DateTimeItems/index.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/utils/parseDate.d.ts +5 -0
- package/lib/components/FormComponents/DateTimeItems/utils/parseDate.js +5 -0
- package/lib/components/FormComponents/DateTimeItems/utils/parseDate.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridGroup.d.ts +6 -0
- package/lib/components/FormComponents/GridGroup/GridGroup.js +6 -0
- package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.d.ts +6 -0
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +6 -0
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.d.ts +5 -0
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js +5 -0
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +6 -0
- package/lib/components/FormComponents/SingleItem/SingleItem.js +6 -0
- package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTable.d.ts +6 -0
- package/lib/components/FormComponents/Tables/GroupTable.js +6 -0
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
- package/lib/components/FormComponents/index.d.ts +6 -6
- package/lib/components/FormComponents/index.js +6 -6
- package/lib/components/FormComponents/index.js.map +1 -1
- package/lib/components/Renderer/BaseRenderer.d.ts +7 -0
- package/lib/components/Renderer/BaseRenderer.js +7 -0
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/components/Renderer/SmartFormsRenderer.d.ts +22 -1
- package/lib/components/Renderer/SmartFormsRenderer.js +16 -6
- package/lib/components/Renderer/SmartFormsRenderer.js.map +1 -1
- package/lib/components/Renderer/index.d.ts +1 -0
- package/lib/components/Renderer/index.js.map +1 -1
- package/lib/components/index.d.ts +3 -2
- package/lib/components/index.js +2 -2
- package/lib/components/index.js.map +1 -1
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useBuildForm.d.ts +15 -0
- package/lib/hooks/useBuildForm.js +41 -0
- package/lib/hooks/useBuildForm.js.map +1 -0
- package/lib/hooks/useHidden.d.ts +6 -0
- package/lib/hooks/useHidden.js +6 -0
- package/lib/hooks/useHidden.js.map +1 -1
- package/lib/hooks/useInitaliseFhirClient.d.ts +1 -0
- package/lib/hooks/useInitaliseFhirClient.js +55 -0
- package/lib/hooks/useInitaliseFhirClient.js.map +1 -0
- package/lib/hooks/useInitialiseForm.d.ts +20 -0
- package/lib/hooks/useInitialiseForm.js +72 -0
- package/lib/hooks/useInitialiseForm.js.map +1 -0
- package/lib/hooks/useInitialiseRenderer.d.ts +1 -1
- package/lib/hooks/useInitialiseRenderer.js +8 -31
- package/lib/hooks/useInitialiseRenderer.js.map +1 -1
- package/lib/hooks/useRendererQueryClient.d.ts +10 -0
- package/lib/hooks/useRendererQueryClient.js +36 -0
- package/lib/hooks/useRendererQueryClient.js.map +1 -0
- package/lib/hooks/useValueSetCodings.js +1 -0
- package/lib/hooks/useValueSetCodings.js.map +1 -1
- package/lib/index.d.ts +10 -40
- package/lib/index.js +8 -77
- package/lib/index.js.map +1 -1
- package/lib/interfaces/calculatedExpression.interface.d.ts +7 -0
- package/lib/interfaces/calculatedExpression.interface.js +16 -0
- package/lib/interfaces/calculatedExpression.interface.js.map +1 -1
- package/lib/interfaces/enableWhen.interface.d.ts +12 -0
- package/lib/interfaces/index.d.ts +4 -1
- package/lib/interfaces/index.js +16 -0
- package/lib/interfaces/index.js.map +1 -1
- package/lib/interfaces/populate.interface.d.ts +6 -0
- package/lib/interfaces/repopulateItems.interface.d.ts +0 -0
- package/lib/interfaces/repopulateItems.interface.js +2 -0
- package/lib/interfaces/repopulateItems.interface.js.map +1 -0
- package/lib/interfaces/tab.interface.d.ts +10 -0
- package/lib/interfaces/tab.interface.js +16 -0
- package/lib/interfaces/tab.interface.js.map +1 -1
- package/lib/interfaces/variables.interface.d.ts +12 -0
- package/lib/stores/index.d.ts +4 -0
- package/lib/stores/index.js.map +1 -1
- package/lib/stores/questionnaireResponseStore.d.ts +37 -2
- package/lib/stores/questionnaireResponseStore.js +72 -22
- package/lib/stores/questionnaireResponseStore.js.map +1 -1
- package/lib/stores/questionnaireStore.d.ts +59 -3
- package/lib/stores/questionnaireStore.js +18 -0
- package/lib/stores/questionnaireStore.js.map +1 -1
- package/lib/stores/smartConfigStore.d.ts +37 -0
- package/lib/stores/smartConfigStore.js +21 -0
- package/lib/stores/smartConfigStore.js.map +1 -1
- package/lib/stores/terminologyServerStore.d.ts +28 -2
- package/lib/stores/terminologyServerStore.js +16 -0
- package/lib/stores/terminologyServerStore.js.map +1 -1
- package/lib/stories/InitialiseFormWrapperForStorybook.d.ts +29 -0
- package/lib/stories/InitialiseFormWrapperForStorybook.js +65 -0
- package/lib/stories/InitialiseFormWrapperForStorybook.js.map +1 -0
- package/lib/stories/StorybookWrappers/BuildFormButtonForStorybook.d.ts +8 -0
- package/lib/stories/StorybookWrappers/BuildFormButtonForStorybook.js +44 -0
- package/lib/stories/StorybookWrappers/BuildFormButtonForStorybook.js.map +1 -0
- package/lib/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.d.ts +18 -0
- package/lib/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.js +48 -0
- package/lib/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.js.map +1 -0
- package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.d.ts +31 -0
- package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.js +67 -0
- package/lib/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.js.map +1 -0
- package/lib/stories/StorybookWrappers/PrePopButtonForStorybook.d.ts +7 -0
- package/lib/stories/StorybookWrappers/PrePopButtonForStorybook.js +32 -0
- package/lib/stories/StorybookWrappers/PrePopButtonForStorybook.js.map +1 -0
- package/lib/stories/StorybookWrappers/PrePopWrapperForStorybook.d.ts +21 -0
- package/lib/stories/StorybookWrappers/PrePopWrapperForStorybook.js +83 -0
- package/lib/stories/StorybookWrappers/PrePopWrapperForStorybook.js.map +1 -0
- package/lib/stories/StorybookWrappers/index.d.ts +3 -0
- package/lib/stories/StorybookWrappers/index.js +20 -0
- package/lib/stories/StorybookWrappers/index.js.map +1 -0
- package/lib/stories/StorybookWrappers/populateCallbackForStorybook.d.ts +8 -0
- package/lib/stories/StorybookWrappers/populateCallbackForStorybook.js +46 -0
- package/lib/stories/StorybookWrappers/populateCallbackForStorybook.js.map +1 -0
- package/lib/stories/index.d.ts +1 -0
- package/lib/stories/index.js +18 -0
- package/lib/stories/index.js.map +1 -0
- package/lib/theme/Theme.d.ts +8 -2
- package/lib/theme/Theme.js +8 -2
- package/lib/theme/Theme.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +2 -0
- package/lib/theme/index.js.map +1 -0
- package/lib/utils/enableWhen.d.ts +1 -1
- package/lib/utils/enableWhenExpression.d.ts +1 -1
- package/lib/utils/fhirpath.d.ts +1 -1
- package/lib/utils/index.d.ts +5 -3
- package/lib/utils/index.js +4 -3
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/initialise.d.ts +2 -2
- package/lib/utils/initialise.js +1 -1
- package/lib/utils/manageForm.d.ts +45 -0
- package/lib/utils/manageForm.js +101 -0
- package/lib/utils/manageForm.js.map +1 -0
- package/lib/utils/qItem.d.ts +1 -1
- package/lib/utils/questionnaireStoreUtils/extractOtherExtensions.d.ts +1 -1
- package/lib/utils/removeEmptyAnswers.d.ts +1 -1
- package/lib/utils/repopulateIntoResponse.d.ts +6 -0
- package/lib/utils/repopulateIntoResponse.js +11 -0
- package/lib/utils/repopulateIntoResponse.js.map +1 -1
- package/lib/utils/repopulateItems.d.ts +19 -1
- package/lib/utils/repopulateItems.js +23 -0
- package/lib/utils/repopulateItems.js.map +1 -1
- package/lib/utils/tabs.d.ts +2 -2
- package/lib/utils/tabs.js +1 -1
- package/lib/utils/validateQuestionnaire.d.ts +0 -4
- package/lib/utils/validateQuestionnaire.js +9 -5
- package/lib/utils/validateQuestionnaire.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FormComponents/BooleanItem/BooleanField.tsx +11 -9
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +11 -9
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +11 -9
- package/src/components/FormComponents/DateTimeItems/index.ts +1 -1
- package/src/components/FormComponents/DateTimeItems/utils/parseDate.ts +5 -0
- package/src/components/FormComponents/GridGroup/GridGroup.tsx +6 -0
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +6 -0
- package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +5 -0
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +6 -0
- package/src/components/FormComponents/Tables/GroupTable.tsx +6 -0
- package/src/components/FormComponents/index.ts +6 -6
- package/src/components/Renderer/BaseRenderer.tsx +7 -0
- package/src/components/Renderer/SmartFormsRenderer.tsx +34 -11
- package/src/components/Renderer/index.ts +1 -0
- package/src/components/index.ts +10 -2
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBuildForm.ts +58 -0
- package/src/hooks/useHidden.ts +6 -0
- package/src/hooks/useInitialiseForm.ts +93 -0
- package/src/hooks/{useQueryClient.ts → useRendererQueryClient.ts} +9 -2
- package/src/hooks/useValueSetCodings.ts +1 -0
- package/src/index.ts +59 -96
- package/src/interfaces/calculatedExpression.interface.ts +24 -0
- package/src/interfaces/enableWhen.interface.ts +12 -0
- package/src/interfaces/index.ts +21 -10
- package/src/interfaces/populate.interface.ts +6 -0
- package/src/interfaces/tab.interface.ts +12 -0
- package/src/interfaces/variables.interface.ts +12 -0
- package/src/stores/index.ts +7 -0
- package/src/stores/questionnaireResponseStore.ts +90 -19
- package/src/stores/questionnaireStore.ts +62 -2
- package/src/stores/smartConfigStore.ts +37 -0
- package/src/stores/terminologyServerStore.ts +28 -1
- package/src/stories/{BuildFormButtonForStorybook.tsx → StorybookWrappers/BuildFormButtonForStorybook.tsx} +12 -5
- package/src/stories/StorybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx +70 -0
- package/src/stories/{BuildFormWrapper.tsx → StorybookWrappers/BuildFormWrapperForStorybook.tsx} +11 -12
- package/src/stories/{BuildFormButtonTesterWrapper.tsx → StorybookWrappers/FormValidationTesterWrapperForStorybook.tsx} +22 -19
- package/src/stories/{useBuildFormForStorybook.ts → StorybookWrappers/FormValidationViewerForStorybook.tsx} +7 -16
- package/src/stories/StorybookWrappers/InitialiseFormWrapperForStorybook.tsx +105 -0
- package/src/stories/{PrePopButtonForStorybook.tsx → StorybookWrappers/PrePopButtonForStorybook.tsx} +12 -10
- package/src/stories/{PrePopWrapper.tsx → StorybookWrappers/PrePopWrapperForStorybook.tsx} +22 -14
- package/src/stories/StorybookWrappers/ValidateFormButtonForStorybook.tsx +41 -0
- package/src/stories/StorybookWrappers/index.ts +20 -0
- package/src/stories/{populateCallbackForStorybook.ts → StorybookWrappers/populateCallbackForStorybook.ts} +8 -2
- package/src/stories/assets/questionnaires/QButtonTester.ts +380 -0
- package/src/stories/assets/questionnaires/QValidateTester.ts +118 -0
- package/src/stories/itemTypes/Attachment.stories.tsx +3 -3
- package/src/stories/itemTypes/Boolean.stories.tsx +3 -3
- package/src/stories/itemTypes/Choice.stories.tsx +3 -3
- package/src/stories/itemTypes/Date.stories.tsx +3 -3
- package/src/stories/itemTypes/DateTime.stories.tsx +3 -3
- package/src/stories/itemTypes/Decimal.stories.tsx +3 -3
- package/src/stories/itemTypes/Display.stories.tsx +3 -3
- package/src/stories/itemTypes/Group.stories.tsx +3 -3
- package/src/stories/itemTypes/Integer.stories.tsx +3 -3
- package/src/stories/itemTypes/OpenChoice.stories.tsx +3 -3
- package/src/stories/itemTypes/Quantity.stories.tsx +3 -3
- package/src/stories/itemTypes/Reference.stories.tsx +3 -3
- package/src/stories/itemTypes/String.stories.tsx +3 -3
- package/src/stories/itemTypes/Text.stories.tsx +3 -3
- package/src/stories/itemTypes/Time.stories.tsx +3 -3
- package/src/stories/itemTypes/Url.stories.tsx +3 -3
- package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +3 -3
- package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +3 -3
- package/src/stories/sdc/AdvancedOther.stories.tsx +3 -3
- package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +3 -3
- package/src/stories/sdc/BehaviorCalculations.stories.tsx +3 -3
- package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +3 -3
- package/src/stories/sdc/BehaviorOther.stories.tsx +3 -3
- package/src/stories/sdc/BehaviorValueConstraints.stories.tsx +3 -3
- package/src/stories/sdc/FormPopulation.stories.tsx +3 -3
- package/src/stories/sdc/ItemControlDisplay.stories.tsx +3 -3
- package/src/stories/sdc/ItemControlGroup.stories.tsx +3 -3
- package/src/stories/sdc/ItemControlQuestion.stories.tsx +3 -3
- package/src/stories/{rebuildForm/BuildFormTesterWrapper.stories.tsx → testing/BuildFormButtonTesterWrapper.stories.tsx} +6 -9
- package/src/stories/testing/PrePopButtonTesterWrapper.stories.tsx +45 -0
- package/src/stories/testing/ValidateFormTesterWrapper.stories.tsx +39 -0
- package/src/tests/enableWhen.test.ts +6 -2
- package/src/theme/Theme.tsx +8 -2
- package/src/theme/index.ts +1 -0
- package/src/utils/enableWhen.ts +1 -1
- package/src/utils/enableWhenExpression.ts +1 -1
- package/src/utils/fhirpath.ts +1 -1
- package/src/utils/index.ts +5 -7
- package/src/utils/initialise.ts +2 -2
- package/src/utils/manageForm.ts +110 -0
- package/src/utils/qItem.ts +1 -1
- package/src/utils/questionnaireStoreUtils/extractOtherExtensions.ts +1 -1
- package/src/utils/removeEmptyAnswers.ts +1 -1
- package/src/utils/repopulateIntoResponse.ts +17 -0
- package/src/utils/repopulateItems.ts +38 -1
- package/src/utils/tabs.ts +2 -2
- package/src/utils/validateQuestionnaire.ts +12 -17
- package/vite.config.ts +1 -1
- package/src/hooks/useInitialiseRenderer.ts +0 -114
- package/src/stories/assets/questionnaires/QBuildFormButtonTester.ts +0 -270
- package/src/stories/populateUtilsForStorybook.ts +0 -545
- package/src/utils/buildForm.ts +0 -23
- /package/.storybook/{preview.ts → preview.tsx} +0 -0
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qOpenChoiceAnswerOptionBasic,
|
|
22
22
|
qOpenChoiceAnswerValueSetBasic,
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
28
28
|
const meta = {
|
|
29
29
|
title: 'Component/ItemType/OpenChoice',
|
|
30
|
-
component:
|
|
30
|
+
component: BuildFormWrapperForStorybook,
|
|
31
31
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
32
32
|
tags: []
|
|
33
|
-
} satisfies Meta<typeof
|
|
33
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
34
34
|
|
|
35
35
|
export default meta;
|
|
36
36
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qQuantityBasic } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/ItemType/Quantity',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qReferenceBasic } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/ItemType/Reference',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qrStringBasicResponse, qStringBasic, qStringCalculation } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/ItemType/String',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qrTextBasicResponse, qTextBasic, qTextCalculation } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/ItemType/Text',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qTimeBasic } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/ItemType/Time',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qUrlBasic } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/ItemType/Url',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qEntryFormat, qQuestionnaireUnit, qShortText } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/SDC/8.1.3 Advanced Additional Display Content',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import { qChoiceOrientation, qItemControl, qSliderStepValue } from '../assets/questionnaires';
|
|
21
21
|
|
|
22
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Component/SDC/8.1.2 Advanced Control Appearance',
|
|
25
|
-
component:
|
|
25
|
+
component: BuildFormWrapperForStorybook,
|
|
26
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
27
|
tags: []
|
|
28
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qReadOnly,
|
|
22
22
|
qRepeatsAutocomplete,
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
30
30
|
const meta = {
|
|
31
31
|
title: 'Component/SDC/8.1.4 Advanced Other',
|
|
32
|
-
component:
|
|
32
|
+
component: BuildFormWrapperForStorybook,
|
|
33
33
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
34
34
|
tags: []
|
|
35
|
-
} satisfies Meta<typeof
|
|
35
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
36
36
|
|
|
37
37
|
export default meta;
|
|
38
38
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qDisplayCategoryInstructions,
|
|
22
22
|
qHidden,
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
30
30
|
const meta = {
|
|
31
31
|
title: 'Component/SDC/8.1.1 Advanced Text Appearance',
|
|
32
|
-
component:
|
|
32
|
+
component: BuildFormWrapperForStorybook,
|
|
33
33
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
34
34
|
tags: []
|
|
35
|
-
} satisfies Meta<typeof
|
|
35
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
36
36
|
|
|
37
37
|
export default meta;
|
|
38
38
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qCalculatedExpressionBMICalculator,
|
|
22
22
|
qCalculatedExpressionCvdRiskCalculator,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
29
29
|
const meta = {
|
|
30
30
|
title: 'Component/SDC/9.1.3 Form Behavior Calculations',
|
|
31
|
-
component:
|
|
31
|
+
component: BuildFormWrapperForStorybook,
|
|
32
32
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
33
33
|
tags: []
|
|
34
|
-
} satisfies Meta<typeof
|
|
34
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
37
37
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qAnswerExpression,
|
|
22
22
|
qAnswerOption,
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
30
30
|
const meta = {
|
|
31
31
|
title: 'Component/SDC/9.1.2 Form Behavior Choice Restriction',
|
|
32
|
-
component:
|
|
32
|
+
component: BuildFormWrapperForStorybook,
|
|
33
33
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
34
34
|
tags: []
|
|
35
|
-
} satisfies Meta<typeof
|
|
35
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
36
36
|
|
|
37
37
|
export default meta;
|
|
38
38
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qEnableBehaviorAll,
|
|
22
22
|
qEnableBehaviorAny,
|
|
@@ -31,10 +31,10 @@ import {
|
|
|
31
31
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
32
32
|
const meta = {
|
|
33
33
|
title: 'Component/SDC/9.1.4 Form Behavior Other Control',
|
|
34
|
-
component:
|
|
34
|
+
component: BuildFormWrapperForStorybook,
|
|
35
35
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
36
36
|
tags: []
|
|
37
|
-
} satisfies Meta<typeof
|
|
37
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
38
38
|
|
|
39
39
|
export default meta;
|
|
40
40
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qMaxDecimalPlaces,
|
|
22
22
|
qMaxLength,
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
36
36
|
const meta = {
|
|
37
37
|
title: 'Component/SDC/9.1.1 Form Behavior Value Constraints',
|
|
38
|
-
component:
|
|
38
|
+
component: BuildFormWrapperForStorybook,
|
|
39
39
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
40
40
|
tags: []
|
|
41
|
-
} satisfies Meta<typeof
|
|
41
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
42
42
|
|
|
43
43
|
export default meta;
|
|
44
44
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import PrePopWrapperForStorybook from '../StorybookWrappers/PrePopWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qCalculatedExpressionBMICalculatorPrepop,
|
|
22
22
|
qCalculatedExpressionCvdRiskCalculatorPrepop,
|
|
@@ -32,10 +32,10 @@ import { pracPrimaryPeter } from '../assets/practitioners/PracPrimaryPeter';
|
|
|
32
32
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
33
33
|
const meta = {
|
|
34
34
|
title: 'Component/SDC/12 Form Population',
|
|
35
|
-
component:
|
|
35
|
+
component: PrePopWrapperForStorybook,
|
|
36
36
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
37
37
|
tags: []
|
|
38
|
-
} satisfies Meta<typeof
|
|
38
|
+
} satisfies Meta<typeof PrePopWrapperForStorybook>;
|
|
39
39
|
|
|
40
40
|
export default meta;
|
|
41
41
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qItemControlDisplayContextDisplay,
|
|
22
22
|
qItemControlDisplayFlyover,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
29
29
|
const meta = {
|
|
30
30
|
title: 'Component/SDC/8.1.2 Advanced Control Appearance - Item Control Display',
|
|
31
|
-
component:
|
|
31
|
+
component: BuildFormWrapperForStorybook,
|
|
32
32
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
33
33
|
tags: []
|
|
34
|
-
} satisfies Meta<typeof
|
|
34
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
37
37
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qItemControlDisplayTabContainer,
|
|
22
22
|
qItemControlGroupGridMultiRow,
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
28
28
|
const meta = {
|
|
29
29
|
title: 'Component/SDC/8.1.2 Advanced Control Appearance - Item Control Group',
|
|
30
|
-
component:
|
|
30
|
+
component: BuildFormWrapperForStorybook,
|
|
31
31
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
32
32
|
tags: []
|
|
33
|
-
} satisfies Meta<typeof
|
|
33
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
34
34
|
|
|
35
35
|
export default meta;
|
|
36
36
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
19
|
+
import BuildFormWrapperForStorybook from '../StorybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qChoiceCheckboxAnswerOption,
|
|
22
22
|
qChoiceCheckboxAnswerValueSet,
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
36
36
|
const meta = {
|
|
37
37
|
title: 'Component/SDC/8.1.2 Advanced Control Appearance - Item Control Question',
|
|
38
|
-
component:
|
|
38
|
+
component: BuildFormWrapperForStorybook,
|
|
39
39
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
40
40
|
tags: []
|
|
41
|
-
} satisfies Meta<typeof
|
|
41
|
+
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
42
42
|
|
|
43
43
|
export default meta;
|
|
44
44
|
type Story = StoryObj<typeof meta>;
|
|
@@ -16,19 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
qBuildFormButtonTester,
|
|
22
|
-
qrBuildFormTesterResponse
|
|
23
|
-
} from '../assets/questionnaires/QBuildFormButtonTester';
|
|
19
|
+
import BuildFormButtonTesterWrapperForStorybook from '../StorybookWrappers/BuildFormButtonTesterWrapperForStorybook';
|
|
20
|
+
import { qButtonTester, qrButtonTesterResponse } from '../assets/questionnaires/QButtonTester';
|
|
24
21
|
|
|
25
22
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
26
23
|
const meta = {
|
|
27
24
|
title: 'Component/Testing/Build Form Button Tester',
|
|
28
|
-
component:
|
|
25
|
+
component: BuildFormButtonTesterWrapperForStorybook,
|
|
29
26
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
30
27
|
tags: []
|
|
31
|
-
} satisfies Meta<typeof
|
|
28
|
+
} satisfies Meta<typeof BuildFormButtonTesterWrapperForStorybook>;
|
|
32
29
|
|
|
33
30
|
export default meta;
|
|
34
31
|
type Story = StoryObj<typeof meta>;
|
|
@@ -37,7 +34,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
37
34
|
|
|
38
35
|
export const BuildFormButtonTester: Story = {
|
|
39
36
|
args: {
|
|
40
|
-
questionnaire:
|
|
41
|
-
questionnaireResponse:
|
|
37
|
+
questionnaire: qButtonTester,
|
|
38
|
+
questionnaireResponse: qrButtonTesterResponse
|
|
42
39
|
}
|
|
43
40
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
|
|
18
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
+
import PrePopWrapperForStorybook from '../StorybookWrappers/PrePopWrapperForStorybook';
|
|
20
|
+
import { mockFhirClient } from '../assets/fhirClient/mockFhirClient';
|
|
21
|
+
import { patSmartForm } from '../assets/patients/PatSmartForm';
|
|
22
|
+
import { pracPrimaryPeter } from '../assets/practitioners/PracPrimaryPeter';
|
|
23
|
+
import { qButtonTester } from '../assets/questionnaires/QButtonTester';
|
|
24
|
+
|
|
25
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
26
|
+
const meta = {
|
|
27
|
+
title: 'Component/Testing/Pre Pop Button Tester',
|
|
28
|
+
component: PrePopWrapperForStorybook,
|
|
29
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
30
|
+
tags: []
|
|
31
|
+
} satisfies Meta<typeof PrePopWrapperForStorybook>;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
type Story = StoryObj<typeof meta>;
|
|
35
|
+
|
|
36
|
+
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
37
|
+
|
|
38
|
+
export const PrePopButtonTester: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
questionnaire: qButtonTester,
|
|
41
|
+
fhirClient: mockFhirClient,
|
|
42
|
+
patient: patSmartForm,
|
|
43
|
+
user: pracPrimaryPeter
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
|
|
18
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
+
import ValidationFormTesterWrapper from '../StorybookWrappers/FormValidationTesterWrapperForStorybook';
|
|
20
|
+
import { qValidateTester } from '../assets/questionnaires/QValidateTester';
|
|
21
|
+
|
|
22
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
|
+
const meta = {
|
|
24
|
+
title: 'Component/Testing/Validate Tester',
|
|
25
|
+
component: ValidationFormTesterWrapper,
|
|
26
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
|
+
tags: []
|
|
28
|
+
} satisfies Meta<typeof ValidationFormTesterWrapper>;
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
|
|
33
|
+
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
34
|
+
|
|
35
|
+
export const ValidateTester: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
questionnaire: qValidateTester
|
|
38
|
+
}
|
|
39
|
+
};
|
|
@@ -25,8 +25,12 @@ import questionnaireResponseSample from './test-data/questionnaire-response-samp
|
|
|
25
25
|
import initialAnswersSample from './test-data/initial-answers-sample.json';
|
|
26
26
|
import type { QuestionnaireResponse, QuestionnaireResponseItemAnswer } from 'fhir/r4';
|
|
27
27
|
import { describe, expect, test } from '@jest/globals';
|
|
28
|
-
import type { EnableWhenItems } from '../interfaces';
|
|
29
|
-
import {
|
|
28
|
+
import type { EnableWhenItems } from '../interfaces/enableWhen.interface';
|
|
29
|
+
import {
|
|
30
|
+
createEnableWhenLinkedQuestions,
|
|
31
|
+
readInitialAnswers,
|
|
32
|
+
setInitialAnswers
|
|
33
|
+
} from '../utils/enableWhen';
|
|
30
34
|
|
|
31
35
|
describe('verify correctness of linked questions map created from enable when items', () => {
|
|
32
36
|
const enableWhenItems = enableWhenItemsSample as unknown as EnableWhenItems;
|
package/src/theme/Theme.tsx
CHANGED
|
@@ -89,7 +89,13 @@ export const themeOptions: ThemeOptions = {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Default Material UI theme used by the renderer. You can customise your own theme by defining a new ThemeProvider.
|
|
94
|
+
* @see {@link https://mui.com/material-ui/customization/theming/}
|
|
95
|
+
*
|
|
96
|
+
* @author Sean Fong
|
|
97
|
+
*/
|
|
98
|
+
export function RendererThemeProvider({ children }: { children: ReactNode }) {
|
|
93
99
|
const theme = createTheme(themeOptions);
|
|
94
100
|
theme.components = componentsOverride(theme);
|
|
95
101
|
|
|
@@ -104,4 +110,4 @@ function ThemeProvider({ children }: { children: ReactNode }) {
|
|
|
104
110
|
);
|
|
105
111
|
}
|
|
106
112
|
|
|
107
|
-
export default
|
|
113
|
+
export default RendererThemeProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RendererThemeProvider } from './Theme';
|
package/src/utils/enableWhen.ts
CHANGED
|
@@ -27,7 +27,7 @@ import type {
|
|
|
27
27
|
EnableWhenItems,
|
|
28
28
|
EnableWhenRepeatItemProperties,
|
|
29
29
|
EnableWhenSingleItemProperties
|
|
30
|
-
} from '../interfaces';
|
|
30
|
+
} from '../interfaces/enableWhen.interface';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Create a linkedQuestionsMap that contains linked items of enableWhen items
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
EnableWhenExpressions,
|
|
24
24
|
EnableWhenRepeatExpression,
|
|
25
25
|
EnableWhenSingleExpression
|
|
26
|
-
} from '../interfaces';
|
|
26
|
+
} from '../interfaces/enableWhen.interface';
|
|
27
27
|
|
|
28
28
|
interface EvaluateInitialEnableWhenExpressionsParams {
|
|
29
29
|
initialResponse: QuestionnaireResponse;
|
package/src/utils/fhirpath.ts
CHANGED
|
@@ -19,7 +19,7 @@ import fhirpath from 'fhirpath';
|
|
|
19
19
|
import fhirpath_r4_model from 'fhirpath/fhir-context/r4';
|
|
20
20
|
import type { Expression, QuestionnaireResponse, QuestionnaireResponseItem } from 'fhir/r4';
|
|
21
21
|
import type { CalculatedExpression } from '../interfaces/calculatedExpression.interface';
|
|
22
|
-
import type { EnableWhenExpressions } from '../interfaces';
|
|
22
|
+
import type { EnableWhenExpressions } from '../interfaces/enableWhen.interface';
|
|
23
23
|
import { evaluateEnableWhenExpressions } from './enableWhenExpression';
|
|
24
24
|
import { evaluateCalculatedExpressions } from './calculatedExpression';
|
|
25
25
|
|
package/src/utils/index.ts
CHANGED
|
@@ -15,12 +15,10 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse } from './manageForm';
|
|
19
|
+
export { initialiseQuestionnaireResponse } from './initialise';
|
|
18
20
|
export { isSpecificItemControl } from './itemControl';
|
|
19
21
|
export { isRepeatItemAndNotCheckbox } from './qItem';
|
|
20
|
-
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
setInitialAnswers
|
|
24
|
-
} from './enableWhen';
|
|
25
|
-
export { initialiseQuestionnaireResponse } from './initialise';
|
|
26
|
-
export { buildForm } from './buildForm';
|
|
22
|
+
export type { ItemToRepopulate } from './repopulateItems';
|
|
23
|
+
export { generateItemsToRepopulate } from './repopulateItems';
|
|
24
|
+
export { repopulateResponse } from './repopulateIntoResponse';
|