@aehrc/smart-forms-renderer 0.13.2 → 0.14.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.
Files changed (109) hide show
  1. package/lib/components/FormComponents/AttachmentItem/AttachmentField.d.ts +13 -0
  2. package/lib/components/FormComponents/AttachmentItem/AttachmentField.js +39 -0
  3. package/lib/components/FormComponents/AttachmentItem/AttachmentField.js.map +1 -0
  4. package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.d.ts +14 -0
  5. package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js +34 -0
  6. package/lib/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.js.map +1 -0
  7. package/lib/components/FormComponents/AttachmentItem/AttachmentFileCollector.d.ts +8 -0
  8. package/lib/components/FormComponents/AttachmentItem/AttachmentFileCollector.js +61 -0
  9. package/lib/components/FormComponents/AttachmentItem/AttachmentFileCollector.js.map +1 -0
  10. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.d.ts +11 -0
  11. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.js +49 -0
  12. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.js.map +1 -0
  13. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.d.ts +7 -0
  14. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.js +30 -0
  15. package/lib/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.js.map +1 -0
  16. package/lib/components/FormComponents/AttachmentItem/AttachmentItem.d.ts +14 -0
  17. package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js +86 -0
  18. package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js.map +1 -0
  19. package/lib/components/FormComponents/AttachmentItem/AttachmentUrlField.d.ts +10 -0
  20. package/lib/components/FormComponents/AttachmentItem/AttachmentUrlField.js +39 -0
  21. package/lib/components/FormComponents/AttachmentItem/AttachmentUrlField.js.map +1 -0
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.d.ts +1 -1
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.js +2 -2
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.js.map +1 -1
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +2 -1
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +6 -3
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -1
  28. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +3 -3
  29. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  30. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +2 -1
  31. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +6 -3
  32. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
  33. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +3 -3
  34. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
  35. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +2 -1
  36. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -1
  37. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +2 -1
  38. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +8 -5
  39. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -1
  40. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +3 -3
  41. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
  42. package/lib/components/FormComponents/DateItem/DateField.js +2 -1
  43. package/lib/components/FormComponents/DateItem/DateField.js.map +1 -1
  44. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js +2 -1
  45. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js.map +1 -1
  46. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +2 -2
  47. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -1
  48. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +2 -2
  49. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -1
  50. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +2 -1
  51. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +7 -4
  52. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -1
  53. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +3 -3
  54. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
  55. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +28 -16
  56. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  57. package/lib/components/FormComponents/SliderItem/SliderField.js +2 -1
  58. package/lib/components/FormComponents/SliderItem/SliderField.js.map +1 -1
  59. package/lib/components/FormComponents/Textfield.styles.d.ts +1 -0
  60. package/lib/components/FormComponents/Textfield.styles.js +2 -1
  61. package/lib/components/FormComponents/Textfield.styles.js.map +1 -1
  62. package/lib/components/FormComponents/TimeItem/TimeField.js +2 -1
  63. package/lib/components/FormComponents/TimeItem/TimeField.js.map +1 -1
  64. package/lib/hooks/UseFileDrop.d.ts +10 -0
  65. package/lib/hooks/UseFileDrop.js +40 -0
  66. package/lib/hooks/UseFileDrop.js.map +1 -0
  67. package/lib/hooks/useAttachmentUrlValidation.d.ts +2 -0
  68. package/lib/hooks/useAttachmentUrlValidation.js +27 -0
  69. package/lib/hooks/useAttachmentUrlValidation.js.map +1 -0
  70. package/lib/hooks/useValueSetCodings.d.ts +5 -1
  71. package/lib/hooks/useValueSetCodings.js +1 -1
  72. package/lib/hooks/useValueSetCodings.js.map +1 -1
  73. package/lib/utils/fileUtils.d.ts +3 -0
  74. package/lib/utils/fileUtils.js +64 -0
  75. package/lib/utils/fileUtils.js.map +1 -0
  76. package/lib/utils/validateQuestionnaire.d.ts +3 -5
  77. package/lib/utils/validateQuestionnaire.js +8 -5
  78. package/lib/utils/validateQuestionnaire.js.map +1 -1
  79. package/package.json +3 -1
  80. package/src/components/FormComponents/AttachmentItem/AttachmentField.tsx +96 -0
  81. package/src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx +87 -0
  82. package/src/components/FormComponents/AttachmentItem/AttachmentFileCollector.tsx +101 -0
  83. package/src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.ts +31 -0
  84. package/src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.tsx +66 -0
  85. package/src/components/FormComponents/AttachmentItem/AttachmentItem.tsx +123 -0
  86. package/src/components/FormComponents/AttachmentItem/AttachmentUrlField.tsx +78 -0
  87. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.tsx +3 -3
  88. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +6 -4
  89. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +3 -3
  90. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +7 -4
  91. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +3 -3
  92. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +2 -1
  93. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +9 -6
  94. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +3 -3
  95. package/src/components/FormComponents/DateItem/DateField.tsx +2 -1
  96. package/src/components/FormComponents/DateTimeItem/DateTimeField.tsx +2 -1
  97. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +2 -2
  98. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +2 -2
  99. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +9 -6
  100. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +3 -3
  101. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +67 -31
  102. package/src/components/FormComponents/SliderItem/SliderField.tsx +2 -1
  103. package/src/components/FormComponents/Textfield.styles.ts +3 -1
  104. package/src/components/FormComponents/TimeItem/TimeField.tsx +2 -1
  105. package/src/hooks/UseFileDrop.ts +53 -0
  106. package/src/hooks/useAttachmentUrlValidation.ts +27 -0
  107. package/src/hooks/useValueSetCodings.ts +10 -2
  108. package/src/utils/fileUtils.ts +66 -0
  109. package/src/utils/validateQuestionnaire.ts +17 -13
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
3
+ import type { AttachmentValues } from './AttachmentItem';
4
+ interface AttachmentFieldProps extends PropsWithIsTabledAttribute {
5
+ linkId: string;
6
+ attachmentValues: AttachmentValues;
7
+ readOnly: boolean;
8
+ onUploadFile: (file: File | null) => void;
9
+ onUrlChange: (url: string) => void;
10
+ onFileNameChange: (fileName: string) => void;
11
+ }
12
+ declare function AttachmentField(props: AttachmentFieldProps): React.JSX.Element;
13
+ export default AttachmentField;
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright 2023 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 { StandardTextField } from '../Textfield.styles';
19
+ import AttachmentFileCollector from './AttachmentFileCollector';
20
+ import Typography from '@mui/material/Typography';
21
+ import Box from '@mui/material/Box';
22
+ import Stack from '@mui/material/Stack';
23
+ import AttachmentUrlField from './AttachmentUrlField';
24
+ function AttachmentField(props) {
25
+ const { linkId, attachmentValues, readOnly, isTabled, onUploadFile, onUrlChange, onFileNameChange } = props;
26
+ const { uploadedFile, url, fileName } = attachmentValues;
27
+ return (React.createElement(React.Fragment, null,
28
+ React.createElement(Stack, { rowGap: 1 },
29
+ React.createElement(Typography, { variant: "subtitle2" }, "An attachment must either have a file or a URL, or both."),
30
+ React.createElement(Box, null,
31
+ React.createElement(AttachmentFileCollector, { uploadedFile: uploadedFile, isTabled: isTabled, onUploadFile: onUploadFile })),
32
+ React.createElement(AttachmentUrlField, { linkId: linkId, url: url, readOnly: readOnly, isTabled: isTabled, onUrlChange: onUrlChange }),
33
+ React.createElement(Box, null,
34
+ React.createElement(Typography, { variant: "body2" }, "File name (optional)"),
35
+ React.createElement(StandardTextField, { fullWidth: true, isTabled: isTabled, id: linkId, value: fileName, onChange: (event) => onFileNameChange(event.target.value), disabled: readOnly, size: "small", "data-test": "q-item-attachment-field" })),
36
+ uploadedFile && url ? (React.createElement(Typography, { variant: "subtitle2" }, "Ensure that the attached file and URL has the same content.")) : null)));
37
+ }
38
+ export default AttachmentField;
39
+ //# sourceMappingURL=AttachmentField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentField.js","sourceRoot":"","sources":["../../../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K,CAAC,MAAM,CAAC,KAAK,CAAC,EACzD,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,eACF,yBAAyB,GACnC,CACE;YAEL,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,CACrB,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,kEAElB,CACd,CAAC,CAAC,CAAC,IAAI,CACF,CACP,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
3
+ import type { QuestionnaireItem } from 'fhir/r4';
4
+ import type { AttachmentValues } from './AttachmentItem';
5
+ interface AttachmentFieldWrapperProps extends PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
6
+ qItem: QuestionnaireItem;
7
+ attachmentValues: AttachmentValues;
8
+ readOnly: boolean;
9
+ onUploadFile: (file: File | null) => void;
10
+ onUrlChange: (url: string) => void;
11
+ onFileNameChange: (fileName: string) => void;
12
+ }
13
+ declare function AttachmentFieldWrapper(props: AttachmentFieldWrapperProps): React.JSX.Element;
14
+ export default AttachmentFieldWrapper;
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright 2023 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 { HTML5Backend } from 'react-dnd-html5-backend';
18
+ //
19
+ // <DndProvider backend={HTML5Backend}>
20
+ import React from 'react';
21
+ import AttachmentField from './AttachmentField';
22
+ import { FullWidthFormComponentBox } from '../../Box.styles';
23
+ import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
24
+ function AttachmentFieldWrapper(props) {
25
+ const { qItem, attachmentValues, readOnly, isRepeated, isTabled, onUploadFile, onUrlChange, onFileNameChange } = props;
26
+ if (isRepeated) {
27
+ return (React.createElement(AttachmentField, { linkId: qItem.linkId, attachmentValues: attachmentValues, readOnly: readOnly, isTabled: isTabled, onUploadFile: onUploadFile, onUrlChange: onUrlChange, onFileNameChange: onFileNameChange }));
28
+ }
29
+ return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-attachment-box" },
30
+ React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
31
+ React.createElement(AttachmentField, { linkId: qItem.linkId, attachmentValues: attachmentValues, readOnly: readOnly, isTabled: isTabled, onUploadFile: onUploadFile, onUrlChange: onUrlChange, onFileNameChange: onFileNameChange }))));
32
+ }
33
+ export default AttachmentFieldWrapper;
34
+ //# sourceMappingURL=AttachmentFieldWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentFieldWrapper.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentFieldWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0DAA0D;AAC1D,EAAE;AACF,uCAAuC;AAEvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAmBvD,SAAS,sBAAsB,CAAC,KAAkC;IAChE,MAAM,EACJ,KAAK,EACL,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,gBAAgB,EACjB,GAAG,KAAK,CAAC;IAEV,IAAI,UAAU,EAAE;QACd,OAAO,CACL,oBAAC,eAAe,IACd,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBAAW,uBAAuB;QAC1D,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7C,oBAAC,eAAe,IACd,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,GAClC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
3
+ interface AttachmentFileCollectorProps extends PropsWithIsTabledAttribute {
4
+ uploadedFile: File | null;
5
+ onUploadFile: (file: File | null) => void;
6
+ }
7
+ declare const AttachmentFileCollector: React.NamedExoticComponent<AttachmentFileCollectorProps>;
8
+ export default AttachmentFileCollector;
@@ -0,0 +1,61 @@
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, { memo, useCallback } from 'react';
18
+ import { Box, IconButton, Stack, Tooltip } from '@mui/material';
19
+ import { useSnackbar } from 'notistack';
20
+ import AttachmentFileDropBox from './AttachmentFileDropBox';
21
+ import Iconify from '../../Iconify/Iconify';
22
+ const AttachmentFileCollector = memo(function AttachmentFileCollector(props) {
23
+ const { uploadedFile, isTabled, onUploadFile } = props;
24
+ const { enqueueSnackbar } = useSnackbar();
25
+ const handleFileDrop = useCallback((item) => {
26
+ if (item) {
27
+ const files = item.files;
28
+ if (files.length > 1) {
29
+ enqueueSnackbar('Only one file allowed', {
30
+ variant: 'warning',
31
+ preventDuplicate: true
32
+ });
33
+ }
34
+ if (files[0] instanceof File) {
35
+ const file = files[0];
36
+ onUploadFile(file);
37
+ }
38
+ }
39
+ }, [onUploadFile, enqueueSnackbar]);
40
+ function handleAttachFile(event) {
41
+ var _a;
42
+ const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
43
+ if (file instanceof File) {
44
+ onUploadFile(file);
45
+ }
46
+ }
47
+ return (React.createElement(React.Fragment, null,
48
+ React.createElement(AttachmentFileDropBox, { onDrop: handleFileDrop, file: uploadedFile, errorMessage: '', isTabled: isTabled }),
49
+ React.createElement(Stack, { direction: "row", justifyContent: "space-between", pt: 0.5 },
50
+ React.createElement(Box, null,
51
+ React.createElement(Tooltip, { title: "Attach file" },
52
+ React.createElement(IconButton, { component: "label", size: "small" },
53
+ React.createElement(Iconify, { icon: "fluent:attach-24-regular" }),
54
+ React.createElement("input", { type: "file", hidden: true, onChange: handleAttachFile }))),
55
+ React.createElement(Tooltip, { title: "Remove file" },
56
+ React.createElement("span", null,
57
+ React.createElement(IconButton, { disabled: !uploadedFile, color: "error", size: "small", onClick: () => onUploadFile(null) },
58
+ React.createElement(Iconify, { icon: "ant-design:delete" }))))))));
59
+ });
60
+ export default AttachmentFileCollector;
61
+ //# sourceMappingURL=AttachmentFileCollector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentFileCollector.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentFileCollector.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,uBAAuB,GAAG,IAAI,CAAC,SAAS,uBAAuB,CACnE,KAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAEvD,MAAM,EAAE,eAAe,EAAE,GAAG,WAAW,EAAE,CAAC;IAE1C,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,IAAsB,EAAE,EAAE;QACzB,IAAI,IAAI,EAAE;YACR,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAEzB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBACpB,eAAe,CAAC,uBAAuB,EAAE;oBACvC,OAAO,EAAE,SAAS;oBAClB,gBAAgB,EAAE,IAAI;iBACvB,CAAC,CAAC;aACJ;YAED,IAAI,KAAK,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE;gBAC5B,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBAEtB,YAAY,CAAC,IAAI,CAAC,CAAC;aACpB;SACF;IACH,CAAC,EACD,CAAC,YAAY,EAAE,eAAe,CAAC,CAChC,CAAC;IAEF,SAAS,gBAAgB,CAAC,KAAoC;;QAC5D,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,MAAM,CAAC,KAAK,0CAAG,CAAC,CAAC,CAAC;QAErC,IAAI,IAAI,YAAY,IAAI,EAAE;YACxB,YAAY,CAAC,IAAI,CAAC,CAAC;SACpB;IACH,CAAC;IAED,OAAO,CACL;QACE,oBAAC,qBAAqB,IACpB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,EAAE,EAChB,QAAQ,EAAE,QAAQ,GAClB;QACF,oBAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,cAAc,EAAC,eAAe,EAAC,EAAE,EAAE,GAAG;YAC3D,oBAAC,GAAG;gBACF,oBAAC,OAAO,IAAC,KAAK,EAAC,aAAa;oBAC1B,oBAAC,UAAU,IAAC,SAAS,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO;wBACxC,oBAAC,OAAO,IAAC,IAAI,EAAC,0BAA0B,GAAG;wBAC3C,+BAAO,IAAI,EAAC,MAAM,EAAC,MAAM,QAAC,QAAQ,EAAE,gBAAgB,GAAI,CAC7C,CACL;gBACV,oBAAC,OAAO,IAAC,KAAK,EAAC,aAAa;oBAC1B;wBACE,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,YAAY,EACvB,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;4BACjC,oBAAC,OAAO,IAAC,IAAI,EAAC,mBAAmB,GAAG,CACzB,CACR,CACC,CACN,CACA,CACP,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
3
+ export interface AttachmentFileDropBoxProps extends PropsWithIsTabledAttribute {
4
+ file: File | null;
5
+ onDrop: (item: {
6
+ files: any[];
7
+ }) => void;
8
+ errorMessage: string;
9
+ }
10
+ declare function AttachmentFileDropBox(props: AttachmentFileDropBoxProps): React.JSX.Element;
11
+ export default AttachmentFileDropBox;
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright 2023 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 { Box, Typography } from '@mui/material';
18
+ import useFileDrop from '../../../hooks/UseFileDrop';
19
+ import { AttachmentFileDropBoxWrapper } from './AttachmentFileDropBox.styles';
20
+ import React from 'react';
21
+ import { getFileSize } from '../../../utils/fileUtils';
22
+ function AttachmentFileDropBox(props) {
23
+ var _a;
24
+ const { file, onDrop, errorMessage, isTabled } = props;
25
+ const { canDrop, isOver, dropTarget } = useFileDrop(onDrop);
26
+ const isActive = canDrop && isOver;
27
+ let boxMessage = 'No file selected';
28
+ if (isActive) {
29
+ boxMessage = 'Release to drop file';
30
+ }
31
+ else if (errorMessage) {
32
+ boxMessage = errorMessage;
33
+ }
34
+ else if (file) {
35
+ boxMessage = file.name;
36
+ }
37
+ return (React.createElement(AttachmentFileDropBoxWrapper, { ref: dropTarget, display: "flex", isActive: isActive, isTabled: isTabled },
38
+ React.createElement(Box, { p: 1.5 },
39
+ React.createElement(Typography, null, boxMessage),
40
+ file ? (React.createElement(Box, { pt: 1 },
41
+ React.createElement(Typography, { fontSize: 10 },
42
+ "Size: ",
43
+ getFileSize((_a = file.size.toString()) !== null && _a !== void 0 ? _a : '0')),
44
+ React.createElement(Typography, { fontSize: 10 },
45
+ "Type: ",
46
+ file.type))) : null)));
47
+ }
48
+ export default AttachmentFileDropBox;
49
+ //# sourceMappingURL=AttachmentFileDropBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentFileDropBox.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAQvD,SAAS,qBAAqB,CAAC,KAAiC;;IAC9D,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEvD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAE5D,MAAM,QAAQ,GAAG,OAAO,IAAI,MAAM,CAAC;IAEnC,IAAI,UAAU,GAAG,kBAAkB,CAAC;IACpC,IAAI,QAAQ,EAAE;QACZ,UAAU,GAAG,sBAAsB,CAAC;KACrC;SAAM,IAAI,YAAY,EAAE;QACvB,UAAU,GAAG,YAAY,CAAC;KAC3B;SAAM,IAAI,IAAI,EAAE;QACf,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC;KACxB;IAED,OAAO,CACL,oBAAC,4BAA4B,IAC3B,GAAG,EAAE,UAAU,EACf,OAAO,EAAC,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ;QAClB,oBAAC,GAAG,IAAC,CAAC,EAAE,GAAG;YACT,oBAAC,UAAU,QAAE,UAAU,CAAc;YACpC,IAAI,CAAC,CAAC,CAAC,CACN,oBAAC,GAAG,IAAC,EAAE,EAAE,CAAC;gBACR,oBAAC,UAAU,IAAC,QAAQ,EAAE,EAAE;;oBAAS,WAAW,CAAC,MAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,mCAAI,GAAG,CAAC,CAAc;gBACvF,oBAAC,UAAU,IAAC,QAAQ,EAAE,EAAE;;oBAAS,IAAI,CAAC,IAAI,CAAc,CACpD,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACuB,CAChC,CAAC;AACJ,CAAC;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const AttachmentFileDropBoxWrapper: 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
+ isActive: boolean;
6
+ isTabled: boolean;
7
+ }, {}, {}>;
@@ -0,0 +1,30 @@
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 { Box } from '@mui/material';
19
+ import { TEXT_FIELD_WIDTH } from '../Textfield.styles';
20
+ export const AttachmentFileDropBoxWrapper = styled(Box, {
21
+ shouldForwardProp: (prop) => prop !== 'isActive' && prop !== 'isTabled'
22
+ })(({ theme, isActive, isTabled }) => ({
23
+ backgroundColor: theme.palette.background.paper,
24
+ border: '2px dashed',
25
+ borderColor: isActive ? theme.palette.secondary.main : theme.palette.primary.main,
26
+ borderRadius: '4px',
27
+ maxWidth: !isTabled ? TEXT_FIELD_WIDTH : 3000,
28
+ minWidth: 160
29
+ }));
30
+ //# sourceMappingURL=AttachmentFileDropBox.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentFileDropBox.styles.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentFileDropBox.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,EAAE;IACtD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU;CACxE,CAAC,CAA2C,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/E,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK;IAC/C,MAAM,EAAE,YAAY;IACpB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI;IACjF,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI;IAC7C,QAAQ,EAAE,GAAG;CACd,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
3
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
+ export interface AttachmentValues {
5
+ uploadedFile: File | null;
6
+ url: string;
7
+ fileName: string;
8
+ }
9
+ interface AttachmentItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
10
+ qItem: QuestionnaireItem;
11
+ qrItem: QuestionnaireResponseItem | null;
12
+ }
13
+ declare function AttachmentItem(props: AttachmentItemProps): React.JSX.Element;
14
+ export default AttachmentItem;
@@ -0,0 +1,86 @@
1
+ /*
2
+ * Copyright 2023 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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ import React, { useCallback, useState } from 'react';
27
+ import debounce from 'lodash.debounce';
28
+ import { createEmptyQrItem } from '../../../utils/qrItem';
29
+ import { DEBOUNCE_DURATION } from '../../../utils/debounce';
30
+ import useStringInput from '../../../hooks/useStringInput';
31
+ import useReadOnly from '../../../hooks/useReadOnly';
32
+ import AttachmentFieldWrapper from './AttachmentFieldWrapper';
33
+ import { HTML5Backend } from 'react-dnd-html5-backend';
34
+ import { DndProvider } from 'react-dnd';
35
+ import { createAttachmentAnswer } from '../../../utils/fileUtils';
36
+ function AttachmentItem(props) {
37
+ const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
38
+ const readOnly = useReadOnly(qItem, parentIsReadOnly);
39
+ // Init input value
40
+ let valueString = '';
41
+ if ((qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer) && (qrItem === null || qrItem === void 0 ? void 0 : qrItem.answer[0].valueString)) {
42
+ valueString = qrItem.answer[0].valueString;
43
+ }
44
+ const [uploadedFile, setUploadedFile] = useState(null);
45
+ const [url, setUrl] = useStringInput(valueString);
46
+ const [fileName, setFileName] = useStringInput(valueString);
47
+ // Event handlers
48
+ function handleUploadFile(newUploadedFile) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ setUploadedFile(newUploadedFile);
51
+ const attachment = yield createAttachmentAnswer(newUploadedFile, url, fileName);
52
+ if (attachment) {
53
+ onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueAttachment: attachment }] }));
54
+ }
55
+ else {
56
+ onQrItemChange(createEmptyQrItem(qItem));
57
+ }
58
+ });
59
+ }
60
+ function handleUrlChange(newUrl) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ setUrl(newUrl);
63
+ yield updateQrItemWithDebounce(uploadedFile, newUrl, fileName);
64
+ });
65
+ }
66
+ function handleFileNameChange(newFileName) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ setFileName(newFileName);
69
+ yield updateQrItemWithDebounce(uploadedFile, url, newFileName);
70
+ });
71
+ }
72
+ // eslint-disable-next-line react-hooks/exhaustive-deps
73
+ const updateQrItemWithDebounce = useCallback(debounce((file, url, fileName) => __awaiter(this, void 0, void 0, function* () {
74
+ const attachment = yield createAttachmentAnswer(file, url, fileName);
75
+ if (attachment) {
76
+ onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueAttachment: attachment }] }));
77
+ }
78
+ else {
79
+ onQrItemChange(createEmptyQrItem(qItem));
80
+ }
81
+ }), DEBOUNCE_DURATION), [onQrItemChange, qItem]); // Dependencies are tested, debounce is causing eslint to not recognise dependencies
82
+ return (React.createElement(DndProvider, { backend: HTML5Backend, context: window },
83
+ React.createElement(AttachmentFieldWrapper, { qItem: qItem, attachmentValues: { uploadedFile: uploadedFile, url: url, fileName: fileName }, readOnly: readOnly, isRepeated: isRepeated, isTabled: isTabled, onUploadFile: handleUploadFile, onUrlChange: handleUrlChange, onFileNameChange: handleFileNameChange })));
84
+ }
85
+ export default AttachmentItem;
86
+ //# sourceMappingURL=AttachmentItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQrD,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;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AAW,EAAE,eAAe,EAC5B,gBAAgB,EAAE,oBAAoB,GACtC,CACU,CACf,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
3
+ interface AttachmentUrlFieldProps extends PropsWithIsTabledAttribute {
4
+ linkId: string;
5
+ url: string;
6
+ readOnly: boolean;
7
+ onUrlChange: (url: string) => void;
8
+ }
9
+ declare function AttachmentUrlField(props: AttachmentUrlFieldProps): React.JSX.Element;
10
+ export default AttachmentUrlField;
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright 2023 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 { StandardTextField } from '../Textfield.styles';
19
+ import Typography from '@mui/material/Typography';
20
+ import Box from '@mui/material/Box';
21
+ import Stack from '@mui/material/Stack';
22
+ import useAttachmentUrlValidation from '../../../hooks/useAttachmentUrlValidation';
23
+ import InputAdornment from '@mui/material/InputAdornment';
24
+ import Tooltip from '@mui/material/Tooltip';
25
+ import CheckIcon from '@mui/icons-material/Check';
26
+ import DangerousIcon from '@mui/icons-material/Dangerous';
27
+ function AttachmentUrlField(props) {
28
+ const { linkId, url, readOnly, isTabled, onUrlChange } = props;
29
+ const urlIsValid = useAttachmentUrlValidation(url);
30
+ return (React.createElement(Box, null,
31
+ React.createElement(Typography, { variant: "body2" }, "URL"),
32
+ React.createElement(Stack, { direction: "row", alignItems: "center" },
33
+ React.createElement(StandardTextField, { fullWidth: true, isTabled: isTabled, id: linkId, value: url, onChange: (event) => onUrlChange(event.target.value), disabled: readOnly, size: "small", "data-test": "q-item-attachment-field", InputProps: {
34
+ endAdornment: (React.createElement(InputAdornment, { position: "end" }, url != '' ? (React.createElement(Tooltip, { title: urlIsValid ? 'URL is valid!' : 'Invalid URL', placement: "right" },
35
+ React.createElement(Box, { mt: 0.5 }, urlIsValid ? (React.createElement(CheckIcon, { color: "success", fontSize: "small" })) : (React.createElement(DangerousIcon, { color: "error", fontSize: "small" }))))) : null))
36
+ } }))));
37
+ }
38
+ export default AttachmentUrlField;
39
+ //# sourceMappingURL=AttachmentUrlField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentUrlField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/AttachmentItem/AttachmentUrlField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,0BAA0B,MAAM,2CAA2C,CAAC;AACnF,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAS1D,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE/D,MAAM,UAAU,GAAG,0BAA0B,CAAC,GAAG,CAAC,CAAC;IAEnD,OAAO,CACL,oBAAC,GAAG;QACF,oBAAC,UAAU,IAAC,OAAO,EAAC,OAAO,UAAiB;QAC5C,oBAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,QAAQ;YACxC,oBAAC,iBAAiB,IAChB,SAAS,QACT,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACpD,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,eACF,yBAAyB,EACnC,UAAU,EAAE;oBACV,YAAY,EAAE,CACZ,oBAAC,cAAc,IAAC,QAAQ,EAAC,KAAK,IAC3B,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CACX,oBAAC,OAAO,IAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,EAAE,SAAS,EAAC,OAAO;wBAC7E,oBAAC,GAAG,IAAC,EAAE,EAAE,GAAG,IACT,UAAU,CAAC,CAAC,CAAC,CACZ,oBAAC,SAAS,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,GAAG,CAC/C,CAAC,CAAC,CAAC,CACF,oBAAC,aAAa,IAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAC,OAAO,GAAG,CACjD,CACG,CACE,CACX,CAAC,CAAC,CAAC,IAAI,CACO,CAClB;iBACF,GACD,CACI,CACJ,CACP,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { Coding, QuestionnaireItem } from 'fhir/r4';
3
3
  import type { PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute } from '../../../interfaces/renderProps.interface';
4
- import { AlertColor } from '@mui/material/Alert';
4
+ import type { AlertColor } from '@mui/material/Alert';
5
5
  interface ChoiceAutocompleteFieldsProps extends PropsWithIsTabledAttribute, PropsWithParentIsReadOnlyAttribute {
6
6
  qItem: QuestionnaireItem;
7
7
  options: Coding[];
@@ -19,7 +19,7 @@ import Autocomplete from '@mui/material/Autocomplete';
19
19
  import CircularProgress from '@mui/material/CircularProgress';
20
20
  import Fade from '@mui/material/Fade';
21
21
  import Tooltip from '@mui/material/Tooltip';
22
- import { StandardTextField } from '../Textfield.styles';
22
+ import { StandardTextField, TEXT_FIELD_WIDTH } from '../Textfield.styles';
23
23
  import SearchIcon from '@mui/icons-material/Search';
24
24
  import InfoIcon from '@mui/icons-material/Info';
25
25
  import WarningAmberIcon from '@mui/icons-material/WarningAmber';
@@ -29,7 +29,7 @@ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
29
29
  function ChoiceAutocompleteField(props) {
30
30
  const { qItem, options, valueCoding, loading, feedback, readOnly, isTabled, onInputChange, onValueChange } = props;
31
31
  const { displayUnit, displayPrompt, entryFormat } = useRenderingExtensions(qItem);
32
- return (React.createElement(Autocomplete, { id: qItem.id, value: valueCoding !== null && valueCoding !== void 0 ? valueCoding : null, options: options, getOptionLabel: (option) => `${option.display}`, isOptionEqualToValue: (option, value) => option.id === value.id, disabled: readOnly, loading: loading, loadingText: 'Fetching results...', clearOnEscape: true, autoHighlight: true, onChange: (_, newValue) => onValueChange(newValue), sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160, flexGrow: 1 }, filterOptions: (x) => x, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({}, params, { onChange: (e) => onInputChange(e.target.value), isTabled: isTabled, label: displayPrompt, size: "small", placeholder: entryFormat, InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React.createElement(React.Fragment, null,
32
+ return (React.createElement(Autocomplete, { id: qItem.id, value: valueCoding !== null && valueCoding !== void 0 ? valueCoding : null, options: options, getOptionLabel: (option) => `${option.display}`, isOptionEqualToValue: (option, value) => option.id === value.id, disabled: readOnly, loading: loading, loadingText: 'Fetching results...', clearOnEscape: true, autoHighlight: true, onChange: (_, newValue) => onValueChange(newValue), sx: { maxWidth: !isTabled ? TEXT_FIELD_WIDTH : 3000, minWidth: 160, flexGrow: 1 }, filterOptions: (x) => x, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({}, params, { onChange: (e) => onInputChange(e.target.value), isTabled: isTabled, label: displayPrompt, size: "small", placeholder: entryFormat, InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React.createElement(React.Fragment, null,
33
33
  !valueCoding ? React.createElement(SearchIcon, { fontSize: "small", sx: { ml: 0.5 } }) : null,
34
34
  params.InputProps.startAdornment)), endAdornment: (React.createElement(React.Fragment, null,
35
35
  loading ? (React.createElement(CircularProgress, { color: "inherit", size: 16 })) : feedback ? (React.createElement(Fade, { in: !!feedback, timeout: 300 },
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceAutocompleteField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceAutocompleteField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAoB3E,SAAS,uBAAuB,CAAC,KAAoC;IACnE,MAAM,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,OAAO,E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AE,EAAE,CAAC,EAAE,IAEjD;4BACE,IAAI,EAAE,oBAAC,QAAQ,IAAC,QAAQ,EAAC,OAAO,EAAC,KAAK,EAAC,MAAM,GAAG;4BAChD,OAAO,EAAE,oBAAC,gBAAgB,IAAC,QAAQ,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAG;4BAC9D,OAAO,EAAE,oBAAC,QAAQ,IAAC,QAAQ,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAG;4BACtD,KAAK,EAAE,oBAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,GAAG;yBACpD,CAAC,QAAQ,CAAC,KAAK,CAAC,CAEX,CACL,CACR,CAAC,CAAC,CAAC,IAAI;oBACP,MAAM,CAAC,UAAU,CAAC,YAAY;oBAC9B,WAAW,CACX,CACJ,OAEH,CACH,GACD,CACH,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
3
3
  import type { Coding, QuestionnaireResponseItemAnswer } from 'fhir/r4';
4
+ import type { TerminologyError } from '../../../hooks/useValueSetCodings';
4
5
  interface ChoiceCheckboxAnswerValueSetFieldsProps {
5
6
  codings: Coding[];
6
7
  answers: QuestionnaireResponseItemAnswer[];
7
8
  orientation: ChoiceItemOrientation;
8
9
  readOnly: boolean;
9
- serverError: Error | null;
10
+ terminologyError: TerminologyError;
10
11
  onCheckedChange: (newValue: string) => void;
11
12
  }
12
13
  declare function ChoiceCheckboxAnswerValueSetFields(props: ChoiceCheckboxAnswerValueSetFieldsProps): React.JSX.Element;
@@ -22,17 +22,20 @@ import { StyledAlert } from '../../Alert.styles';
22
22
  import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
23
23
  import Typography from '@mui/material/Typography';
24
24
  function ChoiceCheckboxAnswerValueSetFields(props) {
25
- const { codings, answers, orientation, readOnly, serverError, onCheckedChange } = props;
25
+ const { codings, answers, orientation, readOnly, terminologyError, onCheckedChange } = props;
26
26
  if (codings.length > 0) {
27
27
  return (React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal }, codings.map((coding) => {
28
28
  var _a, _b, _c;
29
29
  return (React.createElement(CheckboxSingle, { key: (_a = coding.code) !== null && _a !== void 0 ? _a : '', value: (_b = coding.code) !== null && _b !== void 0 ? _b : '', label: (_c = coding.display) !== null && _c !== void 0 ? _c : `${coding.code}`, readOnly: readOnly, isChecked: answers.some((answer) => JSON.stringify(answer.valueCoding) === JSON.stringify(coding)), onCheckedChange: onCheckedChange }));
30
30
  })));
31
31
  }
32
- if (serverError) {
32
+ if (terminologyError.error) {
33
33
  return (React.createElement(StyledAlert, { color: "error" },
34
34
  React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
35
- React.createElement(Typography, { variant: "subtitle2" }, "There was an error fetching options from the terminology server")));
35
+ React.createElement(Typography, { variant: "subtitle2" },
36
+ "There was an error fetching options from the terminology server for",
37
+ ' ',
38
+ terminologyError.answerValueSet)));
36
39
  }
37
40
  return (React.createElement(StyledAlert, { color: "error" },
38
41
  React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceCheckboxAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO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,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,kCAAkC,CAAC"}
1
+ {"version":3,"file":"ChoiceCheckboxAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAYlD,SAAS,kCAAkC,CAAC,KAA8C;IACxF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE7F,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,OAAO,CACL,oBAAC,eAAe,IAAC,GAAG,EAAE,WAAW,KAAK,qBAAqB,CAAC,UAAU,IACnE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;YAAC,OAAA,CACvB,oBAAC,cAAc,IACb,GAAG,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE,EACtB,KAAK,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE,EACxB,KAAK,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,IAAI,EAAE,EACzC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,CAAC,IAAI,CACrB,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAC1E,EACD,eAAe,EAAE,eAAe,GAChC,CACH,CAAA;SAAA,CAAC,CACc,CACnB,CAAC;KACH;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE;QAC1B,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;YACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW;;gBACuC,GAAG;gBACtE,gBAAgB,CAAC,cAAc,CACrB,CACD,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,kCAAkC,CAAC"}
@@ -32,7 +32,7 @@ function ChoiceCheckboxAnswerValueSetItem(props) {
32
32
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
33
33
  const { displayInstructions } = useRenderingExtensions(qItem);
34
34
  // Get codings/options from valueSet
35
- const { codings, serverError } = useValueSetCodings(qItem);
35
+ const { codings, terminologyError } = useValueSetCodings(qItem);
36
36
  // Event handlers
37
37
  function handleCheckedChange(changedValue) {
38
38
  if (codings.length < 1)
@@ -44,12 +44,12 @@ function ChoiceCheckboxAnswerValueSetItem(props) {
44
44
  }
45
45
  if (showMinimalView) {
46
46
  return (React.createElement(React.Fragment, null,
47
- React.createElement(ChoiceCheckboxAnswerValueSetFields, { codings: codings, answers: answers, orientation: orientation, readOnly: readOnly, serverError: serverError, onCheckedChange: handleCheckedChange }),
47
+ React.createElement(ChoiceCheckboxAnswerValueSetFields, { codings: codings, answers: answers, orientation: orientation, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleCheckedChange }),
48
48
  React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly })));
49
49
  }
50
50
  return (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-checkbox-answer-value-set-box" },
51
51
  React.createElement(ItemFieldGrid, { qItem: qItem, readOnly: readOnly },
52
- React.createElement(ChoiceCheckboxAnswerValueSetFields, { codings: codings, answers: answers, orientation: orientation, readOnly: readOnly, serverError: serverError, onCheckedChange: handleCheckedChange }))));
52
+ React.createElement(ChoiceCheckboxAnswerValueSetFields, { codings: codings, answers: answers, orientation: orientation, readOnly: readOnly, terminologyError: terminologyError, onCheckedChange: handleCheckedChange }))));
53
53
  }
54
54
  export default ChoiceCheckboxAnswerValueSetItem;
55
55
  //# sourceMappingURL=ChoiceCheckboxAnswerValueSetItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAO3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,aAAa,MAAM,4BAA4B,CAAC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,EAAE,QAAQ,GAAI,CACpF,CACJ,CAAC;KACH;IAED,OAAO,CACL,oBAAC,yBAAyB,iBAAW,6CAA6C;QAChF,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7C,oBAAC,kCAAkC,IACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,mBAAmB,GACpC,CACY,CACU,CAC7B,CAAC;AACJ,CAAC;AAED,eAAe,gCAAgC,CAAC"}
1
+ {"version":3,"file":"ChoiceCheckboxAnswerValueSetItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAO3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAavD,SAAS,gCAAgC,CAAC,KAA4C;IACpF,MAAM,EACJ,KAAK,EACL,MAAM,EACN,WAAW,EACX,UAAU,EACV,eAAe,GAAG,KAAK,EACvB,gBAAgB,EAChB,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,mBAAmB;IACnB,MAAM,gBAAgB,GAAG,MAAM,aAAN,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