@aehrc/smart-forms-renderer 0.44.2 → 0.44.3

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.
Files changed (73) hide show
  1. package/lib/components/FormComponents/CustomComponent.d.ts +9 -0
  2. package/lib/components/FormComponents/CustomComponent.js +31 -0
  3. package/lib/components/FormComponents/CustomComponent.js.map +1 -0
  4. package/lib/components/FormComponents/CustomComponentWrapper.d.ts +1 -0
  5. package/lib/components/FormComponents/CustomComponentWrapper.js +40 -0
  6. package/lib/components/FormComponents/CustomComponentWrapper.js.map +1 -0
  7. package/lib/components/FormComponents/DecimalItem/index.d.ts +1 -0
  8. package/lib/components/FormComponents/DecimalItem/index.js +18 -0
  9. package/lib/components/FormComponents/DecimalItem/index.js.map +1 -0
  10. package/lib/components/FormComponents/GroupItem/Collapsible.d.ts +3 -0
  11. package/lib/components/FormComponents/GroupItem/Collapsible.js +6 -0
  12. package/lib/components/FormComponents/GroupItem/Collapsible.js.map +1 -0
  13. package/lib/components/FormComponents/GroupItem/GroupAccordion.d.ts +0 -0
  14. package/lib/components/FormComponents/GroupItem/GroupAccordion.js +2 -0
  15. package/lib/components/FormComponents/GroupItem/GroupAccordion.js.map +1 -0
  16. package/lib/components/FormComponents/ItemParts/FlyoverItem.d.ts +6 -0
  17. package/lib/components/FormComponents/ItemParts/FlyoverItem.js +45 -0
  18. package/lib/components/FormComponents/ItemParts/FlyoverItem.js.map +1 -0
  19. package/lib/components/FormComponents/ItemParts/index.d.ts +1 -0
  20. package/lib/components/FormComponents/ItemParts/index.js +18 -0
  21. package/lib/components/FormComponents/ItemParts/index.js.map +1 -0
  22. package/lib/components/FormComponents/StringItem/index.d.ts +1 -0
  23. package/lib/components/FormComponents/StringItem/index.js +18 -0
  24. package/lib/components/FormComponents/StringItem/index.js.map +1 -0
  25. package/lib/components/Pages/SingleItemPaginated.d.ts +19 -0
  26. package/lib/components/Pages/SingleItemPaginated.js +7 -0
  27. package/lib/components/Pages/SingleItemPaginated.js.map +1 -0
  28. package/lib/components/Renderer/FormBodyPaginated.d.ts +9 -0
  29. package/lib/components/Renderer/FormBodyPaginated.js +49 -0
  30. package/lib/components/Renderer/FormBodyPaginated.js.map +1 -0
  31. package/lib/components/Renderer/PageItem.d.ts +9 -0
  32. package/lib/components/Renderer/PageItem.js +68 -0
  33. package/lib/components/Renderer/PageItem.js.map +1 -0
  34. package/lib/hooks/useInitialiseGroupTable.d.ts +4 -0
  35. package/lib/hooks/useInitialiseGroupTable.js +36 -0
  36. package/lib/hooks/useInitialiseGroupTable.js.map +1 -0
  37. package/lib/hooks/useNumberInput.d.ts +3 -0
  38. package/lib/hooks/useNumberInput.js +31 -0
  39. package/lib/hooks/useNumberInput.js.map +1 -0
  40. package/lib/hooks/useRepeatGroups.d.ts +4 -0
  41. package/lib/hooks/useRepeatGroups.js +34 -0
  42. package/lib/hooks/useRepeatGroups.js.map +1 -0
  43. package/lib/hooks/useStringInput.d.ts +3 -0
  44. package/lib/hooks/useStringInput.js +32 -0
  45. package/lib/hooks/useStringInput.js.map +1 -0
  46. package/lib/interfaces/customComponent.d.ts +9 -0
  47. package/lib/interfaces/customComponent.interface.d.ts +9 -0
  48. package/lib/interfaces/customComponent.interface.js +18 -0
  49. package/lib/interfaces/customComponent.interface.js.map +1 -0
  50. package/lib/interfaces/customComponent.js +18 -0
  51. package/lib/interfaces/customComponent.js.map +1 -0
  52. package/lib/interfaces/customOverrideComponent.interface.d.ts +9 -0
  53. package/lib/interfaces/customOverrideComponent.interface.js +18 -0
  54. package/lib/interfaces/customOverrideComponent.interface.js.map +1 -0
  55. package/lib/interfaces/overrideComponent.interface.d.ts +12 -0
  56. package/lib/interfaces/overrideComponent.interface.js +18 -0
  57. package/lib/interfaces/overrideComponent.interface.js.map +1 -0
  58. package/lib/interfaces/qItemOverrideComponent.interface.d.ts +9 -0
  59. package/lib/interfaces/qItemOverrideComponent.interface.js +18 -0
  60. package/lib/interfaces/qItemOverrideComponent.interface.js.map +1 -0
  61. package/lib/stores/rendererStylingStore.d.ts +31 -0
  62. package/lib/stores/rendererStylingStore.js +40 -0
  63. package/lib/stores/rendererStylingStore.js.map +1 -0
  64. package/lib/stores/stylingStore.d.ts +23 -0
  65. package/lib/stores/stylingStore.js +27 -0
  66. package/lib/stores/stylingStore.js.map +1 -0
  67. package/lib/stories/storybookWrappers/iframeResizerChild.d.ts +1 -0
  68. package/lib/stories/storybookWrappers/iframeResizerChild.js +849 -0
  69. package/lib/stories/storybookWrappers/iframeResizerChild.js.map +1 -0
  70. package/lib/utils/customComponent.d.ts +9 -0
  71. package/lib/utils/customComponent.js +18 -0
  72. package/lib/utils/customComponent.js.map +1 -0
  73. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
