@aehrc/smart-forms-renderer 0.44.1 → 1.0.0-alpha.1
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/FormComponents/CustomComponent.d.ts +9 -0
- package/lib/components/FormComponents/CustomComponent.js +31 -0
- package/lib/components/FormComponents/CustomComponent.js.map +1 -0
- package/lib/components/FormComponents/CustomComponentWrapper.d.ts +1 -0
- package/lib/components/FormComponents/CustomComponentWrapper.js +40 -0
- package/lib/components/FormComponents/CustomComponentWrapper.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js +4 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +6 -5
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/index.d.ts +1 -0
- package/lib/components/FormComponents/ItemParts/index.js +18 -0
- package/lib/components/FormComponents/ItemParts/index.js.map +1 -0
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +9 -0
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/StringItem/index.d.ts +1 -0
- package/lib/components/FormComponents/StringItem/index.js +18 -0
- package/lib/components/FormComponents/StringItem/index.js.map +1 -0
- package/lib/components/FormComponents/index.d.ts +2 -0
- package/lib/components/FormComponents/index.js +3 -0
- package/lib/components/FormComponents/index.js.map +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -1
- package/lib/components/index.js.map +1 -1
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.js +5 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useBuildForm.d.ts +5 -1
- package/lib/hooks/useBuildForm.js +10 -2
- package/lib/hooks/useBuildForm.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/interfaces/customComponent.d.ts +9 -0
- package/lib/interfaces/customComponent.interface.d.ts +9 -0
- package/lib/interfaces/customComponent.interface.js +18 -0
- package/lib/interfaces/customComponent.interface.js.map +1 -0
- package/lib/interfaces/customComponent.js +18 -0
- package/lib/interfaces/customComponent.js.map +1 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/stores/questionnaireStore.d.ts +6 -2
- package/lib/stores/questionnaireStore.js +5 -2
- package/lib/stores/questionnaireStore.js.map +1 -1
- package/lib/stores/rendererStylingStore.d.ts +22 -0
- package/lib/stores/rendererStylingStore.js +34 -0
- package/lib/stores/rendererStylingStore.js.map +1 -0
- package/lib/stores/stylingStore.d.ts +23 -0
- package/lib/stores/stylingStore.js +27 -0
- package/lib/stores/stylingStore.js.map +1 -0
- package/lib/utils/customComponent.d.ts +9 -0
- package/lib/utils/customComponent.js +18 -0
- package/lib/utils/customComponent.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/manageForm.d.ts +3 -1
- package/lib/utils/manageForm.js +3 -2
- package/lib/utils/manageForm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +9 -1
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +12 -10
- package/src/components/FormComponents/ItemParts/index.ts +18 -0
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +20 -0
- package/src/components/FormComponents/StringItem/index.ts +18 -0
- package/src/components/FormComponents/index.ts +4 -0
- package/src/components/index.ts +6 -1
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useBuildForm.ts +16 -3
- package/src/index.ts +22 -3
- package/src/interfaces/customComponent.interface.ts +27 -0
- package/src/interfaces/index.ts +1 -0
- package/src/stores/questionnaireStore.ts +11 -3
- package/src/stores/rendererStylingStore.ts +67 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/manageForm.ts +12 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questionnaireStore.js","sourceRoot":"","sources":["../../src/stores/questionnaireStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAc9C,OAAO,EACL,mCAAmC,EACnC,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,oCAAoC,EACpC,oCAAoC,EACrC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,yCAAyC,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,4CAA4C,EAAE,MAAM,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"questionnaireStore.js","sourceRoot":"","sources":["../../src/stores/questionnaireStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAc9C,OAAO,EACL,mCAAmC,EACnC,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,oCAAoC,EACpC,oCAAoC,EACrC,MAAM,+BAA+B,C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EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,GAAG,EAAE,CAAC,gBAAgB;SAC7D,CAAC,CAAC,CAAC;QAEJ,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,aAAa,EAAE,CAAC,MAAc,EAAE,EAAE,CAChC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,aAAa,EAAE,MAAM;KACtB,CAAC,CAAC;IACL,mBAAmB,EAAE,CAAC,mBAAwC,EAAE,EAAE,CAChE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,gBAAgB,EAAE,mBAAmB;KACtC,CAAC,CAAC;IACL,iBAAiB,EAAE,CAAC,QAAiB,EAAE,EAAE,CACvC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;CACN,CAAC,CAAC,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface RendererStyling {
|
|
2
|
+
itemLabelFontWeight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | 'default';
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* RendererStylingStore properties and methods
|
|
6
|
+
*
|
|
7
|
+
* @author Sean Fong
|
|
8
|
+
*/
|
|
9
|
+
export interface RendererStylingStoreType {
|
|
10
|
+
itemLabelFontWeight: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | 'default';
|
|
11
|
+
setRendererStyling: (params: RendererStyling) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @author Sean Fong
|
|
15
|
+
*/
|
|
16
|
+
export declare const rendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType>;
|
|
17
|
+
export declare const useRendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType> & {
|
|
18
|
+
use: {
|
|
19
|
+
itemLabelFontWeight: () => "500" | "800" | "600" | "default" | "100" | "200" | "300" | "400" | "700" | "900";
|
|
20
|
+
setRendererStyling: () => (params: RendererStyling) => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import { createStore } from 'zustand/vanilla';
|
|
18
|
+
import { createSelectors } from './selector';
|
|
19
|
+
/**
|
|
20
|
+
* @author Sean Fong
|
|
21
|
+
*/
|
|
22
|
+
export const rendererStylingStore = createStore()((set) => ({
|
|
23
|
+
itemLabelFontWeight: 'default',
|
|
24
|
+
setRendererStyling: (params) => {
|
|
25
|
+
set(() => {
|
|
26
|
+
var _a;
|
|
27
|
+
return ({
|
|
28
|
+
itemLabelFontWeight: (_a = params.itemLabelFontWeight) !== null && _a !== void 0 ? _a : 'default'
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
export const useRendererStylingStore = createSelectors(rendererStylingStore);
|
|
34
|
+
//# sourceMappingURL=rendererStylingStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendererStylingStore.js","sourceRoot":"","sources":["../../src/stores/rendererStylingStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAoC7C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,EAA4B,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACpF,mBAAmB,EAAE,SAAS;IAC9B,kBAAkB,EAAE,CAAC,MAAuB,EAAE,EAAE;QAC9C,GAAG,CAAC,GAAG,EAAE;;YAAC,OAAA,CAAC;gBACT,mBAAmB,EAAE,MAAA,MAAM,CAAC,mBAAmB,mCAAI,SAAS;aAC7D,CAAC,CAAA;SAAA,CAAC,CAAC;IACN,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface RendererStyling {
|
|
2
|
+
itemLabelIsBold: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* RendererStylingStore properties and methods
|
|
6
|
+
*
|
|
7
|
+
* @author Sean Fong
|
|
8
|
+
*/
|
|
9
|
+
export interface RendererStylingStoreType {
|
|
10
|
+
itemLabelIsBold: boolean;
|
|
11
|
+
setRendererStyling: (params: RendererStyling) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @author Sean Fong
|
|
15
|
+
*/
|
|
16
|
+
export declare const rendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType>;
|
|
17
|
+
export declare const useRendererStylingStore: import("zustand/vanilla").StoreApi<RendererStylingStoreType> & {
|
|
18
|
+
use: {
|
|
19
|
+
itemLabelIsBold: () => boolean;
|
|
20
|
+
setRendererStyling: () => (params: RendererStyling) => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
import { createStore } from 'zustand/vanilla';
|
|
18
|
+
import { createSelectors } from './selector';
|
|
19
|
+
/**
|
|
20
|
+
* @author Sean Fong
|
|
21
|
+
*/
|
|
22
|
+
export const rendererStylingStore = createStore()((set) => ({
|
|
23
|
+
itemLabelIsBold: false,
|
|
24
|
+
setRendererStyling: (params) => set(() => ({ itemLabelIsBold: (params.itemLabelIsBold = false) }))
|
|
25
|
+
}));
|
|
26
|
+
export const useRendererStylingStore = createSelectors(rendererStylingStore);
|
|
27
|
+
//# sourceMappingURL=stylingStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylingStore.js","sourceRoot":"","sources":["../../src/stores/stylingStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAgB7C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,EAA4B,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACpF,eAAe,EAAE,KAAK;IACtB,kBAAkB,EAAE,CAAC,MAAuB,EAAE,EAAE,CAC9C,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;CACrE,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuestionnaireItem, type QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
|
+
export interface CustomComponentProps {
|
|
3
|
+
qItem: QuestionnaireItem;
|
|
4
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
isTabled: boolean;
|
|
7
|
+
parentIsReadOnly?: boolean;
|
|
8
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=customComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customComponent.js","sourceRoot":"","sources":["../../src/utils/customComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, removeInternalIdsFromResponse } from './manageForm';
|
|
2
2
|
export { initialiseQuestionnaireResponse } from './initialise';
|
|
3
|
+
export { createEmptyQrItem } from './qrItem';
|
|
3
4
|
export { isSpecificItemControl } from './itemControl';
|
|
4
5
|
export { isRepeatItemAndNotCheckbox } from './qItem';
|
|
5
6
|
export type { ItemToRepopulate } from './repopulateItems';
|
package/lib/utils/index.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export { buildForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, removeInternalIdsFromResponse } from './manageForm';
|
|
18
18
|
export { initialiseQuestionnaireResponse } from './initialise';
|
|
19
|
+
export { createEmptyQrItem } from './qrItem';
|
|
19
20
|
export { isSpecificItemControl } from './itemControl';
|
|
20
21
|
export { isRepeatItemAndNotCheckbox } from './qItem';
|
|
21
22
|
export { generateItemsToRepopulate } from './repopulateItems';
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Questionnaire, QuestionnaireResponse, QuestionnaireResponseItem } from 'fhir/r4';
|
|
2
2
|
import type Client from 'fhirclient/lib/Client';
|
|
3
|
+
import { ComponentType } from 'react';
|
|
3
4
|
/**
|
|
4
5
|
* Build the form with an initial Questionnaire and an optional filled QuestionnaireResponse.
|
|
5
6
|
* If a QuestionnaireResponse is not provided, an empty QuestionnaireResponse is set as the initial QuestionnaireResponse.
|
|
@@ -10,10 +11,11 @@ import type Client from 'fhirclient/lib/Client';
|
|
|
10
11
|
* @param readOnly - Applies read-only mode to all items in the form view
|
|
11
12
|
* @param terminologyServerUrl - Terminology server url to fetch terminology. If not provided, the default terminology server will be used. (optional)
|
|
12
13
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
14
|
+
* @param customComponents - FIXME add comment
|
|
13
15
|
*
|
|
14
16
|
* @author Sean Fong
|
|
15
17
|
*/
|
|
16
|
-
export declare function buildForm(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, readOnly?: boolean, terminologyServerUrl?: string, additionalVariables?: Record<string, object
|
|
18
|
+
export declare function buildForm(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse, readOnly?: boolean, terminologyServerUrl?: string, additionalVariables?: Record<string, object>, customComponents?: Record<string, ComponentType<any>>): Promise<void>;
|
|
17
19
|
/**
|
|
18
20
|
* Destroy the form to clean up the questionnaire and questionnaireResponse stores.
|
|
19
21
|
*
|
package/lib/utils/manageForm.js
CHANGED
|
@@ -23,10 +23,11 @@ import { removeInternalRepeatIdsRecursive } from './removeRepeatId';
|
|
|
23
23
|
* @param readOnly - Applies read-only mode to all items in the form view
|
|
24
24
|
* @param terminologyServerUrl - Terminology server url to fetch terminology. If not provided, the default terminology server will be used. (optional)
|
|
25
25
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
26
|
+
* @param customComponents - FIXME add comment
|
|
26
27
|
*
|
|
27
28
|
* @author Sean Fong
|
|
28
29
|
*/
|
|
29
|
-
export function buildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables) {
|
|
30
|
+
export function buildForm(questionnaire, questionnaireResponse, readOnly, terminologyServerUrl, additionalVariables, customComponents) {
|
|
30
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
32
|
// Reset terminology server
|
|
32
33
|
if (terminologyServerUrl) {
|
|
@@ -38,7 +39,7 @@ export function buildForm(questionnaire, questionnaireResponse, readOnly, termin
|
|
|
38
39
|
// QR is set to undefined here to prevent it from being initialised twice. This is defined like that for backward compatibility purposes.
|
|
39
40
|
yield questionnaireStore
|
|
40
41
|
.getState()
|
|
41
|
-
.buildSourceQuestionnaire(questionnaire, undefined, additionalVariables, terminologyServerUrl);
|
|
42
|
+
.buildSourceQuestionnaire(questionnaire, undefined, additionalVariables, terminologyServerUrl, undefined, customComponents);
|
|
42
43
|
const initialisedQuestionnaireResponse = initialiseQuestionnaireResponse(questionnaire, questionnaireResponse);
|
|
43
44
|
questionnaireResponseStore.getState().buildSourceResponse(initialisedQuestionnaireResponse);
|
|
44
45
|
questionnaireStore.getState().updatePopulatedProperties(initialisedQuestionnaireResponse);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manageForm.js","sourceRoot":"","sources":["../../src/utils/manageForm.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"manageForm.js","sourceRoot":"","sources":["../../src/utils/manageForm.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAGpE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAgB,SAAS,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AChC,SAAS,CACV,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAiC;IACtE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACpG,CAAC"}
|
package/package.json
CHANGED
|
@@ -25,6 +25,7 @@ import Typography from '@mui/material/Typography';
|
|
|
25
25
|
import useDisplayCqfAndCalculatedExpression from '../../../hooks/useDisplayCqfAndCalculatedExpression';
|
|
26
26
|
import { structuredDataCapture } from 'fhir-sdc-helpers';
|
|
27
27
|
import { default as styleParse } from 'style-to-js';
|
|
28
|
+
import { useRendererStylingStore } from '../../../stores/rendererStylingStore';
|
|
28
29
|
|
|
29
30
|
interface ItemLabelTextProps {
|
|
30
31
|
qItem: QuestionnaireItem;
|
|
@@ -34,6 +35,8 @@ interface ItemLabelTextProps {
|
|
|
34
35
|
const ItemLabelText = memo(function ItemLabelText(props: ItemLabelTextProps) {
|
|
35
36
|
const { qItem, readOnly } = props;
|
|
36
37
|
|
|
38
|
+
const itemLabelFontWeight = useRendererStylingStore.use.itemLabelFontWeight();
|
|
39
|
+
|
|
37
40
|
let labelText = qItem.text ?? '';
|
|
38
41
|
|
|
39
42
|
// Use calculatedExpressionString if available
|
|
@@ -74,9 +77,14 @@ const ItemLabelText = memo(function ItemLabelText(props: ItemLabelTextProps) {
|
|
|
74
77
|
return <>{labelText}</>;
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
const textFontWeight = itemLabelFontWeight != 'default' ? itemLabelFontWeight : 'normal';
|
|
81
|
+
|
|
77
82
|
// parse regular text
|
|
78
83
|
return (
|
|
79
|
-
<Typography
|
|
84
|
+
<Typography
|
|
85
|
+
color={readOnly ? 'text.disabled' : 'text.primary'}
|
|
86
|
+
fontWeight={itemLabelFontWeight ? itemLabelFontWeight : 'normal'}
|
|
87
|
+
sx={{ mt: 0.25 }}>
|
|
80
88
|
{labelText}
|
|
81
89
|
</Typography>
|
|
82
90
|
);
|
|
@@ -24,7 +24,7 @@ import ItemLabelText from './ItemLabelText';
|
|
|
24
24
|
import Tooltip from '@mui/material/Tooltip';
|
|
25
25
|
import Typography from '@mui/material/Typography';
|
|
26
26
|
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
27
|
-
import
|
|
27
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
28
28
|
|
|
29
29
|
interface LabelWrapperProps {
|
|
30
30
|
qItem: QuestionnaireItem;
|
|
@@ -55,19 +55,21 @@ function ItemLabelWrapper(props: LabelWrapperProps) {
|
|
|
55
55
|
}
|
|
56
56
|
}}>
|
|
57
57
|
<span>
|
|
58
|
-
<Box
|
|
58
|
+
<Box position="relative">
|
|
59
59
|
{required ? (
|
|
60
|
-
<Typography
|
|
60
|
+
<Typography
|
|
61
|
+
color="red"
|
|
62
|
+
sx={{ position: 'absolute', top: 0, left: -8 }} // Adjust top and left values as needed
|
|
63
|
+
>
|
|
61
64
|
*
|
|
62
65
|
</Typography>
|
|
63
66
|
) : null}
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
) : null}
|
|
67
|
+
<Box display="flex" columnGap={0.5} justifyContent="space-between" alignItems="center">
|
|
68
|
+
<ItemLabelText qItem={qItem} readOnly={readOnly} />
|
|
69
|
+
{displayFlyover !== '' ? (
|
|
70
|
+
<InfoOutlinedIcon sx={{ color: 'text.secondary' }} fontSize="small" />
|
|
71
|
+
) : null}
|
|
72
|
+
</Box>
|
|
71
73
|
</Box>
|
|
72
74
|
</span>
|
|
73
75
|
</Tooltip>
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export { default as ItemFieldGrid } from './ItemFieldGrid';
|
|
@@ -41,6 +41,7 @@ import IntegerItem from '../IntegerItem/IntegerItem';
|
|
|
41
41
|
import AttachmentItem from '../AttachmentItem/AttachmentItem';
|
|
42
42
|
import CustomDateTimeItem from '../DateTimeItems/CustomDateTimeItem/CustomDateTimeItem';
|
|
43
43
|
import QuantityItem from '../QuantityItem/QuantityItem';
|
|
44
|
+
import { useQuestionnaireStore } from '../../../stores';
|
|
44
45
|
|
|
45
46
|
interface SingleItemSwitcherProps
|
|
46
47
|
extends PropsWithQrItemChangeHandler,
|
|
@@ -56,6 +57,25 @@ function SingleItemSwitcher(props: SingleItemSwitcherProps) {
|
|
|
56
57
|
const { qItem, qrItem, isRepeated, isTabled, showMinimalView, parentIsReadOnly, onQrItemChange } =
|
|
57
58
|
props;
|
|
58
59
|
|
|
60
|
+
const customComponents = useQuestionnaireStore.use.customComponents();
|
|
61
|
+
const CustomComponent = customComponents[qItem.linkId];
|
|
62
|
+
|
|
63
|
+
// If a custom component is defined for this item, render it
|
|
64
|
+
// Don't get too strict with the checks for now
|
|
65
|
+
if (CustomComponent && typeof CustomComponent === 'function') {
|
|
66
|
+
return (
|
|
67
|
+
<CustomComponent
|
|
68
|
+
qItem={qItem}
|
|
69
|
+
qrItem={qrItem}
|
|
70
|
+
isRepeated={isRepeated}
|
|
71
|
+
isTabled={isTabled}
|
|
72
|
+
parentIsReadOnly={parentIsReadOnly}
|
|
73
|
+
onQrItemChange={onQrItemChange}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Otherwise, render the default form component based on the item type
|
|
59
79
|
switch (qItem.type) {
|
|
60
80
|
case 'display':
|
|
61
81
|
return <DisplayItem qItem={qItem} />;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export { default as StringField } from './StringField';
|
|
@@ -21,3 +21,7 @@ export { RepeatGroup } from './RepeatGroup';
|
|
|
21
21
|
export { GroupTable } from './Tables';
|
|
22
22
|
export { GridGroup } from './GridGroup';
|
|
23
23
|
export { parseFhirDateToDisplayDate } from './DateTimeItems';
|
|
24
|
+
export { ItemFieldGrid } from './ItemParts';
|
|
25
|
+
|
|
26
|
+
// item type components
|
|
27
|
+
export { StringField } from './StringItem';
|
package/src/components/index.ts
CHANGED
|
@@ -23,5 +23,10 @@ export {
|
|
|
23
23
|
RepeatGroup,
|
|
24
24
|
GroupTable,
|
|
25
25
|
GridGroup,
|
|
26
|
-
parseFhirDateToDisplayDate
|
|
26
|
+
parseFhirDateToDisplayDate,
|
|
27
|
+
ItemFieldGrid,
|
|
28
|
+
StringField
|
|
27
29
|
} from './FormComponents';
|
|
30
|
+
|
|
31
|
+
// Styled MUI components
|
|
32
|
+
export { FullWidthFormComponentBox } from './Box.styles';
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export { default as useHidden } from './useHidden';
|
|
2
|
+
export { default as useReadOnly } from './useReadOnly';
|
|
2
3
|
export { default as useBuildForm } from './useBuildForm';
|
|
3
4
|
export { default as useRendererQueryClient } from './useRendererQueryClient';
|
|
5
|
+
export { default as useRenderingExtensions } from './useRenderingExtensions';
|
|
6
|
+
export { default as useValidationFeedback } from './useValidationFeedback';
|
|
7
|
+
|
|
8
|
+
// CalculatedExpression hooks
|
|
9
|
+
export { default as useStringCalculatedExpression } from './useStringCalculatedExpression';
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { useLayoutEffect, useState } from 'react';
|
|
18
|
+
import { ComponentType, useLayoutEffect, useState } from 'react';
|
|
19
19
|
import { buildForm } from '../utils';
|
|
20
20
|
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
21
|
+
import { RendererStyling, useRendererStylingStore } from '../stores/rendererStylingStore';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* React hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
|
|
@@ -28,6 +29,8 @@ import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
|
28
29
|
* @param readOnly - Applies read-only mode to all items in the form view
|
|
29
30
|
* @param terminologyServerUrl - Terminology server url to fetch terminology. If not provided, the default terminology server will be used. (optional)
|
|
30
31
|
* @param additionalVariables - Additional key-value pair of SDC variables `Record<name, variable extension>` for testing (optional)
|
|
32
|
+
* @param rendererStyling - Renderer styling to be applied to the form. See docs for styling options. (optional)
|
|
33
|
+
* @param customComponents - FIXME add comment
|
|
31
34
|
*
|
|
32
35
|
* @author Sean Fong
|
|
33
36
|
*/
|
|
@@ -36,17 +39,27 @@ function useBuildForm(
|
|
|
36
39
|
questionnaireResponse?: QuestionnaireResponse,
|
|
37
40
|
readOnly?: boolean,
|
|
38
41
|
terminologyServerUrl?: string,
|
|
39
|
-
additionalVariables?: Record<string, object
|
|
42
|
+
additionalVariables?: Record<string, object>,
|
|
43
|
+
rendererStyling?: RendererStyling,
|
|
44
|
+
customComponents?: Record<string, ComponentType<any>>
|
|
40
45
|
) {
|
|
41
46
|
const [isBuilding, setIsBuilding] = useState(true);
|
|
42
47
|
|
|
48
|
+
const setRendererStyling = useRendererStylingStore.use.setRendererStyling();
|
|
49
|
+
|
|
43
50
|
useLayoutEffect(() => {
|
|
51
|
+
// Set optional renderer styling
|
|
52
|
+
if (rendererStyling) {
|
|
53
|
+
setRendererStyling(rendererStyling);
|
|
54
|
+
}
|
|
55
|
+
|
|
44
56
|
buildForm(
|
|
45
57
|
questionnaire,
|
|
46
58
|
questionnaireResponse,
|
|
47
59
|
readOnly,
|
|
48
60
|
terminologyServerUrl,
|
|
49
|
-
additionalVariables
|
|
61
|
+
additionalVariables,
|
|
62
|
+
customComponents
|
|
50
63
|
).then(() => {
|
|
51
64
|
setIsBuilding(false);
|
|
52
65
|
});
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
// interface exports
|
|
2
|
-
export type {
|
|
2
|
+
export type {
|
|
3
|
+
Tab,
|
|
4
|
+
Tabs,
|
|
5
|
+
Variables,
|
|
6
|
+
VariableXFhirQuery,
|
|
7
|
+
LaunchContext,
|
|
8
|
+
CustomComponentProps
|
|
9
|
+
} from './interfaces';
|
|
3
10
|
|
|
4
11
|
// component exports
|
|
5
12
|
export type { SmartFormsRendererProps } from './components';
|
|
@@ -11,7 +18,10 @@ export {
|
|
|
11
18
|
RepeatGroup,
|
|
12
19
|
GroupTable,
|
|
13
20
|
GridGroup,
|
|
14
|
-
parseFhirDateToDisplayDate
|
|
21
|
+
parseFhirDateToDisplayDate,
|
|
22
|
+
ItemFieldGrid,
|
|
23
|
+
StringField,
|
|
24
|
+
FullWidthFormComponentBox
|
|
15
25
|
} from './components';
|
|
16
26
|
|
|
17
27
|
// state management store exports
|
|
@@ -33,7 +43,15 @@ export {
|
|
|
33
43
|
} from './stores';
|
|
34
44
|
|
|
35
45
|
// hooks exports
|
|
36
|
-
export {
|
|
46
|
+
export {
|
|
47
|
+
useHidden,
|
|
48
|
+
useReadOnly,
|
|
49
|
+
useBuildForm,
|
|
50
|
+
useRendererQueryClient,
|
|
51
|
+
useRenderingExtensions,
|
|
52
|
+
useValidationFeedback,
|
|
53
|
+
useStringCalculatedExpression
|
|
54
|
+
} from './hooks';
|
|
37
55
|
|
|
38
56
|
// utils exports
|
|
39
57
|
export type { ItemToRepopulate } from './utils';
|
|
@@ -43,6 +61,7 @@ export {
|
|
|
43
61
|
getResponse,
|
|
44
62
|
removeEmptyAnswersFromResponse,
|
|
45
63
|
removeInternalIdsFromResponse,
|
|
64
|
+
createEmptyQrItem,
|
|
46
65
|
isSpecificItemControl,
|
|
47
66
|
isRepeatItemAndNotCheckbox,
|
|
48
67
|
initialiseQuestionnaireResponse,
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { QuestionnaireItem, type QuestionnaireResponseItem } from 'fhir/r4';
|
|
19
|
+
|
|
20
|
+
export interface CustomComponentProps {
|
|
21
|
+
qItem: QuestionnaireItem;
|
|
22
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
23
|
+
isRepeated: boolean;
|
|
24
|
+
isTabled: boolean;
|
|
25
|
+
parentIsReadOnly?: boolean;
|
|
26
|
+
onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown;
|
|
27
|
+
}
|
package/src/interfaces/index.ts
CHANGED
|
@@ -19,3 +19,4 @@ export type { Tab, Tabs } from './tab.interface';
|
|
|
19
19
|
export type { Variables, VariableXFhirQuery } from './variables.interface';
|
|
20
20
|
export type { LaunchContext } from './populate.interface';
|
|
21
21
|
export type { EnableWhenItems, EnableWhenExpressions } from './enableWhen.interface';
|
|
22
|
+
export type { CustomComponentProps } from './customComponent.interface';
|