@aehrc/smart-forms-renderer 1.0.0-alpha.14 → 1.0.0-alpha.15
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/GroupItem/PageButtonWrapper.js +1 -1
- package/lib/components/FormComponents/GroupItem/PageButtonWrapper.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js +6 -1
- package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js.map +1 -1
- package/lib/stores/rendererStylingStore.d.ts +3 -0
- package/lib/stores/rendererStylingStore.js +4 -2
- package/lib/stores/rendererStylingStore.js.map +1 -1
- package/package.json +2 -2
- package/src/components/FormComponents/GroupItem/PageButtonWrapper.tsx +1 -1
- package/src/components/FormComponents/GroupItem/TabButtonsWrapper.tsx +7 -1
- package/src/stores/rendererStylingStore.ts +5 -1
|
@@ -33,7 +33,7 @@ const PageButtonsWrapper = memo(function PageButtonsWrapper(props) {
|
|
|
33
33
|
if (pagesNotDefined) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
|
-
// Disable page buttons - currently only available via
|
|
36
|
+
// Disable page buttons - currently only available via disablePageButtons API
|
|
37
37
|
if (disablePageButtons) {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageButtonWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/PageButtonWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,8BAA8B,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAO/E,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,kBAAkB,CAAC,KAA8B;IACxF,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAE1C,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC1D,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IAE5E,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,EAAE,GAAG,8BAA8B,CAC5F,gBAAgB,EAChB,KAAK,CACN,CAAC;IAEF,MAAM,eAAe,GAAG,gBAAgB,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,CAAC;IAE9E,iBAAiB;IACjB,SAAS,6BAA6B;QACpC,IAAI,iBAAiB,KAAK,IAAI,EAAE;YAC9B,OAAO;SACR;QAED,UAAU,CAAC,iBAAiB,CAAC,CAAC;QAE9B,wBAAwB;QACxB,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC;IAED,SAAS,yBAAyB;QAChC,IAAI,aAAa,KAAK,IAAI,EAAE;YAC1B,OAAO;SACR;QAED,UAAU,CAAC,aAAa,CAAC,CAAC;QAE1B,wBAAwB;QACxB,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC;IAED,+CAA+C;IAC/C,IAAI,eAAe,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IAED,
|
|
1
|
+
{"version":3,"file":"PageButtonWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/PageButtonWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,O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kBAAkB,EAAE;QACtB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,wBAAwB,GAAG,iBAAiB,KAAK,IAAI,CAAC;IAC5D,MAAM,oBAAoB,GAAG,aAAa,KAAK,IAAI,CAAC;IAEpD,iIAAiI;IACjI,MAAM,mBAAmB,GAAG,iBAAiB,IAAI,CAAC,CAAC;IAEnD,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAC,QAAQ;QACpD,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,GAAI;QACpB,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,gBAAgB;;YAC9C,GAAG,gBAAgB,GAAG,CAAC,MAAM,iBAAiB,EAAE,CAC3C;QACb,oBAAC,kBAAkB,IACjB,UAAU,EAAE,mBAAmB,IAAI,wBAAwB,EAC3D,mBAAmB,EAAE,6BAA6B,GAClD;QACF,oBAAC,cAAc,IACb,UAAU,EAAE,mBAAmB,IAAI,oBAAoB,EACvD,eAAe,EAAE,yBAAyB,GAC1C,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -16,13 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import React, { memo } from 'react';
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
|
-
import { useQuestionnaireStore } from '../../../stores';
|
|
19
|
+
import { useQuestionnaireStore, useRendererStylingStore } from '../../../stores';
|
|
20
20
|
import NextTabButton from './NextTabButton';
|
|
21
21
|
import PreviousTabButton from './PreviousTabButton';
|
|
22
22
|
import useNextAndPreviousVisibleTabs from '../../../hooks/useNextAndPreviousVisibleTabs';
|
|
23
23
|
const TabButtonsWrapper = memo(function TabButtonsWrapper(props) {
|
|
24
24
|
const { currentTabIndex, tabs } = props;
|
|
25
25
|
const switchTab = useQuestionnaireStore.use.switchTab();
|
|
26
|
+
const disableTabButtons = useRendererStylingStore.use.disableTabButtons();
|
|
26
27
|
const { previousTabIndex, nextTabIndex, numOfVisibleTabs } = useNextAndPreviousVisibleTabs(currentTabIndex, tabs);
|
|
27
28
|
const tabsNotDefined = currentTabIndex === undefined || tabs === undefined;
|
|
28
29
|
// Event handlers
|
|
@@ -45,6 +46,10 @@ const TabButtonsWrapper = memo(function TabButtonsWrapper(props) {
|
|
|
45
46
|
if (tabsNotDefined) {
|
|
46
47
|
return null;
|
|
47
48
|
}
|
|
49
|
+
// Disable tab buttons - currently only available via disableTabButtons API
|
|
50
|
+
if (disableTabButtons) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
48
53
|
const previousTabButtonHidden = previousTabIndex === null;
|
|
49
54
|
const nextTabButtonHidden = nextTabIndex === null;
|
|
50
55
|
// This is more of a fallback check to prevent the user from navigating to an invisble tab if buttons are visble for some reason
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabButtonsWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/TabButtonsWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"TabButtonsWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/TabButtonsWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C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C;IAEjD,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC;QACtB,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAChC,oBAAC,iBAAiB,IAChB,UAAU,EAAE,kBAAkB,EAC9B,kBAAkB,EAAE,4BAA4B,GAChD,CACH;QACD,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,GAAI;QACnB,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5B,oBAAC,aAAa,IAAC,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,wBAAwB,GAAI,CAC5F,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -19,6 +19,7 @@ export interface RendererStyling {
|
|
|
19
19
|
enableWhenAsReadOnly?: boolean | Set<QuestionnaireItem['type']>;
|
|
20
20
|
disablePageCardView?: boolean;
|
|
21
21
|
disablePageButtons?: boolean;
|
|
22
|
+
disableTabButtons?: boolean;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* RendererStylingStore properties and methods
|
|
@@ -38,6 +39,7 @@ export interface RendererStylingStoreType {
|
|
|
38
39
|
enableWhenAsReadOnly: boolean | Set<QuestionnaireItem['type']>;
|
|
39
40
|
disablePageCardView: boolean;
|
|
40
41
|
disablePageButtons: boolean;
|
|
42
|
+
disableTabButtons: boolean;
|
|
41
43
|
setRendererStyling: (params: RendererStyling) => void;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
@@ -58,6 +60,7 @@ export declare const useRendererStylingStore: import("zustand/vanilla").StoreApi
|
|
|
58
60
|
enableWhenAsReadOnly: () => boolean | Set<"string" | "boolean" | "group" | "display" | "question" | "decimal" | "integer" | "date" | "dateTime" | "time" | "text" | "url" | "choice" | "open-choice" | "attachment" | "reference" | "quantity">;
|
|
59
61
|
disablePageCardView: () => boolean;
|
|
60
62
|
disablePageButtons: () => boolean;
|
|
63
|
+
disableTabButtons: () => boolean;
|
|
61
64
|
setRendererStyling: () => (params: RendererStyling) => void;
|
|
62
65
|
};
|
|
63
66
|
};
|
|
@@ -32,9 +32,10 @@ export const rendererStylingStore = createStore()((set) => ({
|
|
|
32
32
|
enableWhenAsReadOnly: false,
|
|
33
33
|
disablePageCardView: false,
|
|
34
34
|
disablePageButtons: false,
|
|
35
|
+
disableTabButtons: false,
|
|
35
36
|
setRendererStyling: (params) => {
|
|
36
37
|
set(() => {
|
|
37
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
38
39
|
return ({
|
|
39
40
|
itemLabelFontWeight: (_a = params.itemLabelFontWeight) !== null && _a !== void 0 ? _a : 'default',
|
|
40
41
|
requiredIndicatorPosition: (_b = params.requiredIndicatorPosition) !== null && _b !== void 0 ? _b : 'start',
|
|
@@ -47,7 +48,8 @@ export const rendererStylingStore = createStore()((set) => ({
|
|
|
47
48
|
hideQuantityComparatorField: (_j = params.hideQuantityComparatorField) !== null && _j !== void 0 ? _j : false,
|
|
48
49
|
enableWhenAsReadOnly: (_k = params.enableWhenAsReadOnly) !== null && _k !== void 0 ? _k : false,
|
|
49
50
|
disablePageCardView: (_l = params.disablePageCardView) !== null && _l !== void 0 ? _l : false,
|
|
50
|
-
disablePageButtons: (_m = params.disablePageButtons) !== null && _m !== void 0 ? _m : false
|
|
51
|
+
disablePageButtons: (_m = params.disablePageButtons) !== null && _m !== void 0 ? _m : false,
|
|
52
|
+
disableTabButtons: (_o = params.disableTabButtons) !== null && _o !== void 0 ? _o : false
|
|
51
53
|
});
|
|
52
54
|
});
|
|
53
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendererStylingStore.js","sourceRoot":"","sources":["../../src/stores/rendererStylingStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;G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AAM,CAAC,wBAAwB,mCAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE;gBAC9E,cAAc,EAAE,MAAA,MAAM,CAAC,cAAc,mCAAI,GAAG;gBAC5C,cAAc,EAAE,MAAA,MAAM,CAAC,cAAc,mCAAI,KAAK;gBAC9C,mBAAmB,EAAE,MAAA,MAAM,CAAC,mBAAmB,mCAAI,KAAK;gBACxD,eAAe,EAAE,MAAA,MAAM,CAAC,eAAe,mCAAI,KAAK;gBAChD,2BAA2B,EAAE,MAAA,MAAM,CAAC,2BAA2B,mCAAI,KAAK;gBACxE,oBAAoB,EAAE,MAAA,MAAM,CAAC,oBAAoB,mCAAI,KAAK;gBAC1D,mBAAmB,EAAE,MAAA,MAAM,CAAC,mBAAmB,mCAAI,KAAK;gBACxD,kBAAkB,EAAE,MAAA,MAAM,CAAC,kBAAkB,mCAAI,KAAK;gBACtD,iBAAiB,EAAE,MAAA,MAAM,CAAC,iBAAiB,mCAAI,KAAK;aACrD,CAAC,CAAA;SAAA,CAAC,CAAC;IACN,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aehrc/smart-forms-renderer",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.15",
|
|
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 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/aehrc/smart-forms#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aehrc/sdc-populate": "^3.0.
|
|
31
|
+
"@aehrc/sdc-populate": "^3.0.1",
|
|
32
32
|
"@iconify/react": "^4.1.1",
|
|
33
33
|
"dayjs": "^1.11.10",
|
|
34
34
|
"deep-diff": "^1.0.2",
|
|
@@ -54,7 +54,7 @@ const PageButtonsWrapper = memo(function PageButtonsWrapper(props: PageButtonsWr
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
// Disable page buttons - currently only available via
|
|
57
|
+
// Disable page buttons - currently only available via disablePageButtons API
|
|
58
58
|
if (disablePageButtons) {
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import React, { memo } from 'react';
|
|
19
19
|
import Box from '@mui/material/Box';
|
|
20
20
|
import type { Tabs } from '../../../interfaces/tab.interface';
|
|
21
|
-
import { useQuestionnaireStore } from '../../../stores';
|
|
21
|
+
import { useQuestionnaireStore, useRendererStylingStore } from '../../../stores';
|
|
22
22
|
import NextTabButton from './NextTabButton';
|
|
23
23
|
import PreviousTabButton from './PreviousTabButton';
|
|
24
24
|
import useNextAndPreviousVisibleTabs from '../../../hooks/useNextAndPreviousVisibleTabs';
|
|
@@ -32,6 +32,7 @@ const TabButtonsWrapper = memo(function TabButtonsWrapper(props: TabButtonsWrapp
|
|
|
32
32
|
const { currentTabIndex, tabs } = props;
|
|
33
33
|
|
|
34
34
|
const switchTab = useQuestionnaireStore.use.switchTab();
|
|
35
|
+
const disableTabButtons = useRendererStylingStore.use.disableTabButtons();
|
|
35
36
|
|
|
36
37
|
const { previousTabIndex, nextTabIndex, numOfVisibleTabs } = useNextAndPreviousVisibleTabs(
|
|
37
38
|
currentTabIndex,
|
|
@@ -67,6 +68,11 @@ const TabButtonsWrapper = memo(function TabButtonsWrapper(props: TabButtonsWrapp
|
|
|
67
68
|
return null;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
// Disable tab buttons - currently only available via disableTabButtons API
|
|
72
|
+
if (disableTabButtons) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
70
76
|
const previousTabButtonHidden = previousTabIndex === null;
|
|
71
77
|
const nextTabButtonHidden = nextTabIndex === null;
|
|
72
78
|
|
|
@@ -50,6 +50,7 @@ export interface RendererStyling {
|
|
|
50
50
|
enableWhenAsReadOnly?: boolean | Set<QuestionnaireItem['type']>; // The Set<QuestionnaireItem['type']> is used to store the types of items that should be displayed as readOnly when hidden by enableWhen
|
|
51
51
|
disablePageCardView?: boolean;
|
|
52
52
|
disablePageButtons?: boolean;
|
|
53
|
+
disableTabButtons?: boolean;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
/**
|
|
@@ -80,6 +81,7 @@ export interface RendererStylingStoreType {
|
|
|
80
81
|
enableWhenAsReadOnly: boolean | Set<QuestionnaireItem['type']>;
|
|
81
82
|
disablePageCardView: boolean;
|
|
82
83
|
disablePageButtons: boolean;
|
|
84
|
+
disableTabButtons: boolean;
|
|
83
85
|
setRendererStyling: (params: RendererStyling) => void;
|
|
84
86
|
}
|
|
85
87
|
|
|
@@ -99,6 +101,7 @@ export const rendererStylingStore = createStore<RendererStylingStoreType>()((set
|
|
|
99
101
|
enableWhenAsReadOnly: false,
|
|
100
102
|
disablePageCardView: false,
|
|
101
103
|
disablePageButtons: false,
|
|
104
|
+
disableTabButtons: false,
|
|
102
105
|
setRendererStyling: (params: RendererStyling) => {
|
|
103
106
|
set(() => ({
|
|
104
107
|
itemLabelFontWeight: params.itemLabelFontWeight ?? 'default',
|
|
@@ -112,7 +115,8 @@ export const rendererStylingStore = createStore<RendererStylingStoreType>()((set
|
|
|
112
115
|
hideQuantityComparatorField: params.hideQuantityComparatorField ?? false,
|
|
113
116
|
enableWhenAsReadOnly: params.enableWhenAsReadOnly ?? false,
|
|
114
117
|
disablePageCardView: params.disablePageCardView ?? false,
|
|
115
|
-
disablePageButtons: params.disablePageButtons ?? false
|
|
118
|
+
disablePageButtons: params.disablePageButtons ?? false,
|
|
119
|
+
disableTabButtons: params.disableTabButtons ?? false
|
|
116
120
|
}));
|
|
117
121
|
}
|
|
118
122
|
}));
|