3
+ import { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
+ interface CustomComponentProps extends PropsWithQrItemChangeHandler {
5
+ qItem: QuestionnaireItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
+ }
8
+ declare function CustomComponent(props: CustomComponentProps): React.JSX.Element;
9
+ export default CustomComponent;
@@ -0,0 +1,31 @@
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 { useQuestionnaireStore } from '../../stores';
19
+ import { FullWidthFormComponentBox } from '../Box.styles';
20
+ import ItemFieldGrid from './ItemParts/ItemFieldGrid';
21
+ import BooleanField from './BooleanItem/BooleanField';
22
+ function CustomComponent(props) {
23
+ const { qItem, qrItem, onQrItemChange } = props;
24
+ const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
25
+ r;
26
+ return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-boolean-box", "data-linkid": qItem.linkId, onClick: () => onFocusLinkId(qItem.linkId) },
27
+ React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
28
+ React.createElement(BooleanField, { qItem: qItem, readOnly: readOnly, valueBoolean: valueBoolean, calcExpUpdated: calcExpUpdated, onCheckedChange: handleValueChange, onClear: handleClear }))));
29
+ }
30
+ export default CustomComponent;
31
+ //# sourceMappingURL=CustomComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomComponent.js","sourceRoot":"","sources":["../../../src/components/FormComponents/CustomComponent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAOtD,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEhD,MAAM,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAEhE,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,yBAAyB,iBACd,oBAAoB,iBACjB,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7C,oBAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,iBAAiB,EAClC,OAAO,EAAE,WAAW,GACpB,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,40 @@
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
+ // function CustomComponentWrapper(props: CustomComponentWrapperProps) {
19
+ // const { qItem, qrItem, onQrItemChange } = props;
20
+ //
21
+ // const onFocusLinkId = useQuestionnaireStore.use.onFocusLinkId();
22
+ //
23
+ // if (includeItemFieldGrid) {
24
+ // return (
25
+ // <FullWidthFormComponentBox
26
+ // data-test="q-item-boolean-box"
27
+ // data-linkid={qItem.linkId}
28
+ // onClick={() => onFocusLinkId(qItem.linkId)}>
29
+ // <ItemFieldGrid qItem={qItem} readOnly={false}>
30
+ // {children}
31
+ // </ItemFieldGrid>
32
+ // </FullWidthFormComponentBox>
33
+ // );
34
+ // }
35
+ //
36
+ // return <>{children}</>;
37
+ // }
38
+ //
39
+ // export default CustomComponentWrapper;
40
+ //# sourceMappingURL=CustomComponentWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomComponentWrapper.js","sourceRoot":"","sources":["../../../src/components/FormComponents/CustomComponentWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;AAUH,wEAAwE;AACxE,qDAAqD;AACrD,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,gCAAgC;AAChC,eAAe;AACf,mCAAmC;AACnC,yCAAyC;AACzC,qCAAqC;AACrC,uDAAuD;AACvD,yDAAyD;AACzD,uBAAuB;AACvB,2BAA2B;AAC3B,qCAAqC;AACrC,SAAS;AACT,MAAM;AACN,EAAE;AACF,4BAA4B;AAC5B,IAAI;AACJ,EAAE;AACF,yCAAyC"}
@@ -0,0 +1 @@
1
+ export { default as DecimalField } from './DecimalField';
@@ -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 { default as DecimalField } from './DecimalField';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/DecimalItem/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare function Collapsible(props: any): React.JSX.Element;
3
+ export default Collapsible;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ function Collapsible(props) {
3
+ return React.createElement("div", null);
4
+ }
5
+ export default Collapsible;
6
+ //# sourceMappingURL=Collapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collapsible.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/Collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,SAAS,WAAW,CAAC,KAAK;IACxB,OAAO,gCAAW,CAAC;AACrB,CAAC;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=GroupAccordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupAccordion.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/GroupItem/GroupAccordion.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface FlyoverItemProps {
3
+ displayFlyover: string;
4
+ }
5
+ declare function FlyoverItem(props: FlyoverItemProps): React.JSX.Element;
6
+ export default FlyoverItem;
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import React from 'react';
18
+ import Tooltip from '@mui/material/Tooltip';
19
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
20
+ import { useQuestionnaireStore } from '../../../stores';
21
+ function FlyoverItem(props) {
22
+ const { displayFlyover } = props;
23
+ const sdcUiOverrideComponents = useQuestionnaireStore.use.sdcUiOverrideComponents();
24
+ const FlyoverOverrideComponent = sdcUiOverrideComponents['flyover'];
25
+ // If a flyover override component is defined for this item, render it
26
+ if (FlyoverOverrideComponent && typeof FlyoverOverrideComponent === 'function') {
27
+ return React.createElement(FlyoverOverrideComponent, { displayText: displayFlyover });
28
+ }
29
+ return (React.createElement(Tooltip, { title: displayFlyover, placement: "top", slotProps: {
30
+ popper: {
31
+ modifiers: [
32
+ {
33
+ name: 'offset',
34
+ options: {
35
+ offset: [0, -8]
36
+ }
37
+ }
38
+ ]
39
+ }
40
+ } },
41
+ React.createElement("span", null,
42
+ React.createElement(InfoOutlinedIcon, { sx: { color: 'text.secondary' }, fontSize: "small" }))));
43
+ }
44
+ export default FlyoverItem;
45
+ //# sourceMappingURL=FlyoverItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlyoverItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/FlyoverItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAMxD,SAAS,WAAW,CAAC,KAAuB;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAEjC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC;IACpF,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAEpE,sEAAsE;IACtE,IAAI,wBAAwB,IAAI,OAAO,wBAAwB,KAAK,UAAU,EAAE;QAC9E,OAAO,oBAAC,wBAAwB,IAAC,WAAW,EAAE,cAAc,GAAI,CAAC;KAClE;IAED,OAAO,CACL,oBAAC,OAAO,IACN,KAAK,EAAE,cAAc,EACrB,SAAS,EAAC,KAAK,EACf,SAAS,EAAE;YACT,MAAM,EAAE;gBACN,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE;4BACP,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;yBAChB;qBACF;iBACF;aACF;SACF;QACD;YACE,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,QAAQ,EAAC,OAAO,GAAG,CACjE,CACC,CACX,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as ItemFieldGrid } from './ItemFieldGrid';
@@ -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 { default as ItemFieldGrid } from './ItemFieldGrid';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as StringField } from './StringField';
@@ -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 { default as StringField } from './StringField';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/StringItem/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithParentIsRepeatGroupAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
3
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
+ import type { Tabs } from '../../interfaces';
5
+ import type { Pages } from '../../interfaces/page.interface';
6
+ interface SingleItemPaginatedProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithParentIsRepeatGroupAttribute {
7
+ qItem: QuestionnaireItem;
8
+ qrItem: QuestionnaireResponseItem | null;
9
+ groupCardElevation: number;
10
+ disableCardView?: boolean;
11
+ tabIsMarkedAsComplete?: boolean;
12
+ tabs?: Tabs;
13
+ currentTabIndex?: number;
14
+ pageIsMarkedAsComplete?: boolean;
15
+ pages?: Pages;
16
+ currentPageIndex?: number;
17
+ }
18
+ declare function SingleItemPaginated(props: SingleItemPaginatedProps): React.JSX.Element;
19
+ export default SingleItemPaginated;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ function SingleItemPaginated(props) {
3
+ const { qItem, qrItem, isRepeated, groupCardElevation, disableCardView, tabIsMarkedAsComplete, tabs, currentTabIndex, pageIsMarkedAsComplete, pages, currentPageIndex, parentIsReadOnly, parentIsRepeatGroup, parentRepeatGroupIndex, onQrItemChange } = props;
4
+ return React.createElement("div", null);
5
+ }
6
+ export default SingleItemPaginated;
7
+ //# sourceMappingURL=SingleItemPaginated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleItemPaginated.js","sourceRoot":"","sources":["../../../src/components/Pages/SingleItemPaginated.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,SAAS,mBAAmB,CAAC,KAA+B;IAC1D,MAAM,EACJ,KAAK,EACL,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,IAAI,EACJ,eAAe,EACf,sBAAsB,EACtB,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,OAAO,gCAAW,CAAC;AACrB,CAAC;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
+ import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
4
+ interface FormBodyPaginatedProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
5
+ topLevelQItems: QuestionnaireItem[];
6
+ topLevelQRItems: (QuestionnaireResponseItem | QuestionnaireResponseItem[] | undefined)[];
7
+ }
8
+ declare function FormBodyPaginated(props: FormBodyPaginatedProps): React.JSX.Element;
9
+ export default FormBodyPaginated;
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import Grid from '@mui/material/Grid';
3
+ import TabContext from '@mui/lab/TabContext';
4
+ import TabPanel from '@mui/lab/TabPanel';
5
+ import GroupItem from '../FormComponents/GroupItem/GroupItem';
6
+ import { useQuestionnaireStore } from '../../stores';
7
+ import { useRendererStylingStore } from '../../stores/rendererStylingStore';
8
+ import { SingleItem } from '../FormComponents';
9
+ import PageButtonsWrapper from '../FormComponents/GroupItem/PageButtonWrapper';
10
+ import { QGroupContainerBox } from '../Box.styles';
11
+ import { GroupCard } from '../FormComponents/GroupItem/GroupItem.styles';
12
+ // TODO This implementation doesnt take into account repeat items and repeat groups
13
+ // TODO need to fix this before bringing it into release
14
+ // Every group item in here is rendered as a page
15
+ function FormBodyPaginated(props) {
16
+ const { topLevelQItems, topLevelQRItems, parentIsReadOnly, onQrItemChange } = props;
17
+ const pages = useQuestionnaireStore.use.pages();
18
+ const currentPage = useQuestionnaireStore.use.currentPageIndex();
19
+ const disableCardView = useRendererStylingStore.use.disablePageCardView();
20
+ return (React.createElement(Grid, { container: true, spacing: 1.5 },
21
+ React.createElement(TabContext, { value: currentPage.toString() },
22
+ React.createElement(Grid, { item: true, xs: 12, md: 12, lg: 12 }, topLevelQItems.map((qItem, i) => {
23
+ var _a, _b;
24
+ const qrItem = topLevelQRItems[i];
25
+ const isNotRepeatGroup = !Array.isArray(qrItem);
26
+ const isPage = !!pages[qItem.linkId];
27
+ const itemIsGroup = qItem.type === 'group';
28
+ if (!isPage || !isNotRepeatGroup) {
29
+ // Something has gone horribly wrong
30
+ return null;
31
+ }
32
+ const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
33
+ const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
34
+ // Render this page as a group
35
+ if (itemIsGroup) {
36
+ return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
37
+ React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, disableCardView: disableCardView, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
38
+ }
39
+ // Page consists of a non-group item
40
+ return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
41
+ React.createElement(QGroupContainerBox, { cardElevation: 1, isRepeated: isRepeated, "data-test": "q-item-group-box" }, disableCardView ? (React.createElement(React.Fragment, null,
42
+ React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
43
+ React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))) : (React.createElement(GroupCard, { elevation: 1, isRepeated: isRepeated },
44
+ React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
45
+ React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))))));
46
+ })))));
47
+ }
48
+ export default FormBodyPaginated;
49
+ //# sourceMappingURL=FormBodyPaginated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormBodyPaginated.js","sourceRoot":"","sources":["../../../src/components/Renderer/FormBodyPaginated.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAK9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,kBAAkB,MAAM,+CAA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C,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,CAClE,CACJ,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,IAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU;wBAC7C,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,KAAK,GACf;wBACF,oBAAC,kBAAkB,IAAC,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,CACzD,CACb,CACkB,CACZ,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
+ import type { PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../interfaces/renderProps.interface';
4
+ interface PageItemProps extends PropsWithQrItemChangeHandler, PropsWithParentIsReadOnlyAttribute {
5
+ qItem: QuestionnaireItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
+ }
8
+ declare function PageItem(props: PageItemProps): React.JSX.Element | null;
9
+ export default PageItem;
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ import Grid from '@mui/material/Grid';
3
+ import TabContext from '@mui/lab/TabContext';
4
+ import TabPanel from '@mui/lab/TabPanel';
5
+ import GroupItem from '../FormComponents/GroupItem/GroupItem';
6
+ import { SingleItem } from '../FormComponents';
7
+ import PageButtonsWrapper from '../FormComponents/GroupItem/PageButtonWrapper';
8
+ import { QGroupContainerBox } from '../Box.styles';
9
+ import { GroupCard } from '../FormComponents/GroupItem/GroupItem.styles';
10
+ import { isRepeatItemAndNotCheckbox } from '../../utils';
11
+ import { useQuestionnaireStore } from '../../stores';
12
+ import { useRendererStylingStore } from '../../stores/rendererStylingStore';
13
+ // Every group item in here is rendered as a page
14
+ function PageItem(props) {
15
+ var _a, _b;
16
+ const { qItem, qrItem, parentIsReadOnly, onQrItemChange } = props;
17
+ const pages = useQuestionnaireStore.use.pages();
18
+ const currentPage = useQuestionnaireStore.use.currentPageIndex();
19
+ const disableCardView = useRendererStylingStore.use.disablePageCardView();
20
+ const itemIsGroup = qItem.type === 'group';
21
+ const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
22
+ const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
23
+ if (!isPage || !isNotRepeatGroup) {
24
+ // Something has gone horribly wrong
25
+ return null;
26
+ }
27
+ if (itemIsGroup) {
28
+ return (React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, disableCardView: disableCardView, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange }));
29
+ }
30
+ const itemRepeatsAndIsNotCheckbox = isRepeatItemAndNotCheckbox(qItem);
31
+ if (itemRepeatsAndIsNotCheckbox) {
32
+ return (React.createElement(QGroupContainerBox, { cardElevation: 1, isRepeated: isRepeated, "data-test": "q-item-group-box" }, disableCardView ? (React.createElement(React.Fragment, null,
33
+ React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
34
+ React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))) : (React.createElement(GroupCard, { elevation: 1, isRepeated: isRepeated },
35
+ React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
36
+ React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages })))));
37
+ }
38
+ return (React.createElement(Grid, { container: true, spacing: 1.5 },
39
+ React.createElement(TabContext, { value: currentPage.toString() },
40
+ React.createElement(Grid, { item: true, xs: 12, md: 12, lg: 12 }, topLevelQItems.map((qItem, i) => {
41
+ var _a, _b;
42
+ const qrItem = topLevelQRItems[i];
43
+ const isNotRepeatGroup = !Array.isArray(qrItem);
44
+ const isPage = !!pages[qItem.linkId];
45
+ const itemIsGroup = qItem.type === 'group';
46
+ if (!isPage || !isNotRepeatGroup) {
47
+ // Something has gone horribly wrong
48
+ return null;
49
+ }
50
+ const isRepeated = (_a = qItem.repeats) !== null && _a !== void 0 ? _a : false;
51
+ const pageIsMarkedAsComplete = (_b = pages[qItem.linkId].isComplete) !== null && _b !== void 0 ? _b : false;
52
+ // Render this page as a group
53
+ if (itemIsGroup) {
54
+ return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
55
+ React.createElement(GroupItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, disableCardView: disableCardView, pageIsMarkedAsComplete: pageIsMarkedAsComplete, pages: pages, currentPageIndex: currentPage, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange })));
56
+ }
57
+ // Page consists of a non-group item
58
+ const itemRepeatsAndIsNotCheckbox = isRepeatItemAndNotCheckbox(qItem);
59
+ return (React.createElement(TabPanel, { key: qItem.linkId, sx: { p: 0 }, value: i.toString(), "data-test": "renderer-page-panel" },
60
+ React.createElement(QGroupContainerBox, { cardElevation: 1, isRepeated: isRepeated, "data-test": "q-item-group-box" }, disableCardView ? (React.createElement(React.Fragment, null,
61
+ React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
62
+ React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))) : (React.createElement(GroupCard, { elevation: 1, isRepeated: isRepeated },
63
+ React.createElement(SingleItem, { qItem: qItem, qrItem: qrItem !== null && qrItem !== void 0 ? qrItem : null, isRepeated: isRepeated, groupCardElevation: 1, parentIsReadOnly: parentIsReadOnly, onQrItemChange: onQrItemChange, isTabled: false }),
64
+ React.createElement(PageButtonsWrapper, { currentPageIndex: currentPage, pages: pages }))))));
65
+ })))));
66
+ }
67
+ export default PageItem;
68
+ //# sourceMappingURL=PageItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageItem.js","sourceRoot":"","sources":["../../../src/components/Renderer/PageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAK9D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,kBAAkB,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAO5E,iDAAiD;AACjD,SAAS,QAAQ,CAAC,KAAoB;;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM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C,CACjB;wBACE,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,KAAK,GACf;wBACF,oBAAC,kBAAkB,IAAC,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,CAClE,CACJ,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,IAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU;wBAC7C,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EACtB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,CAAC,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,KAAK,GACf;wBACF,oBAAC,kBAAkB,IAAC,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,CACzD,CACb,CACkB,CACZ,CACZ,CAAC;YACJ,CAAC,CAAC,CACG,CACI,CACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { QuestionnaireResponseItem } from 'fhir/r4';
2
+ import type { GroupTableRowModel } from '../interfaces/groupTable.interface';
3
+ declare function useInitialiseGroupTable(qrItems: QuestionnaireResponseItem[]): GroupTableRowModel[];
4
+ export default useInitialiseGroupTable;
@@ -0,0 +1,36 @@
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 { nanoid } from 'nanoid';
18
+ function useInitialiseGroupTable(qrItems) {
19
+ let initialGroupTableRows = [
20
+ {
21
+ nanoId: nanoid(),
22
+ qrItem: null
23
+ }
24
+ ];
25
+ if (qrItems.length > 0) {
26
+ initialGroupTableRows = qrItems.map((qrItem) => {
27
+ return {
28
+ nanoId: nanoid(),
29
+ qrItem
30
+ };
31
+ });
32
+ }
33
+ return initialGroupTableRows;
34
+ }
35
+ export default useInitialiseGroupTable;
36
+ //# sourceMappingURL=useInitialiseGroupTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInitialiseGroupTable.js","sourceRoot":"","sources":["../../src/hooks/useInitialiseGroupTable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,SAAS,uBAAuB,CAAC,OAAoC;IACnE,IAAI,qBAAqB,GAAyB;QAChD;YACE,MAAM,EAAE,MAAM,EAAE;YAChB,MAAM,EAAE,IAAI;SACb;KACF,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7C,OAAO;gBACL,MAAM,EAAE,MAAM,EAAE;gBAChB,MAAM;aACP,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Dispatch, SetStateAction } from 'react';
2
+ declare function useNumberInput(valueFromProps: number): [number, Dispatch<SetStateAction<number>>];
3
+ export default useNumberInput;
@@ -0,0 +1,31 @@
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 { useEffect, useState } from 'react';
18
+ function useNumberInput(valueFromProps) {
19
+ const [value, setValue] = useState(valueFromProps);
20
+ useEffect(() => {
21
+ if (value !== valueFromProps) {
22
+ setValue(valueFromProps);
23
+ }
24
+ },
25
+ // Only trigger this effect if prop value changes
26
+ // eslint-disable-next-line react-hooks/exhaustive-deps
27
+ [valueFromProps]);
28
+ return [value, setValue];
29
+ }
30
+ export default useNumberInput;
31
+ //# sourceMappingURL=useNumberInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNumberInput.js","sourceRoot":"","sources":["../../src/hooks/useNumberInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,SAAS,cAAc,CAAC,cAAsB;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEnD,SAAS,CACP,GAAG,EAAE;QACH,IAAI,KAAK,KAAK,cAAc,EAAE;YAC5B,QAAQ,CAAC,cAAc,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Dispatch, SetStateAction } from 'react';
2
+ import type { RepeatGroupSingle } from '../interfaces/repeatGroup.interface';
3
+ declare function useRepeatGroups(valueFromProps: RepeatGroupSingle[]): [RepeatGroupSingle[], Dispatch<SetStateAction<RepeatGroupSingle[]>>];
4
+ export default useRepeatGroups;
@@ -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 { useEffect, useState } from 'react';
18
+ import _isEqual from 'lodash/isEqual';
19
+ function useRepeatGroups(valueFromProps) {
20
+ const [repeatGroups, setRepeatGroups] = useState(valueFromProps);
21
+ useEffect(() => {
22
+ const valueFromPropsQRItems = valueFromProps.map((repeatGroupSingle) => repeatGroupSingle.qrItem);
23
+ const repeatGroupsQRItems = repeatGroups.map((repeatGroupSingle) => repeatGroupSingle.qrItem);
24
+ if (!_isEqual(valueFromPropsQRItems, repeatGroupsQRItems)) {
25
+ setRepeatGroups(valueFromProps);
26
+ }
27
+ },
28
+ // Only trigger this effect if prop value changes
29
+ // eslint-disable-next-line react-hooks/exhaustive-deps
30
+ [valueFromProps]);
31
+ return [repeatGroups, setRepeatGroups];
32
+ }
33
+ export default useRepeatGroups;
34
+ //# sourceMappingURL=useRepeatGroups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRepeatGroups.js","sourceRoot":"","sources":["../../src/hooks/useRepeatGroups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,SAAS,eAAe,CACtB,cAAmC;IAEnC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEjE,SAAS,CACP,GAAG,EAAE;QACH,MAAM,qBAAqB,GAAG,cAAc,CAAC,GAAG,CAC9C,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAChD,CAAC;QACF,MAAM,mBAAmB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAE9F,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,EAAE;YACzD,eAAe,CAAC,cAAc,CAAC,CAAC;SACjC;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;AACzC,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Dispatch, SetStateAction } from 'react';
2
+ declare function useStringInput(valueFromProps: string): [string, Dispatch<SetStateAction<string>>];
3
+ export default useStringInput;