@aehrc/smart-forms-renderer 0.34.2 → 0.35.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/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js +3 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemView.d.ts +1 -2
- package/lib/components/FormComponents/GroupItem/GroupItemView.js +3 -3
- package/lib/components/FormComponents/GroupItem/GroupItemView.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupView.js +3 -3
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupView.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/NestedSingleItemAccordion.styles.d.ts +27 -0
- package/lib/components/FormComponents/SingleItem/NestedSingleItemAccordion.styles.js +51 -0
- package/lib/components/FormComponents/SingleItem/NestedSingleItemAccordion.styles.js.map +1 -0
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItem.js +3 -17
- package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItemView.d.ts +13 -0
- package/lib/components/FormComponents/SingleItem/SingleItemView.js +63 -0
- package/lib/components/FormComponents/SingleItem/SingleItemView.js.map +1 -0
- package/lib/components/FormComponents/SingleItem/StopPropagationWrapper.d.ts +7 -0
- package/lib/components/FormComponents/SingleItem/StopPropagationWrapper.js +25 -0
- package/lib/components/FormComponents/SingleItem/StopPropagationWrapper.js.map +1 -0
- package/lib/components/Renderer/FormTopLevelItem.js +1 -1
- package/package.json +1 -1
- package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx +3 -1
- package/src/components/FormComponents/GroupItem/GroupItemView.tsx +5 -5
- package/src/components/FormComponents/RepeatGroup/RepeatGroupView.tsx +3 -3
- package/src/components/FormComponents/SingleItem/NestedSingleItemAccordion.styles.ts +54 -0
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +15 -51
- package/src/components/FormComponents/SingleItem/SingleItemView.tsx +169 -0
- package/src/components/FormComponents/SingleItem/StopPropagationWrapper.tsx +38 -0
- package/src/components/Renderer/FormTopLevelItem.tsx +1 -1
- package/src/stories/assets/questionnaires/QAdvancedControlAppearance.ts +256 -15
- package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +23 -9
package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js
CHANGED
|
@@ -75,6 +75,7 @@ function CustomDateTimeItem(props) {
|
|
|
75
75
|
setDateInput(newDateInput);
|
|
76
76
|
if (newDateInput === '') {
|
|
77
77
|
onQrItemChange(createEmptyQrItem(qItem));
|
|
78
|
+
return;
|
|
78
79
|
}
|
|
79
80
|
if (!validateDateInput(newDateInput)) {
|
|
80
81
|
return;
|
|
@@ -85,7 +86,8 @@ function CustomDateTimeItem(props) {
|
|
|
85
86
|
setTimeInput(newTimeInput);
|
|
86
87
|
setPeriodInput(newPeriodInput);
|
|
87
88
|
if (newTimeInput === '') {
|
|
88
|
-
|
|
89
|
+
updateQRDateTime(dateInput, '', '', false);
|
|
90
|
+
return;
|
|
89
91
|
}
|
|
90
92
|
const { timeIsValid, is24HourNotation } = validateTimeInput(newTimeInput, newPeriodInput);
|
|
91
93
|
if (!validateDateInput(dateInput) || !timeIsValid) {
|
package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDateTimeItem.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQxC,OAAO,WAAW,MAAM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CAAC,CAAC;IAC/D,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,CAC1D,SAAS,EACT,WAAW,EACX,aAAa,CACd,CAAC;IAEF,YAAY,GAAG,yBAAyB,CAAC,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IAE3F,SAAS,gBAAgB,CAAC,YAAoB;QAC5C,YAAY,CAAC,YAAY,CAAC,CAAC;QAC3B,gBAAgB,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;IAC3E,CAAC;IAED,SAAS,qBAAqB,CAAC,YAAoB;QACjD,YAAY,CAAC,YAAY,CAAC,CAAC;QAE3B,IAAI,YAAY,KAAK,EAAE,EAAE;YACvB,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomDateTimeItem.js","sourceRoot":"","sources":["../../../../../src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQxC,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,sBAAsB,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,KAAK,MAAM,qBAAqB,CAAC;A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AAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,qBAAqB,EACxC,YAAY,EAAE,gBAAgB,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,qBAAqB,GACxC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithParentIsRepeatGroupAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
import type { PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
3
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithParentIsRepeatGroupAttribute, PropsWithQrItemChangeHandler, PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
5
4
|
import type { Tabs } from '../../../interfaces/tab.interface';
|
|
6
5
|
interface GroupItemViewProps extends PropsWithQrItemChangeHandler, PropsWithQrRepeatGroupChangeHandler, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithParentIsRepeatGroupAttribute {
|
|
7
6
|
qItem: QuestionnaireItem;
|
|
@@ -32,9 +32,9 @@ function GroupItemView(props) {
|
|
|
32
32
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
33
33
|
// Render collapsible group item
|
|
34
34
|
// If group item is a repeating instance, do not render group item as collapsible
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
const isDefaultOpen =
|
|
35
|
+
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
36
|
+
if (groupCollapsibleValue && !isRepeated) {
|
|
37
|
+
const isDefaultOpen = groupCollapsibleValue === 'default-open';
|
|
38
38
|
return (React.createElement(GroupAccordion, { disableGutters: true, defaultExpanded: isDefaultOpen, elevation: groupCardElevation, isRepeated: isRepeated, slotProps: {
|
|
39
39
|
transition: { unmountOnExit: true, timeout: 250 }
|
|
40
40
|
} },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupItemView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAStD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAiBzD,SAAS,aAAa,CAAC,KAAyB;IAC9C,MAAM,EACJ,KAAK,EACL,WAAW,EACX,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,IAAI,EACJ,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACtB,GAAG,KAAK,CAAC;IAEV,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAEtD,gCAAgC;IAChC,iFAAiF;IACjF,MAAM,
|
|
1
|
+
{"version":3,"file":"GroupItemView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupItemView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAStD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAiBzD,SAAS,aAAa,CAAC,KAAyB;IAC9C,MAAM,EACJ,KAAK,EACL,WAAW,EACX,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,IAAI,EACJ,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACtB,GAAG,KAAK,CAAC;IAEV,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAEtD,gCAAgC;IAChC,iFAAiF;IACjF,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACzD,IAAI,qBAAqB,IAAI,CAAC,UAAU,EAAE;QACxC,MAAM,aAAa,GAAG,qBAAqB,KAAK,cAAc,CAAC;QAC/D,OAAO,CACL,oBAAC,cAAc,I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kBAAkB,IACjB,aAAa,EAAE,kBAAkB,EACjC,UAAU,EAAE,UAAU,eACZ,kBAAkB;QAC5B,oBAAC,SAAS,IAAC,SAAS,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU;YAC9D,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,EAC5C,UAAU,EAAE,UAAU,GACtB;YACD,WAAW,CAAC,GAAG,CAAC,CAAC,KAAwB,EAAE,CAAC,EAAE,EAAE;gBAC/C,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;gBAExC,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,KAAK,CAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,QAAQ,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,sBAAsB,EAAE,sBAAsB,EAC9C,cAAc,EAAE,cAAc,EAC9B,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC;YACJ,CAAC,CAAC;YAGF,oBAAC,iBAAiB,IAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,GAAI,CACzD,CACO,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -50,9 +50,9 @@ function RepeatGroupView(props) {
|
|
|
50
50
|
return (React.createElement(RepeatGroupItem, { key: nanoId, qItem: qItem, repeatGroupIndex: index, answeredQrItem: answeredQrItem, nullableQrItem: nullableQrItem, numOfRepeatGroups: repeatGroups.length, groupCardElevation: groupCardElevation + 1, showMinimalView: showMinimalView, parentIsReadOnly: parentIsReadOnly, onDeleteItem: () => onDeleteItem(index), onQrItemChange: (newQrItem) => onAnswerChange(newQrItem, index) }));
|
|
51
51
|
}))));
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const isDefaultOpen =
|
|
53
|
+
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
54
|
+
if (groupCollapsibleValue) {
|
|
55
|
+
const isDefaultOpen = groupCollapsibleValue === 'default-open';
|
|
56
56
|
return (React.createElement(GroupAccordion, { disableGutters: true, defaultExpanded: isDefaultOpen, elevation: groupCardElevation, isRepeated: true, slotProps: {
|
|
57
57
|
transition: { unmountOnExit: true, timeout: 250 }
|
|
58
58
|
} },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatGroupView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/RepeatGroup/RepeatGroupView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAc9D;;;;;GAKG;AACH,SAAS,eAAe,CAAC,KAA2B;I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AE,GAAG;oBACjC,oBAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,KAAK,EACvB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,YAAY,CAAC,MAAM,EACtC,kBAAkB,EAAE,kBAAkB,GAAG,CAAC,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EACvC,cAAc,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,GAC/D,CACO,CACZ,CAAC;YACJ,CAAC,CAAC,CACc;YAElB,oBAAC,aAAa,IAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAI,CAClF,CACY,CACtB,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const NestedSingleItemAccordionWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
|
+
isRepeated: boolean;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export declare const NestedSingleItemAccordion: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
children: NonNullable<import("react").ReactNode>;
|
|
9
|
+
classes?: Partial<import("@mui/material").AccordionClasses> | undefined;
|
|
10
|
+
defaultExpanded?: boolean | undefined;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
12
|
+
disableGutters?: boolean | undefined;
|
|
13
|
+
expanded?: boolean | undefined;
|
|
14
|
+
onChange?: ((event: import("react").SyntheticEvent<Element, Event>, expanded: boolean) => void) | undefined;
|
|
15
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
16
|
+
TransitionComponent?: import("react").JSXElementConstructor<import("@mui/material/transitions").TransitionProps & {
|
|
17
|
+
children?: import("react").ReactElement<any, any> | undefined;
|
|
18
|
+
}> | undefined;
|
|
19
|
+
TransitionProps?: import("@mui/material/transitions").TransitionProps | undefined;
|
|
20
|
+
} & import("@mui/material").AccordionSlotsAndSlotProps & Omit<import("@mui/material").PaperOwnProps, "onChange" | "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
22
|
+
}, "disabled" | "children" | "onChange" | "sx" | "elevation" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "square" | "expanded" | "disableGutters" | "defaultExpanded" | "TransitionComponent" | "TransitionProps" | keyof import("@mui/material").AccordionSlotsAndSlotProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
23
|
+
elevation: number;
|
|
24
|
+
}, {}, {}>;
|
|
25
|
+
export declare const NestedSingleItemAccordionSummary: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionSummaryOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
26
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
27
|
+
}, "disabled" | "style" | "children" | "className" | "tabIndex" | "sx" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "expandIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { styled } from '@mui/material/styles';
|
|
18
|
+
import { AccordionSummary } from '@mui/material';
|
|
19
|
+
import Accordion from '@mui/material/Accordion';
|
|
20
|
+
import Box from '@mui/material/Box';
|
|
21
|
+
export const NestedSingleItemAccordionWrapper = styled(Box, {
|
|
22
|
+
shouldForwardProp: (prop) => prop !== 'isRepeated'
|
|
23
|
+
})(({ isRepeated }) => ({
|
|
24
|
+
marginBottom: isRepeated ? 0 : '28px'
|
|
25
|
+
}));
|
|
26
|
+
export const NestedSingleItemAccordion = styled(Accordion, {
|
|
27
|
+
shouldForwardProp: (prop) => prop !== 'elevation'
|
|
28
|
+
})(({ elevation }) => ({
|
|
29
|
+
paddingTop: '8px',
|
|
30
|
+
paddingBottom: '4px',
|
|
31
|
+
paddingLeft: elevation === 1 ? '10px' : '8px',
|
|
32
|
+
paddingRight: elevation === 1 ? '10px' : '8px'
|
|
33
|
+
}));
|
|
34
|
+
export const NestedSingleItemAccordionSummary = styled(AccordionSummary)(() => ({
|
|
35
|
+
minHeight: '28px',
|
|
36
|
+
'.MuiAccordionSummary-expandIconWrapper': {
|
|
37
|
+
'&:hover:not(.Mui-disabled)': {
|
|
38
|
+
cursor: 'pointer'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
'.MuiAccordionSummary-content': {
|
|
42
|
+
marginBottom: 0
|
|
43
|
+
},
|
|
44
|
+
'&.Mui-focusVisible': {
|
|
45
|
+
backgroundColor: 'transparent'
|
|
46
|
+
},
|
|
47
|
+
'&:hover:not(.Mui-disabled)': {
|
|
48
|
+
cursor: 'default'
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
//# sourceMappingURL=NestedSingleItemAccordion.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedSingleItemAccordion.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/NestedSingleItemAccordion.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC,GAAG,EAAE;IAC1D,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,YAAY;CACnD,CAAC,CAA0B,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/C,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;CACtC,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,SAAS,EAAE;IACzD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW;CAClD,CAAC,CAAwB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5C,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK;IAC7C,YAAY,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK;CAC/C,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9E,SAAS,EAAE,MAAM;IACjB,wCAAwC,EAAE;QACxC,4BAA4B,EAAE;YAC5B,MAAM,EAAE,SAAS;SAClB;KACF;IACD,8BAA8B,EAAE;QAC9B,YAAY,EAAE,CAAC;KAChB;IACD,oBAAoB,EAAE;QACpB,eAAe,EAAE,aAAa;KAC/B;IACD,4BAA4B,EAAE;QAC5B,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAC,CAAC"}
|
|
@@ -12,5 +12,5 @@ interface SingleItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepea
|
|
|
12
12
|
*
|
|
13
13
|
* @author Sean Fong
|
|
14
14
|
*/
|
|
15
|
-
declare function SingleItem(props: SingleItemProps): React.JSX.Element
|
|
15
|
+
declare function SingleItem(props: SingleItemProps): React.JSX.Element;
|
|
16
16
|
export default SingleItem;
|
|
@@ -16,13 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import React, { useCallback, useMemo } from 'react';
|
|
18
18
|
import { useQuestionnaireStore } from '../../../stores';
|
|
19
|
-
import SingleItemSwitcher from './SingleItemSwitcher';
|
|
20
19
|
import useHidden from '../../../hooks/useHidden';
|
|
21
20
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
22
|
-
import SingleNestedItems from './SingleNestedItems';
|
|
23
|
-
import { GroupCard } from '../GroupItem/GroupItem.styles';
|
|
24
|
-
import { QGroupContainerBox } from '../../Box.styles';
|
|
25
21
|
import { shouldRenderNestedItems } from '../../../utils/itemControl';
|
|
22
|
+
import SingleItemView from './SingleItemView';
|
|
26
23
|
/**
|
|
27
24
|
* Main component to render a repeating, non-group Questionnaire item.
|
|
28
25
|
* Store and manages the state of multiple instances of SingleItem in a repeating item.
|
|
@@ -52,21 +49,10 @@ function SingleItem(props) {
|
|
|
52
49
|
const updatedQrItem = qrItem ? Object.assign(Object.assign({}, qrItem), { item: newQrItem.item }) : newQrItem;
|
|
53
50
|
onQrItemChange(updatedQrItem);
|
|
54
51
|
}, [qrItem, onQrItemChange]);
|
|
55
|
-
const
|
|
52
|
+
const itemHasNestedItems = useMemo(() => !!qItem.item && qItem.item.length > 0 && shouldRenderNestedItems(qItem), [qItem]);
|
|
56
53
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
57
54
|
const itemIsHidden = useHidden(qItem, parentRepeatGroupIndex);
|
|
58
|
-
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
if (qItemHasNestedItems) {
|
|
62
|
-
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: isRepeated, "data-test": "q-item-group-box" },
|
|
63
|
-
React.createElement(GroupCard, { elevation: groupCardElevation, isRepeated: isRepeated },
|
|
64
|
-
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: handleQrItemChange }),
|
|
65
|
-
qItemHasNestedItems ? (React.createElement(React.Fragment, null,
|
|
66
|
-
React.createElement(SingleNestedItems, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, parentIsReadOnly: readOnly, onQrItemChange: handleQrItemChangeWithNestedItems }))) : null)));
|
|
67
|
-
}
|
|
68
|
-
return (React.createElement(React.Fragment, null,
|
|
69
|
-
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: handleQrItemChange })));
|
|
55
|
+
return (React.createElement(SingleItemView, { qItem: qItem, qrItem: qrItem, itemIsHidden: itemIsHidden, itemHasNestedItems: itemHasNestedItems, isRepeated: isRepeated, isTabled: isTabled, groupCardElevation: groupCardElevation, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: handleQrItemChange, onQrItemChangeWithNestedItems: handleQrItemChangeWithNestedItems }));
|
|
70
56
|
}
|
|
71
57
|
export default SingleItem;
|
|
72
58
|
//# sourceMappingURL=SingleItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAUpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"SingleItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAUpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAc9C;;;;;GAKG;AACH,SAA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C,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAC7E,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;IAE9D,OAAO,CACL,oBAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,kBAAkB,EAClC,6BAA6B,EAAE,iCAAiC,GAChE,CACH,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
+
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
|
|
4
|
+
interface SingleItemViewProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
|
|
5
|
+
qItem: QuestionnaireItem;
|
|
6
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
7
|
+
itemIsHidden: boolean;
|
|
8
|
+
itemHasNestedItems: boolean;
|
|
9
|
+
groupCardElevation: number;
|
|
10
|
+
onQrItemChangeWithNestedItems: (newQrItem: QuestionnaireResponseItem) => void;
|
|
11
|
+
}
|
|
12
|
+
declare function SingleItemView(props: SingleItemViewProps): React.JSX.Element | null;
|
|
13
|
+
export default SingleItemView;
|
|
@@ -0,0 +1,63 @@
|
|
|
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 React from 'react';
|
|
18
|
+
import SingleItemSwitcher from './SingleItemSwitcher';
|
|
19
|
+
import SingleNestedItems from './SingleNestedItems';
|
|
20
|
+
import { GroupCard } from '../GroupItem/GroupItem.styles';
|
|
21
|
+
import { QGroupContainerBox } from '../../Box.styles';
|
|
22
|
+
import { getGroupCollapsible } from '../../../utils/qItem';
|
|
23
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
24
|
+
import AccordionDetails from '@mui/material/AccordionDetails';
|
|
25
|
+
import StopPropagationWrapper from './StopPropagationWrapper';
|
|
26
|
+
import { NestedSingleItemAccordion, NestedSingleItemAccordionSummary, NestedSingleItemAccordionWrapper } from './NestedSingleItemAccordion.styles';
|
|
27
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
28
|
+
import Box from '@mui/material/Box';
|
|
29
|
+
function SingleItemView(props) {
|
|
30
|
+
const { qItem, qrItem, itemIsHidden, itemHasNestedItems, isRepeated, isTabled, groupCardElevation, showMinimalView, parentIsReadOnly, onQrItemChange, onQrItemChangeWithNestedItems } = props;
|
|
31
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
32
|
+
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
33
|
+
// Item hidden, do not render
|
|
34
|
+
if (itemIsHidden) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// Item has nested items and is collapsible
|
|
38
|
+
if (itemHasNestedItems && groupCollapsibleValue) {
|
|
39
|
+
const isDefaultOpen = groupCollapsibleValue === 'default-open';
|
|
40
|
+
return (React.createElement(NestedSingleItemAccordionWrapper, { isRepeated: isRepeated },
|
|
41
|
+
React.createElement(NestedSingleItemAccordion, { disableGutters: true, defaultExpanded: isDefaultOpen, elevation: groupCardElevation, slotProps: {
|
|
42
|
+
transition: { unmountOnExit: true, timeout: 250 }
|
|
43
|
+
} },
|
|
44
|
+
React.createElement(NestedSingleItemAccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null) },
|
|
45
|
+
React.createElement(Box, { width: "100%" },
|
|
46
|
+
React.createElement(StopPropagationWrapper, null,
|
|
47
|
+
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange })))),
|
|
48
|
+
React.createElement(AccordionDetails, { sx: { pt: 0 } },
|
|
49
|
+
React.createElement(Box, { mr: 3 },
|
|
50
|
+
React.createElement(SingleNestedItems, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChangeWithNestedItems }))))));
|
|
51
|
+
}
|
|
52
|
+
// Item has nested items but is not collapsible
|
|
53
|
+
if (itemHasNestedItems) {
|
|
54
|
+
return (React.createElement(QGroupContainerBox, { cardElevation: groupCardElevation, isRepeated: isRepeated, "data-test": "q-item-group-box" },
|
|
55
|
+
React.createElement(GroupCard, { elevation: groupCardElevation, isRepeated: isRepeated },
|
|
56
|
+
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }),
|
|
57
|
+
React.createElement(SingleNestedItems, { qItem: qItem, qrItem: qrItem, groupCardElevation: groupCardElevation, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChangeWithNestedItems }))));
|
|
58
|
+
}
|
|
59
|
+
return (React.createElement(React.Fragment, null,
|
|
60
|
+
React.createElement(SingleItemSwitcher, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, showMinimalView: showMinimalView, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange })));
|
|
61
|
+
}
|
|
62
|
+
export default SingleItemView;
|
|
63
|
+
//# sourceMappingURL=SingleItemView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SingleItemView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/SingleItemView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,GAAG,MAAM,mBAAmB,CAAC;A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,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,6BAA6B,GAC7C,CACE,CACW,CACO,CACK,CACpC,CAAC;KACH;IAED,+CAA+C;IAC/C,IAAI,kBAAkB,EAAE;QACtB,OAAO,CACL,oBAAC,kBAAkB,IACjB,aAAa,EAAE,kBAAkB,EACjC,UAAU,EAAE,UAAU,eACZ,kBAAkB;YAC5B,oBAAC,SAAS,IAAC,SAAS,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU;gBAC9D,oBAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B;gBACF,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,6BAA6B,GAC7C,CACQ,CACO,CACtB,CAAC;KACH;IAED,OAAO,CACL;QACE,oBAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,QAAQ,EAC1B,cAAc,EAAE,cAAc,GAC9B,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface StopPropagationWrapperProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare function StopPropagationWrapper(props: StopPropagationWrapperProps): React.JSX.Element;
|
|
7
|
+
export default StopPropagationWrapper;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 React from 'react';
|
|
18
|
+
function StopPropagationWrapper(props) {
|
|
19
|
+
const { children } = props;
|
|
20
|
+
return (React.createElement("div", { onClick: (event) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
} }, children));
|
|
23
|
+
}
|
|
24
|
+
export default StopPropagationWrapper;
|
|
25
|
+
//# sourceMappingURL=StopPropagationWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StopPropagationWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/SingleItem/StopPropagationWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,SAAS,sBAAsB,CAAC,KAAkC;IAChE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE3B,OAAO,CACL,6BACE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,KAAK,CAAC,eAAe,EAAE,CAAC;QAC1B,CAAC,IACA,QAAQ,CACL,CACP,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -55,7 +55,7 @@ function FormTopLevelItem(props) {
|
|
|
55
55
|
return (React.createElement(GroupItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, groupCardElevation: 1, isRepeated: false, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange }));
|
|
56
56
|
}
|
|
57
57
|
// Otherwise, it is rendered as a non-group item
|
|
58
|
-
return (React.createElement(Box, {
|
|
58
|
+
return (React.createElement(Box, { mt: 1 },
|
|
59
59
|
React.createElement(SingleItem, { key: topLevelQItem.linkId, qItem: topLevelQItem, qrItem: topLevelQRItem, isRepeated: false, isTabled: false, groupCardElevation: 1, parentIsReadOnly: readOnly, onQrItemChange: onQrItemChange })));
|
|
60
60
|
}
|
|
61
61
|
export default FormTopLevelItem;
|
package/package.json
CHANGED
package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx
CHANGED
|
@@ -112,6 +112,7 @@ function CustomDateTimeItem(props: CustomDateTimeItemProps) {
|
|
|
112
112
|
|
|
113
113
|
if (newDateInput === '') {
|
|
114
114
|
onQrItemChange(createEmptyQrItem(qItem));
|
|
115
|
+
return;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
if (!validateDateInput(newDateInput)) {
|
|
@@ -126,7 +127,8 @@ function CustomDateTimeItem(props: CustomDateTimeItemProps) {
|
|
|
126
127
|
setPeriodInput(newPeriodInput);
|
|
127
128
|
|
|
128
129
|
if (newTimeInput === '') {
|
|
129
|
-
|
|
130
|
+
updateQRDateTime(dateInput, '', '', false);
|
|
131
|
+
return;
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
const { timeIsValid, is24HourNotation } = validateTimeInput(newTimeInput, newPeriodInput);
|
|
@@ -22,9 +22,9 @@ import type {
|
|
|
22
22
|
PropsWithIsRepeatedAttribute,
|
|
23
23
|
PropsWithParentIsReadOnlyAttribute,
|
|
24
24
|
PropsWithParentIsRepeatGroupAttribute,
|
|
25
|
-
PropsWithQrItemChangeHandler
|
|
25
|
+
PropsWithQrItemChangeHandler,
|
|
26
|
+
PropsWithQrRepeatGroupChangeHandler
|
|
26
27
|
} from '../../../interfaces/renderProps.interface';
|
|
27
|
-
import type { PropsWithQrRepeatGroupChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
28
28
|
import type { Tabs } from '../../../interfaces/tab.interface';
|
|
29
29
|
import GroupHeading from './GroupHeading';
|
|
30
30
|
import { GroupCard } from './GroupItem.styles';
|
|
@@ -74,9 +74,9 @@ function GroupItemView(props: GroupItemViewProps) {
|
|
|
74
74
|
|
|
75
75
|
// Render collapsible group item
|
|
76
76
|
// If group item is a repeating instance, do not render group item as collapsible
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const isDefaultOpen =
|
|
77
|
+
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
78
|
+
if (groupCollapsibleValue && !isRepeated) {
|
|
79
|
+
const isDefaultOpen = groupCollapsibleValue === 'default-open';
|
|
80
80
|
return (
|
|
81
81
|
<GroupAccordion
|
|
82
82
|
disableGutters
|
|
@@ -103,9 +103,9 @@ function RepeatGroupView(props: RepeatGroupViewProps) {
|
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
const isDefaultOpen =
|
|
106
|
+
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
107
|
+
if (groupCollapsibleValue) {
|
|
108
|
+
const isDefaultOpen = groupCollapsibleValue === 'default-open';
|
|
109
109
|
return (
|
|
110
110
|
<GroupAccordion
|
|
111
111
|
disableGutters
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { styled } from '@mui/material/styles';
|
|
19
|
+
import { AccordionSummary } from '@mui/material';
|
|
20
|
+
import Accordion from '@mui/material/Accordion';
|
|
21
|
+
import Box from '@mui/material/Box';
|
|
22
|
+
|
|
23
|
+
export const NestedSingleItemAccordionWrapper = styled(Box, {
|
|
24
|
+
shouldForwardProp: (prop) => prop !== 'isRepeated'
|
|
25
|
+
})<{ isRepeated: boolean }>(({ isRepeated }) => ({
|
|
26
|
+
marginBottom: isRepeated ? 0 : '28px'
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
export const NestedSingleItemAccordion = styled(Accordion, {
|
|
30
|
+
shouldForwardProp: (prop) => prop !== 'elevation'
|
|
31
|
+
})<{ elevation: number }>(({ elevation }) => ({
|
|
32
|
+
paddingTop: '8px',
|
|
33
|
+
paddingBottom: '4px',
|
|
34
|
+
paddingLeft: elevation === 1 ? '10px' : '8px',
|
|
35
|
+
paddingRight: elevation === 1 ? '10px' : '8px'
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
export const NestedSingleItemAccordionSummary = styled(AccordionSummary)(() => ({
|
|
39
|
+
minHeight: '28px',
|
|
40
|
+
'.MuiAccordionSummary-expandIconWrapper': {
|
|
41
|
+
'&:hover:not(.Mui-disabled)': {
|
|
42
|
+
cursor: 'pointer'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
'.MuiAccordionSummary-content': {
|
|
46
|
+
marginBottom: 0
|
|
47
|
+
},
|
|
48
|
+
'&.Mui-focusVisible': {
|
|
49
|
+
backgroundColor: 'transparent'
|
|
50
|
+
},
|
|
51
|
+
'&:hover:not(.Mui-disabled)': {
|
|
52
|
+
cursor: 'default'
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
@@ -26,13 +26,10 @@ import type {
|
|
|
26
26
|
PropsWithShowMinimalViewAttribute
|
|
27
27
|
} from '../../../interfaces/renderProps.interface';
|
|
28
28
|
import { useQuestionnaireStore } from '../../../stores';
|
|
29
|
-
import SingleItemSwitcher from './SingleItemSwitcher';
|
|
30
29
|
import useHidden from '../../../hooks/useHidden';
|
|
31
30
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
32
|
-
import SingleNestedItems from './SingleNestedItems';
|
|
33
|
-
import { GroupCard } from '../GroupItem/GroupItem.styles';
|
|
34
|
-
import { QGroupContainerBox } from '../../Box.styles';
|
|
35
31
|
import { shouldRenderNestedItems } from '../../../utils/itemControl';
|
|
32
|
+
import SingleItemView from './SingleItemView';
|
|
36
33
|
|
|
37
34
|
interface SingleItemProps
|
|
38
35
|
extends PropsWithQrItemChangeHandler,
|
|
@@ -100,61 +97,28 @@ function SingleItem(props: SingleItemProps) {
|
|
|
100
97
|
[qrItem, onQrItemChange]
|
|
101
98
|
);
|
|
102
99
|
|
|
103
|
-
const
|
|
100
|
+
const itemHasNestedItems = useMemo(
|
|
104
101
|
() => !!qItem.item && qItem.item.length > 0 && shouldRenderNestedItems(qItem),
|
|
105
102
|
[qItem]
|
|
106
103
|
);
|
|
107
104
|
|
|
108
105
|
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
109
106
|
const itemIsHidden = useHidden(qItem, parentRepeatGroupIndex);
|
|
110
|
-
if (itemIsHidden) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (qItemHasNestedItems) {
|
|
115
|
-
return (
|
|
116
|
-
<QGroupContainerBox
|
|
117
|
-
cardElevation={groupCardElevation}
|
|
118
|
-
isRepeated={isRepeated}
|
|
119
|
-
data-test="q-item-group-box">
|
|
120
|
-
<GroupCard elevation={groupCardElevation} isRepeated={isRepeated}>
|
|
121
|
-
<SingleItemSwitcher
|
|
122
|
-
qItem={qItem}
|
|
123
|
-
qrItem={qrItem}
|
|
124
|
-
isRepeated={isRepeated}
|
|
125
|
-
isTabled={isTabled}
|
|
126
|
-
showMinimalView={showMinimalView}
|
|
127
|
-
parentIsReadOnly={readOnly}
|
|
128
|
-
onQrItemChange={handleQrItemChange}
|
|
129
|
-
/>
|
|
130
|
-
{qItemHasNestedItems ? (
|
|
131
|
-
<>
|
|
132
|
-
<SingleNestedItems
|
|
133
|
-
qItem={qItem}
|
|
134
|
-
qrItem={qrItem}
|
|
135
|
-
groupCardElevation={groupCardElevation}
|
|
136
|
-
parentIsReadOnly={readOnly}
|
|
137
|
-
onQrItemChange={handleQrItemChangeWithNestedItems}
|
|
138
|
-
/>
|
|
139
|
-
</>
|
|
140
|
-
) : null}
|
|
141
|
-
</GroupCard>
|
|
142
|
-
</QGroupContainerBox>
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
107
|
|
|
146
108
|
return (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
109
|
+
<SingleItemView
|
|
110
|
+
qItem={qItem}
|
|
111
|
+
qrItem={qrItem}
|
|
112
|
+
itemIsHidden={itemIsHidden}
|
|
113
|
+
itemHasNestedItems={itemHasNestedItems}
|
|
114
|
+
isRepeated={isRepeated}
|
|
115
|
+
isTabled={isTabled}
|
|
116
|
+
groupCardElevation={groupCardElevation}
|
|
117
|
+
showMinimalView={showMinimalView}
|
|
118
|
+
parentIsReadOnly={readOnly}
|
|
119
|
+
onQrItemChange={handleQrItemChange}
|
|
120
|
+
onQrItemChangeWithNestedItems={handleQrItemChangeWithNestedItems}
|
|
121
|
+
/>
|
|
158
122
|
);
|
|
159
123
|
}
|
|
160
124
|
|
|
@@ -0,0 +1,169 @@
|
|
|
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 React from 'react';
|
|
19
|
+
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
20
|
+
import type {
|
|
21
|
+
PropsWithIsRepeatedAttribute,
|
|
22
|
+
PropsWithIsTabledAttribute,
|
|
23
|
+
PropsWithParentIsReadOnlyAttribute,
|
|
24
|
+
PropsWithQrItemChangeHandler,
|
|
25
|
+
PropsWithShowMinimalViewAttribute
|
|
26
|
+
} from '../../../interfaces/renderProps.interface';
|
|
27
|
+
import SingleItemSwitcher from './SingleItemSwitcher';
|
|
28
|
+
import SingleNestedItems from './SingleNestedItems';
|
|
29
|
+
import { GroupCard } from '../GroupItem/GroupItem.styles';
|
|
30
|
+
import { QGroupContainerBox } from '../../Box.styles';
|
|
31
|
+
import { getGroupCollapsible } from '../../../utils/qItem';
|
|
32
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
33
|
+
import AccordionDetails from '@mui/material/AccordionDetails';
|
|
34
|
+
import StopPropagationWrapper from './StopPropagationWrapper';
|
|
35
|
+
import {
|
|
36
|
+
NestedSingleItemAccordion,
|
|
37
|
+
NestedSingleItemAccordionSummary,
|
|
38
|
+
NestedSingleItemAccordionWrapper
|
|
39
|
+
} from './NestedSingleItemAccordion.styles';
|
|
40
|
+
import useReadOnly from '../../../hooks/useReadOnly';
|
|
41
|
+
import Box from '@mui/material/Box';
|
|
42
|
+
|
|
43
|
+
interface SingleItemViewProps
|
|
44
|
+
extends PropsWithQrItemChangeHandler,
|
|
45
|
+
PropsWithIsRepeatedAttribute,
|
|
46
|
+
PropsWithIsTabledAttribute,
|
|
47
|
+
PropsWithShowMinimalViewAttribute,
|
|
48
|
+
PropsWithParentIsReadOnlyAttribute {
|
|
49
|
+
qItem: QuestionnaireItem;
|
|
50
|
+
qrItem: QuestionnaireResponseItem | null;
|
|
51
|
+
itemIsHidden: boolean;
|
|
52
|
+
itemHasNestedItems: boolean;
|
|
53
|
+
groupCardElevation: number;
|
|
54
|
+
onQrItemChangeWithNestedItems: (newQrItem: QuestionnaireResponseItem) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function SingleItemView(props: SingleItemViewProps) {
|
|
58
|
+
const {
|
|
59
|
+
qItem,
|
|
60
|
+
qrItem,
|
|
61
|
+
itemIsHidden,
|
|
62
|
+
itemHasNestedItems,
|
|
63
|
+
isRepeated,
|
|
64
|
+
isTabled,
|
|
65
|
+
groupCardElevation,
|
|
66
|
+
showMinimalView,
|
|
67
|
+
parentIsReadOnly,
|
|
68
|
+
onQrItemChange,
|
|
69
|
+
onQrItemChangeWithNestedItems
|
|
70
|
+
} = props;
|
|
71
|
+
|
|
72
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
73
|
+
const groupCollapsibleValue = getGroupCollapsible(qItem);
|
|
74
|
+
|
|
75
|
+
// Item hidden, do not render
|
|
76
|
+
if (itemIsHidden) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Item has nested items and is collapsible
|
|
81
|
+
if (itemHasNestedItems && groupCollapsibleValue) {
|
|
82
|
+
const isDefaultOpen = groupCollapsibleValue === 'default-open';
|
|
83
|
+
return (
|
|
84
|
+
<NestedSingleItemAccordionWrapper isRepeated={isRepeated}>
|
|
85
|
+
<NestedSingleItemAccordion
|
|
86
|
+
disableGutters
|
|
87
|
+
defaultExpanded={isDefaultOpen}
|
|
88
|
+
elevation={groupCardElevation}
|
|
89
|
+
slotProps={{
|
|
90
|
+
transition: { unmountOnExit: true, timeout: 250 }
|
|
91
|
+
}}>
|
|
92
|
+
<NestedSingleItemAccordionSummary expandIcon={<ExpandMoreIcon />}>
|
|
93
|
+
<Box width="100%">
|
|
94
|
+
<StopPropagationWrapper>
|
|
95
|
+
<SingleItemSwitcher
|
|
96
|
+
qItem={qItem}
|
|
97
|
+
qrItem={qrItem}
|
|
98
|
+
isRepeated={isRepeated}
|
|
99
|
+
isTabled={isTabled}
|
|
100
|
+
showMinimalView={showMinimalView}
|
|
101
|
+
parentIsReadOnly={readOnly}
|
|
102
|
+
onQrItemChange={onQrItemChange}
|
|
103
|
+
/>
|
|
104
|
+
</StopPropagationWrapper>
|
|
105
|
+
</Box>
|
|
106
|
+
</NestedSingleItemAccordionSummary>
|
|
107
|
+
|
|
108
|
+
<AccordionDetails sx={{ pt: 0 }}>
|
|
109
|
+
{/* This box with marginRight:"24px" below is to align the parent item with the nested child items (due to space taken by the expand button */}
|
|
110
|
+
<Box mr={3}>
|
|
111
|
+
<SingleNestedItems
|
|
112
|
+
qItem={qItem}
|
|
113
|
+
qrItem={qrItem}
|
|
114
|
+
groupCardElevation={groupCardElevation}
|
|
115
|
+
parentIsReadOnly={readOnly}
|
|
116
|
+
onQrItemChange={onQrItemChangeWithNestedItems}
|
|
117
|
+
/>
|
|
118
|
+
</Box>
|
|
119
|
+
</AccordionDetails>
|
|
120
|
+
</NestedSingleItemAccordion>
|
|
121
|
+
</NestedSingleItemAccordionWrapper>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Item has nested items but is not collapsible
|
|
126
|
+
if (itemHasNestedItems) {
|
|
127
|
+
return (
|
|
128
|
+
<QGroupContainerBox
|
|
129
|
+
cardElevation={groupCardElevation}
|
|
130
|
+
isRepeated={isRepeated}
|
|
131
|
+
data-test="q-item-group-box">
|
|
132
|
+
<GroupCard elevation={groupCardElevation} isRepeated={isRepeated}>
|
|
133
|
+
<SingleItemSwitcher
|
|
134
|
+
qItem={qItem}
|
|
135
|
+
qrItem={qrItem}
|
|
136
|
+
isRepeated={isRepeated}
|
|
137
|
+
isTabled={isTabled}
|
|
138
|
+
showMinimalView={showMinimalView}
|
|
139
|
+
parentIsReadOnly={readOnly}
|
|
140
|
+
onQrItemChange={onQrItemChange}
|
|
141
|
+
/>
|
|
142
|
+
<SingleNestedItems
|
|
143
|
+
qItem={qItem}
|
|
144
|
+
qrItem={qrItem}
|
|
145
|
+
groupCardElevation={groupCardElevation}
|
|
146
|
+
parentIsReadOnly={readOnly}
|
|
147
|
+
onQrItemChange={onQrItemChangeWithNestedItems}
|
|
148
|
+
/>
|
|
149
|
+
</GroupCard>
|
|
150
|
+
</QGroupContainerBox>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<>
|
|
156
|
+
<SingleItemSwitcher
|
|
157
|
+
qItem={qItem}
|
|
158
|
+
qrItem={qrItem}
|
|
159
|
+
isRepeated={isRepeated}
|
|
160
|
+
isTabled={isTabled}
|
|
161
|
+
showMinimalView={showMinimalView}
|
|
162
|
+
parentIsReadOnly={readOnly}
|
|
163
|
+
onQrItemChange={onQrItemChange}
|
|
164
|
+
/>
|
|
165
|
+
</>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export default SingleItemView;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { ReactNode } from 'react';
|
|
19
|
+
import React from 'react';
|
|
20
|
+
|
|
21
|
+
interface StopPropagationWrapperProps {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function StopPropagationWrapper(props: StopPropagationWrapperProps) {
|
|
26
|
+
const { children } = props;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
onClick={(event) => {
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
}}>
|
|
33
|
+
{children}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default StopPropagationWrapper;
|
|
@@ -293,16 +293,257 @@ export const qSliderStepValue: Questionnaire = {
|
|
|
293
293
|
]
|
|
294
294
|
};
|
|
295
295
|
|
|
296
|
-
export const
|
|
296
|
+
export const qCollapsibleSingleDefaultOpen: Questionnaire = {
|
|
297
297
|
resourceType: 'Questionnaire',
|
|
298
|
-
id: '
|
|
299
|
-
name: '
|
|
300
|
-
title: '
|
|
298
|
+
id: 'CollapsibleSingleDefaultOpen',
|
|
299
|
+
name: 'CollapsibleSingleDefaultOpen',
|
|
300
|
+
title: 'Collapsible Single - Default Open',
|
|
301
301
|
version: '0.1.0',
|
|
302
302
|
status: 'draft',
|
|
303
303
|
publisher: 'AEHRC CSIRO',
|
|
304
304
|
date: '2024-05-08',
|
|
305
|
-
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-1',
|
|
305
|
+
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-single-1',
|
|
306
|
+
contained: [
|
|
307
|
+
{
|
|
308
|
+
resourceType: 'ValueSet',
|
|
309
|
+
id: 'YesNoNA',
|
|
310
|
+
url: 'https://smartforms.csiro.au/ig/ValueSet/YesNoNA',
|
|
311
|
+
name: 'YesNoNA',
|
|
312
|
+
title: 'Yes/No/NA',
|
|
313
|
+
status: 'draft',
|
|
314
|
+
experimental: false,
|
|
315
|
+
description: 'Concepts for Yes, No and Not applicable',
|
|
316
|
+
compose: {
|
|
317
|
+
include: [
|
|
318
|
+
{
|
|
319
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
320
|
+
concept: [
|
|
321
|
+
{
|
|
322
|
+
code: 'Y',
|
|
323
|
+
display: 'Yes'
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
code: 'N',
|
|
327
|
+
display: 'No'
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
code: 'NA',
|
|
331
|
+
display: 'N/A'
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
},
|
|
337
|
+
expansion: {
|
|
338
|
+
identifier: 'urn:uuid:5baa5444-e553-4412-a08c-9ce93d3271e0',
|
|
339
|
+
timestamp: '2023-09-01T11:16:50+10:00',
|
|
340
|
+
total: 3,
|
|
341
|
+
parameter: [
|
|
342
|
+
{
|
|
343
|
+
name: 'version',
|
|
344
|
+
valueUri: 'http://terminology.hl7.org/CodeSystem/v2-0532|2.1.0'
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: 'used-codesystem',
|
|
348
|
+
valueUri: 'http://terminology.hl7.org/CodeSystem/v2-0532|2.1.0'
|
|
349
|
+
}
|
|
350
|
+
],
|
|
351
|
+
contains: [
|
|
352
|
+
{
|
|
353
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
354
|
+
code: 'Y',
|
|
355
|
+
display: 'Yes'
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
359
|
+
code: 'N',
|
|
360
|
+
display: 'No'
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
364
|
+
code: 'NA',
|
|
365
|
+
display: 'N/A'
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
],
|
|
371
|
+
item: [
|
|
372
|
+
{
|
|
373
|
+
extension: [
|
|
374
|
+
{
|
|
375
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
376
|
+
valueCodeableConcept: {
|
|
377
|
+
coding: [
|
|
378
|
+
{
|
|
379
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
380
|
+
code: 'radio-button'
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation',
|
|
387
|
+
valueCode: 'horizontal'
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-collapsible',
|
|
391
|
+
valueCode: 'default-open'
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
linkId: 'working-collapsible',
|
|
395
|
+
text: 'Are you working?',
|
|
396
|
+
type: 'choice',
|
|
397
|
+
repeats: false,
|
|
398
|
+
answerValueSet: '#YesNoNA',
|
|
399
|
+
item: [
|
|
400
|
+
{
|
|
401
|
+
extension: [
|
|
402
|
+
{
|
|
403
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-shortText',
|
|
404
|
+
valueString: 'Details'
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
linkId: 'details-working',
|
|
408
|
+
text: 'Details (occupation including occupational hazards, study, training, disability, etc)',
|
|
409
|
+
type: 'text',
|
|
410
|
+
repeats: false
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
};
|
|
416
|
+
export const qCollapsibleSingleDefaultClosed: Questionnaire = {
|
|
417
|
+
resourceType: 'Questionnaire',
|
|
418
|
+
id: 'CollapsibleSingleDefaultClosed',
|
|
419
|
+
name: 'CollapsibleSingleDefaultClosed',
|
|
420
|
+
title: 'Collapsible Single - Default Closed',
|
|
421
|
+
version: '0.1.0',
|
|
422
|
+
status: 'draft',
|
|
423
|
+
publisher: 'AEHRC CSIRO',
|
|
424
|
+
date: '2024-05-08',
|
|
425
|
+
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-single-2',
|
|
426
|
+
contained: [
|
|
427
|
+
{
|
|
428
|
+
resourceType: 'ValueSet',
|
|
429
|
+
id: 'YesNoNA',
|
|
430
|
+
url: 'https://smartforms.csiro.au/ig/ValueSet/YesNoNA',
|
|
431
|
+
name: 'YesNoNA',
|
|
432
|
+
title: 'Yes/No/NA',
|
|
433
|
+
status: 'draft',
|
|
434
|
+
experimental: false,
|
|
435
|
+
description: 'Concepts for Yes, No and Not applicable',
|
|
436
|
+
compose: {
|
|
437
|
+
include: [
|
|
438
|
+
{
|
|
439
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
440
|
+
concept: [
|
|
441
|
+
{
|
|
442
|
+
code: 'Y',
|
|
443
|
+
display: 'Yes'
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
code: 'N',
|
|
447
|
+
display: 'No'
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
code: 'NA',
|
|
451
|
+
display: 'N/A'
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
},
|
|
457
|
+
expansion: {
|
|
458
|
+
identifier: 'urn:uuid:5baa5444-e553-4412-a08c-9ce93d3271e0',
|
|
459
|
+
timestamp: '2023-09-01T11:16:50+10:00',
|
|
460
|
+
total: 3,
|
|
461
|
+
parameter: [
|
|
462
|
+
{
|
|
463
|
+
name: 'version',
|
|
464
|
+
valueUri: 'http://terminology.hl7.org/CodeSystem/v2-0532|2.1.0'
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: 'used-codesystem',
|
|
468
|
+
valueUri: 'http://terminology.hl7.org/CodeSystem/v2-0532|2.1.0'
|
|
469
|
+
}
|
|
470
|
+
],
|
|
471
|
+
contains: [
|
|
472
|
+
{
|
|
473
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
474
|
+
code: 'Y',
|
|
475
|
+
display: 'Yes'
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
479
|
+
code: 'N',
|
|
480
|
+
display: 'No'
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
484
|
+
code: 'NA',
|
|
485
|
+
display: 'N/A'
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
],
|
|
491
|
+
item: [
|
|
492
|
+
{
|
|
493
|
+
extension: [
|
|
494
|
+
{
|
|
495
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
496
|
+
valueCodeableConcept: {
|
|
497
|
+
coding: [
|
|
498
|
+
{
|
|
499
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
500
|
+
code: 'radio-button'
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation',
|
|
507
|
+
valueCode: 'horizontal'
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-collapsible',
|
|
511
|
+
valueCode: 'default-closed'
|
|
512
|
+
}
|
|
513
|
+
],
|
|
514
|
+
linkId: 'working-collapsible',
|
|
515
|
+
text: 'Are you working?',
|
|
516
|
+
type: 'choice',
|
|
517
|
+
repeats: false,
|
|
518
|
+
answerValueSet: '#YesNoNA',
|
|
519
|
+
item: [
|
|
520
|
+
{
|
|
521
|
+
extension: [
|
|
522
|
+
{
|
|
523
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-shortText',
|
|
524
|
+
valueString: 'Details'
|
|
525
|
+
}
|
|
526
|
+
],
|
|
527
|
+
linkId: 'details-working',
|
|
528
|
+
text: 'Details (occupation including occupational hazards, study, training, disability, etc)',
|
|
529
|
+
type: 'text',
|
|
530
|
+
repeats: false
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
]
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
export const qCollapsibleGroupDefaultOpen: Questionnaire = {
|
|
538
|
+
resourceType: 'Questionnaire',
|
|
539
|
+
id: 'CollapsibleGroupDefaultOpen',
|
|
540
|
+
name: 'CollapsibleGroupDefaultOpen',
|
|
541
|
+
title: 'Collapsible Group - Default Open',
|
|
542
|
+
version: '0.1.0',
|
|
543
|
+
status: 'draft',
|
|
544
|
+
publisher: 'AEHRC CSIRO',
|
|
545
|
+
date: '2024-05-08',
|
|
546
|
+
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-group-1',
|
|
306
547
|
item: [
|
|
307
548
|
{
|
|
308
549
|
extension: [
|
|
@@ -396,16 +637,16 @@ export const qCollapsibleDefaultOpen: Questionnaire = {
|
|
|
396
637
|
]
|
|
397
638
|
};
|
|
398
639
|
|
|
399
|
-
export const
|
|
640
|
+
export const qCollapsibleGroupDefaultClosed: Questionnaire = {
|
|
400
641
|
resourceType: 'Questionnaire',
|
|
401
|
-
id: '
|
|
402
|
-
name: '
|
|
403
|
-
title: '
|
|
642
|
+
id: 'CollapsibleGroupDefaultClosed',
|
|
643
|
+
name: 'CollapsibleGroupDefaultClosed',
|
|
644
|
+
title: 'Collapsible Group - Default Closed',
|
|
404
645
|
version: '0.1.0',
|
|
405
646
|
status: 'draft',
|
|
406
647
|
publisher: 'AEHRC CSIRO',
|
|
407
648
|
date: '2024-05-08',
|
|
408
|
-
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-2',
|
|
649
|
+
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-group-2',
|
|
409
650
|
item: [
|
|
410
651
|
{
|
|
411
652
|
extension: [
|
|
@@ -499,16 +740,16 @@ export const qCollapsibleDefaultClosed: Questionnaire = {
|
|
|
499
740
|
]
|
|
500
741
|
};
|
|
501
742
|
|
|
502
|
-
export const
|
|
743
|
+
export const qCollapsibleGroupNested: Questionnaire = {
|
|
503
744
|
resourceType: 'Questionnaire',
|
|
504
|
-
id: '
|
|
505
|
-
name: '
|
|
506
|
-
title: '
|
|
745
|
+
id: 'CollapsibleGroupNested',
|
|
746
|
+
name: 'CollapsibleGroupNested',
|
|
747
|
+
title: 'Collapsible Group - Nested',
|
|
507
748
|
version: '0.1.0',
|
|
508
749
|
status: 'draft',
|
|
509
750
|
publisher: 'AEHRC CSIRO',
|
|
510
751
|
date: '2024-05-08',
|
|
511
|
-
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-3',
|
|
752
|
+
url: 'https://smartforms.csiro.au/docs/advanced/control/collapsible-group-3',
|
|
512
753
|
item: [
|
|
513
754
|
{
|
|
514
755
|
extension: [
|
|
@@ -19,9 +19,11 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
19
19
|
import BuildFormWrapperForStorybook from '../storybookWrappers/BuildFormWrapperForStorybook';
|
|
20
20
|
import {
|
|
21
21
|
qChoiceOrientation,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
qCollapsibleGroupDefaultClosed,
|
|
23
|
+
qCollapsibleGroupDefaultOpen,
|
|
24
|
+
qCollapsibleGroupNested,
|
|
25
|
+
qCollapsibleSingleDefaultClosed,
|
|
26
|
+
qCollapsibleSingleDefaultOpen,
|
|
25
27
|
qItemControl,
|
|
26
28
|
qSliderStepValue
|
|
27
29
|
} from '../assets/questionnaires';
|
|
@@ -57,20 +59,32 @@ export const SliderStepValue: Story = {
|
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
|
|
60
|
-
export const
|
|
62
|
+
export const CollapsibleSingleDefaultOpen: Story = {
|
|
61
63
|
args: {
|
|
62
|
-
questionnaire:
|
|
64
|
+
questionnaire: qCollapsibleSingleDefaultOpen
|
|
63
65
|
}
|
|
64
66
|
};
|
|
65
67
|
|
|
66
|
-
export const
|
|
68
|
+
export const CollapsibleSingleDefaultClosed: Story = {
|
|
67
69
|
args: {
|
|
68
|
-
questionnaire:
|
|
70
|
+
questionnaire: qCollapsibleSingleDefaultClosed
|
|
69
71
|
}
|
|
70
72
|
};
|
|
71
73
|
|
|
72
|
-
export const
|
|
74
|
+
export const CollapsibleGroupDefaultOpen: Story = {
|
|
73
75
|
args: {
|
|
74
|
-
questionnaire:
|
|
76
|
+
questionnaire: qCollapsibleGroupDefaultOpen
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const CollapsibleGroupDefaultClosed: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
questionnaire: qCollapsibleGroupDefaultClosed
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const CollapsibleGroupNested: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
questionnaire: qCollapsibleGroupNested
|
|
75
89
|
}
|
|
76
90
|
};
|