@beda.software/web-item-controls 0.1.25-group-new-design.8 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/components/ModalQuestionnaireGroupItem/hooks.js +7 -10
- package/dist/components/ModalQuestionnaireGroupItem/index.js +6 -4
- package/dist/components/SearchBar/SearchBarColumn/ReferenceColumn/index.js +2 -2
- package/dist/components/SearchBar/SearchBarMobile/styles.js +3 -3
- package/dist/components/Table/index.js +1 -1
- package/dist/controls/DateTimeSlotPicker/index.js +4 -4
- package/dist/controls/Display/index.js +5 -7
- package/dist/controls/Group/RepeatableGroups/RepeatableGroupCard/index.d.ts.map +1 -1
- package/dist/controls/Group/RepeatableGroups/RepeatableGroupCard/index.js +14 -15
- package/dist/controls/Group/RepeatableGroups/RepeatableGroupRow.d.ts.map +1 -1
- package/dist/controls/Group/RepeatableGroups/RepeatableGroupRow.js +11 -12
- package/dist/controls/Group/RepeatableGroups/index.d.ts.map +1 -1
- package/dist/controls/Group/RepeatableGroups/index.js +26 -27
- package/dist/controls/Group/group.module.scss.js +6 -10
- package/dist/controls/Group/index.d.ts.map +1 -1
- package/dist/controls/Group/index.js +45 -47
- package/dist/controls/GroupTable/RenderFormItemReadOnly/index.js +6 -7
- package/dist/controls/GroupTable/hooks.d.ts +0 -1
- package/dist/controls/GroupTable/hooks.d.ts.map +1 -1
- package/dist/controls/GroupTable/hooks.js +175 -177
- package/dist/controls/GroupTable/index.d.ts.map +1 -1
- package/dist/controls/GroupTable/index.js +38 -39
- package/dist/controls/GroupWizard/GroupWizard.stories.utils.d.ts +1 -1
- package/dist/controls/GroupWizard/GroupWizard.stories.utils.d.ts.map +1 -1
- package/dist/controls/GroupWizard/index.d.ts +1 -61
- package/dist/controls/GroupWizard/index.d.ts.map +1 -1
- package/dist/controls/ImageAnnotation/AnnotationImage.d.ts +16 -0
- package/dist/controls/ImageAnnotation/AnnotationImage.d.ts.map +1 -0
- package/dist/controls/ImageAnnotation/AnnotationImage.js +37 -0
- package/dist/controls/ImageAnnotation/index.d.ts +9 -0
- package/dist/controls/ImageAnnotation/index.d.ts.map +1 -0
- package/dist/controls/ImageAnnotation/index.js +121 -0
- package/dist/controls/ImageAnnotation/styles.d.ts +21 -0
- package/dist/controls/ImageAnnotation/styles.d.ts.map +1 -0
- package/dist/controls/ImageAnnotation/styles.js +66 -0
- package/dist/controls/ImageAnnotation/utils.d.ts +3 -0
- package/dist/controls/ImageAnnotation/utils.d.ts.map +1 -0
- package/dist/controls/ImageAnnotation/utils.js +9 -0
- package/dist/controls/MDEditorControl/MarkDownEditor/directives.js +3 -3
- package/dist/controls/MDEditorControl/MarkDownEditor/hooks.js +1 -1
- package/dist/controls/Reference/index.js +2 -2
- package/dist/controls/UploadFileControl/hooks.js +3 -4
- package/dist/controls/UploadFileControl/index.js +1 -1
- package/dist/controls/controls.d.ts.map +1 -1
- package/dist/controls/controls.js +51 -56
- package/dist/controls/index.d.ts +1 -1
- package/dist/controls/index.d.ts.map +1 -1
- package/dist/controls/index.js +44 -46
- package/dist/ext/d3-array/src/bisect.js +6 -7
- package/dist/ext/d3-array/src/bisector.js +2 -4
- package/dist/ext/d3-array/src/ticks.js +7 -18
- package/dist/ext/d3-color/src/color.js +3 -6
- package/dist/ext/d3-color/src/define.js +1 -2
- package/dist/ext/d3-format/src/defaultLocale.js +3 -4
- package/dist/ext/d3-format/src/formatDecimal.js +1 -2
- package/dist/ext/d3-format/src/formatPrefixAuto.js +1 -2
- package/dist/ext/d3-format/src/formatRounded.js +1 -2
- package/dist/ext/d3-format/src/formatSpecifier.js +1 -2
- package/dist/ext/d3-format/src/formatTrim.js +13 -15
- package/dist/ext/d3-interpolate/src/array.js +3 -6
- package/dist/ext/d3-interpolate/src/numberArray.js +1 -2
- package/dist/ext/d3-interpolate/src/object.js +1 -2
- package/dist/ext/d3-interpolate/src/string.js +1 -2
- package/dist/ext/d3-scale/src/continuous.js +4 -4
- package/dist/ext/unist-util-is/lib/index.js +2 -4
- package/dist/locale/de/messages.d.ts.map +1 -1
- package/dist/locale/de/messages.js +1 -4
- package/dist/locale/en/messages.d.ts.map +1 -1
- package/dist/locale/en/messages.js +1 -4
- package/dist/locale/es/messages.d.ts.map +1 -1
- package/dist/locale/es/messages.js +1 -4
- package/dist/locale/ru/messages.d.ts.map +1 -1
- package/dist/locale/ru/messages.js +1 -4
- package/dist/readonly-controls/Display/index.js +4 -4
- package/dist/readonly-controls/Group/index.d.ts.map +1 -1
- package/dist/readonly-controls/Group/index.js +25 -27
- package/dist/readonly-controls/ImageAnnotation/index.d.ts +4 -0
- package/dist/readonly-controls/ImageAnnotation/index.d.ts.map +1 -0
- package/dist/readonly-controls/ImageAnnotation/index.js +45 -0
- package/dist/readonly-controls/MarkdownRender/index.d.ts.map +1 -1
- package/dist/readonly-controls/MarkdownRender/index.js +51 -41
- package/dist/readonly-controls/index.d.ts +1 -1
- package/dist/readonly-controls/index.d.ts.map +1 -1
- package/dist/readonly-controls/index.js +17 -17
- package/dist/readonly-controls/readonly-controls.d.ts.map +1 -1
- package/dist/readonly-controls/readonly-controls.js +33 -42
- package/dist/services/fhir.js +73 -46
- package/dist/services/i18n.js +12 -33
- package/dist/style.css +1 -1
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/date.js +1 -1
- package/dist/utils/fhirpath.d.ts +1 -0
- package/dist/utils/fhirpath.d.ts.map +1 -1
- package/dist/utils/fhirpath.js +3 -2
- package/dist/utils/questionnaire.d.ts +0 -1
- package/dist/utils/questionnaire.d.ts.map +1 -1
- package/dist/utils/questionnaire.js +17 -23
- package/package.json +18 -13
- package/src/locale/de/messages.po +39 -48
- package/src/locale/de/messages.ts +1 -1
- package/src/locale/en/messages.po +39 -48
- package/src/locale/en/messages.ts +1 -1
- package/src/locale/es/messages.po +39 -48
- package/src/locale/es/messages.ts +1 -1
- package/src/locale/ru/messages.po +39 -48
- package/src/locale/ru/messages.ts +1 -1
- package/dist/components/Table/table.scss.js +0 -4
- package/dist/containers/App/utils.d.ts +0 -6
- package/dist/containers/App/utils.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/GroupWizardSidebar.stories.utils.d.ts +0 -10
- package/dist/controls/GroupWizard/GroupWizardSidebar/GroupWizardSidebar.stories.utils.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.d.ts +0 -9
- package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.js +0 -29
- package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.d.ts +0 -14
- package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.js +0 -94
- package/dist/controls/GroupWizard/GroupWizardSidebar/index.d.ts +0 -5
- package/dist/controls/GroupWizard/GroupWizardSidebar/index.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/index.js +0 -152
- package/dist/controls/GroupWizard/GroupWizardSidebar/styles.d.ts +0 -35
- package/dist/controls/GroupWizard/GroupWizardSidebar/styles.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/styles.js +0 -106
- package/dist/controls/GroupWizard/GroupWizardSidebar/types.d.ts +0 -21
- package/dist/controls/GroupWizard/GroupWizardSidebar/types.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/utils.d.ts +0 -12
- package/dist/controls/GroupWizard/GroupWizardSidebar/utils.d.ts.map +0 -1
- package/dist/controls/GroupWizard/GroupWizardSidebar/utils.js +0 -99
- package/dist/readonly-controls/GroupWizardSidebar/index.d.ts +0 -3
- package/dist/readonly-controls/GroupWizardSidebar/index.d.ts.map +0 -1
- package/dist/readonly-controls/GroupWizardSidebar/index.js +0 -104
- package/dist/utils/constants.js +0 -4
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, Fragment as H, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { i18n as r } from "@lingui/core";
|
|
3
|
-
import { ExpandAltOutlined as
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { ModalQuestionnaireGroupItem as
|
|
6
|
-
import { useGroupTable as
|
|
7
|
-
import { GroupTableChart as
|
|
3
|
+
import { ExpandAltOutlined as O, PlusOutlined as V } from "@ant-design/icons";
|
|
4
|
+
import { Flex as j, Typography as s, Space as m, Switch as z, Button as u, Table as L, Alert as g } from "antd";
|
|
5
|
+
import { ModalQuestionnaireGroupItem as M } from "../../components/ModalQuestionnaireGroupItem/index.js";
|
|
6
|
+
import { useGroupTable as P } from "./hooks.js";
|
|
7
|
+
import { GroupTableChart as Y } from "./GroupTableChart/index.js";
|
|
8
8
|
import { S as x } from "./styles.js";
|
|
9
|
-
import { getValueFromAnswerValue as
|
|
10
|
-
function
|
|
9
|
+
import { getValueFromAnswerValue as Z, isFormAnswerItems as ee } from "./utils.js";
|
|
10
|
+
function J(a) {
|
|
11
11
|
const {
|
|
12
12
|
chartHeight: f
|
|
13
|
-
} =
|
|
13
|
+
} = a, {
|
|
14
14
|
repeats: y,
|
|
15
15
|
hidden: b,
|
|
16
|
-
title:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
handleSave: R,
|
|
16
|
+
title: i,
|
|
17
|
+
handleAdd: A,
|
|
18
|
+
dataSource: n,
|
|
19
|
+
columns: T,
|
|
20
|
+
expandable: w,
|
|
21
|
+
isModalVisible: I,
|
|
22
|
+
editIndex: k,
|
|
23
|
+
handleCancel: S,
|
|
24
|
+
handleSave: C,
|
|
26
25
|
snapshotDataSource: t,
|
|
27
26
|
renderAsTable: d,
|
|
28
27
|
handleRenderTypeToggle: o,
|
|
29
|
-
handleRowExpandAll:
|
|
30
|
-
handleRowCollapseAll:
|
|
31
|
-
hasExpandableRows:
|
|
28
|
+
handleRowExpandAll: R,
|
|
29
|
+
handleRowCollapseAll: _,
|
|
30
|
+
hasExpandableRows: E,
|
|
32
31
|
isAllExpandableRowsExpanded: h,
|
|
33
32
|
chartLinkIdX: c,
|
|
34
33
|
chartLinkIdY: p,
|
|
35
|
-
chartYRange:
|
|
36
|
-
chartHighlightAreas:
|
|
37
|
-
} =
|
|
38
|
-
return b ? null : /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */ e(s.Title, { level: 4, children:
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
o && /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */ e(
|
|
34
|
+
chartYRange: G,
|
|
35
|
+
chartHighlightAreas: v
|
|
36
|
+
} = P(a);
|
|
37
|
+
return b ? null : /* @__PURE__ */ l(H, { children: [
|
|
38
|
+
/* @__PURE__ */ l(j, { justify: "space-between", children: [
|
|
39
|
+
/* @__PURE__ */ e(s.Title, { level: 4, children: i }),
|
|
40
|
+
/* @__PURE__ */ l(m, { size: 16, children: [
|
|
41
|
+
o && /* @__PURE__ */ l(m, { size: "small", children: [
|
|
42
|
+
/* @__PURE__ */ e(z, { checked: d, onChange: o }),
|
|
44
43
|
/* @__PURE__ */ e(s.Text, { children: r._(
|
|
45
44
|
/*i18n*/
|
|
46
45
|
{
|
|
@@ -48,7 +47,7 @@ function N(l) {
|
|
|
48
47
|
}
|
|
49
48
|
) })
|
|
50
49
|
] }),
|
|
51
|
-
|
|
50
|
+
E && /* @__PURE__ */ e(u, { type: "primary", icon: /* @__PURE__ */ e(O, {}), onClick: h ? _ : R, children: h ? r._(
|
|
52
51
|
/*i18n*/
|
|
53
52
|
{
|
|
54
53
|
id: "qvWGzP"
|
|
@@ -59,7 +58,7 @@ function N(l) {
|
|
|
59
58
|
id: "OlAl5i"
|
|
60
59
|
}
|
|
61
60
|
) }),
|
|
62
|
-
|
|
61
|
+
/* @__PURE__ */ e(u, { type: "primary", icon: /* @__PURE__ */ e(V, {}), onClick: A, children: r._(
|
|
63
62
|
/*i18n*/
|
|
64
63
|
{
|
|
65
64
|
id: "Rd7v4h"
|
|
@@ -67,7 +66,7 @@ function N(l) {
|
|
|
67
66
|
) })
|
|
68
67
|
] })
|
|
69
68
|
] }),
|
|
70
|
-
y ? d ? /* @__PURE__ */ e(x.TableWrapper, { children: /* @__PURE__ */ e(
|
|
69
|
+
y ? d ? /* @__PURE__ */ e(x.TableWrapper, { children: /* @__PURE__ */ e(L, { columns: T, dataSource: t ?? n, rowKey: (F) => F.key, pagination: !1, bordered: !0, expandable: w }) }) : c && p ? /* @__PURE__ */ e(x.ChartItem, { $chartHeight: f, children: /* @__PURE__ */ e(Y, { dataSource: t ?? n, linkIdX: c, linkIdY: p, chartYRange: G, chartHighlightAreas: v, ...a }) }) : /* @__PURE__ */ e(g, { type: "error", message: r._(
|
|
71
70
|
/*i18n*/
|
|
72
71
|
{
|
|
73
72
|
id: "hHcMdO"
|
|
@@ -78,12 +77,12 @@ function N(l) {
|
|
|
78
77
|
id: "VP0gyL"
|
|
79
78
|
}
|
|
80
79
|
) }),
|
|
81
|
-
/* @__PURE__ */ e(
|
|
80
|
+
/* @__PURE__ */ e(M, { open: I, index: k, groupItem: a, title: i, handleCancel: S, handleSave: C })
|
|
82
81
|
] });
|
|
83
82
|
}
|
|
84
83
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
J as GroupTable,
|
|
85
|
+
Z as getValueFromAnswerValue,
|
|
86
|
+
ee as isFormAnswerItems,
|
|
87
|
+
P as useGroupTable
|
|
89
88
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Decorator } from '@storybook/react';
|
|
1
|
+
import { Decorator } from '@storybook/react-vite';
|
|
2
2
|
import { Questionnaire, QuestionnaireResponse } from 'fhir/r4b';
|
|
3
3
|
import { FCEQuestionnaireItem, ItemContext } from 'sdc-qrf';
|
|
4
4
|
export declare const WIZARD_ITEM: FCEQuestionnaireItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupWizard.stories.utils.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/GroupWizard.stories.utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"GroupWizard.stories.utils.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/GroupWizard.stories.utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAa,WAAW,EAAqC,MAAM,SAAS,CAAC;AAY1G,eAAO,MAAM,WAAW,EAAE,oBAqEzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAI3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,qBAGpC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAAW,EAMhC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,SAsB9C,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,EAAE,oBAAoB,+FAkBpD"}
|
|
@@ -4,76 +4,16 @@ export interface GroupWizardProps extends GroupItemProps {
|
|
|
4
4
|
wizard?: Partial<WizardProps>;
|
|
5
5
|
}
|
|
6
6
|
export declare const GroupWizardBus: {
|
|
7
|
-
useBus: (type: "scrollTo"
|
|
7
|
+
useBus: (type: "scrollTo", callback: (e: {
|
|
8
8
|
type: "scrollTo";
|
|
9
9
|
groupLinkId: string;
|
|
10
|
-
} | {
|
|
11
|
-
type: "sidebarAddElement";
|
|
12
|
-
groupLinkId: string;
|
|
13
|
-
} | {
|
|
14
|
-
type: "sidebarGoToIndex";
|
|
15
|
-
groupLinkId: string;
|
|
16
|
-
index: number;
|
|
17
|
-
} | {
|
|
18
|
-
type: "sidebarGoToPrevious";
|
|
19
|
-
groupLinkId: string;
|
|
20
|
-
} | {
|
|
21
|
-
type: "sidebarGoToNext";
|
|
22
|
-
groupLinkId: string;
|
|
23
|
-
} | {
|
|
24
|
-
type: "sidebarRemove";
|
|
25
|
-
groupLinkId: string;
|
|
26
|
-
} | {
|
|
27
|
-
type: "sidebarSelect";
|
|
28
|
-
groupLinkId: string;
|
|
29
|
-
key: string;
|
|
30
10
|
}) => void, deps: Array<any>) => (action: {
|
|
31
11
|
type: "scrollTo";
|
|
32
12
|
groupLinkId: string;
|
|
33
|
-
} | {
|
|
34
|
-
type: "sidebarAddElement";
|
|
35
|
-
groupLinkId: string;
|
|
36
|
-
} | {
|
|
37
|
-
type: "sidebarGoToIndex";
|
|
38
|
-
groupLinkId: string;
|
|
39
|
-
index: number;
|
|
40
|
-
} | {
|
|
41
|
-
type: "sidebarGoToPrevious";
|
|
42
|
-
groupLinkId: string;
|
|
43
|
-
} | {
|
|
44
|
-
type: "sidebarGoToNext";
|
|
45
|
-
groupLinkId: string;
|
|
46
|
-
} | {
|
|
47
|
-
type: "sidebarRemove";
|
|
48
|
-
groupLinkId: string;
|
|
49
|
-
} | {
|
|
50
|
-
type: "sidebarSelect";
|
|
51
|
-
groupLinkId: string;
|
|
52
|
-
key: string;
|
|
53
13
|
}) => void;
|
|
54
14
|
dispatch: (action: {
|
|
55
15
|
type: "scrollTo";
|
|
56
16
|
groupLinkId: string;
|
|
57
|
-
} | {
|
|
58
|
-
type: "sidebarAddElement";
|
|
59
|
-
groupLinkId: string;
|
|
60
|
-
} | {
|
|
61
|
-
type: "sidebarGoToIndex";
|
|
62
|
-
groupLinkId: string;
|
|
63
|
-
index: number;
|
|
64
|
-
} | {
|
|
65
|
-
type: "sidebarGoToPrevious";
|
|
66
|
-
groupLinkId: string;
|
|
67
|
-
} | {
|
|
68
|
-
type: "sidebarGoToNext";
|
|
69
|
-
groupLinkId: string;
|
|
70
|
-
} | {
|
|
71
|
-
type: "sidebarRemove";
|
|
72
|
-
groupLinkId: string;
|
|
73
|
-
} | {
|
|
74
|
-
type: "sidebarSelect";
|
|
75
|
-
groupLinkId: string;
|
|
76
|
-
key: string;
|
|
77
17
|
}) => void;
|
|
78
18
|
};
|
|
79
19
|
export declare function GroupWizardVertical(props: GroupWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACH,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,WAAW,EAGd,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAsB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKxE,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,cAAc;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACH,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,WAAW,EAGd,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAsB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKxE,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,cAAc;;cACjB,UAAU;qBACH,MAAM;;cADb,UAAU;qBACH,MAAM;;;cADb,UAAU;qBACH,MAAM;;CACnB,CAAC;AAEL,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,2CAU1D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,gBAAgB,2CAS9D;AAED,MAAM,WAAW,UAAU;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,yBAAyB,EAAE,MAAM,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAkJlD;AAED,eAAO,MAAM,aAAa,GACtB,WAAW,oBAAoB,EAC/B,YAAY,MAAM,EAAE,EACpB,YAAY,SAAS,EACrB,SAAS,WAAW,KACrB,UAeF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { FormItems } from 'sdc-qrf';
|
|
3
|
+
interface AnnotationImageProps {
|
|
4
|
+
imageUrl?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
items: FormItems[];
|
|
7
|
+
xLinkId: string;
|
|
8
|
+
yLinkId: string;
|
|
9
|
+
activeIndex?: number;
|
|
10
|
+
onImageClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
+
onMarkerClick?: (index: number) => void;
|
|
12
|
+
}
|
|
13
|
+
/** Image with numbered markers positioned by x/y percentages. Shared by the editable and readonly views. */
|
|
14
|
+
export declare function AnnotationImage(props: AnnotationImageProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=AnnotationImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationImage.d.ts","sourceRoot":"","sources":["../../../src/controls/ImageAnnotation/AnnotationImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,SAAS,EAAc,MAAM,SAAS,CAAC;AAKhD,UAAU,oBAAoB;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAkC1D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as $, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { i18n as k } from "@lingui/core";
|
|
3
|
+
import { getItemKey as b } from "sdc-qrf";
|
|
4
|
+
import { S as r } from "./styles.js";
|
|
5
|
+
import { getCoordinate as s } from "./utils.js";
|
|
6
|
+
function x(c) {
|
|
7
|
+
const {
|
|
8
|
+
imageUrl: o,
|
|
9
|
+
alt: p,
|
|
10
|
+
items: d,
|
|
11
|
+
xLinkId: g,
|
|
12
|
+
yLinkId: f,
|
|
13
|
+
activeIndex: I,
|
|
14
|
+
onImageClick: i,
|
|
15
|
+
onMarkerClick: a
|
|
16
|
+
} = c;
|
|
17
|
+
return /* @__PURE__ */ $(r.ImageWrapper, { $clickable: !!i, onClick: i, "data-testid": "image-annotation-canvas", children: [
|
|
18
|
+
o ? /* @__PURE__ */ m(r.Image, { src: o, alt: p ?? "", draggable: !1 }) : null,
|
|
19
|
+
d.map((e, t) => {
|
|
20
|
+
const n = s(e, g), l = s(e, f);
|
|
21
|
+
return n === void 0 || l === void 0 ? null : /* @__PURE__ */ m(r.Marker, { type: "button", disabled: !a, $active: t === I, style: {
|
|
22
|
+
left: `${n}%`,
|
|
23
|
+
top: `${l}%`
|
|
24
|
+
}, onClick: (u) => {
|
|
25
|
+
u.stopPropagation(), a == null || a(t);
|
|
26
|
+
}, "aria-label": `${k._(
|
|
27
|
+
/*i18n*/
|
|
28
|
+
{
|
|
29
|
+
id: "V0Qg8j"
|
|
30
|
+
}
|
|
31
|
+
)} ${t + 1}`, "data-testid": `annotation-marker-${t}`, children: t + 1 }, b(e));
|
|
32
|
+
})
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
x as AnnotationImage
|
|
37
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GroupItemProps } from 'sdc-qrf';
|
|
2
|
+
/**
|
|
3
|
+
* Repeatable group rendered on top of an image (`backgroundImage` extension).
|
|
4
|
+
* The first two children must be decimals: they store the marker position as a percentage
|
|
5
|
+
* of the image width (x) and height (y). All the other children describe the annotation
|
|
6
|
+
* and are shown for the currently selected marker only.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ImageAnnotation(props: GroupItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/ImageAnnotation/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEH,cAAc,EAKjB,MAAM,SAAS,CAAC;AA0DjB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,kDA0EpD"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsxs as x, jsx as t, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { i18n as p } from "@lingui/core";
|
|
3
|
+
import { DeleteOutlined as v } from "@ant-design/icons";
|
|
4
|
+
import { Button as D } from "antd";
|
|
5
|
+
import w from "lodash";
|
|
6
|
+
import { useState as P } from "react";
|
|
7
|
+
import { getItemKey as S, populateItemKey as K, QuestionItems as M } from "sdc-qrf";
|
|
8
|
+
import { useFieldController as $ } from "../../components/BaseQuestionnaireResponseForm/hooks.js";
|
|
9
|
+
import { Title as j } from "../../components/Typography.js";
|
|
10
|
+
import { useRepeatableGroup as q } from "../Group/RepeatableGroups/RepeatableGroupCard/hooks.js";
|
|
11
|
+
import { AnnotationImage as B } from "./AnnotationImage.js";
|
|
12
|
+
import { S as m } from "./styles.js";
|
|
13
|
+
const E = 2;
|
|
14
|
+
function A(e, i) {
|
|
15
|
+
return w.round(w.clamp(e / i * 100, 0, 100), E);
|
|
16
|
+
}
|
|
17
|
+
function O(e) {
|
|
18
|
+
return [{
|
|
19
|
+
value: {
|
|
20
|
+
decimal: e
|
|
21
|
+
}
|
|
22
|
+
}];
|
|
23
|
+
}
|
|
24
|
+
function N(e) {
|
|
25
|
+
const {
|
|
26
|
+
index: i,
|
|
27
|
+
items: l,
|
|
28
|
+
onChange: o,
|
|
29
|
+
onRemoved: k,
|
|
30
|
+
groupItem: r
|
|
31
|
+
} = e, {
|
|
32
|
+
text: u,
|
|
33
|
+
readOnly: a,
|
|
34
|
+
item: d
|
|
35
|
+
} = r.questionItem, {
|
|
36
|
+
onRemove: C,
|
|
37
|
+
parentPath: c,
|
|
38
|
+
context: h
|
|
39
|
+
} = q({
|
|
40
|
+
index: i,
|
|
41
|
+
items: l,
|
|
42
|
+
onChange: o,
|
|
43
|
+
groupItem: r
|
|
44
|
+
}), f = (d ?? []).slice(2);
|
|
45
|
+
return /* @__PURE__ */ x(b, { children: [
|
|
46
|
+
/* @__PURE__ */ x(m.DetailsHeader, { children: [
|
|
47
|
+
/* @__PURE__ */ t(j, { level: 5, children: `${u || p._(
|
|
48
|
+
/*i18n*/
|
|
49
|
+
{
|
|
50
|
+
id: "V0Qg8j"
|
|
51
|
+
}
|
|
52
|
+
)} ${i + 1}` }),
|
|
53
|
+
a ? null : /* @__PURE__ */ t(D, { icon: /* @__PURE__ */ t(v, {}), onClick: () => {
|
|
54
|
+
C(), k(i);
|
|
55
|
+
}, "aria-label": p._(
|
|
56
|
+
/*i18n*/
|
|
57
|
+
{
|
|
58
|
+
id: "KGJ03u"
|
|
59
|
+
}
|
|
60
|
+
), "data-testid": "remove-annotation-button" })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ t(m.DetailsItems, { children: /* @__PURE__ */ t(M, { questionItems: f, parentPath: c, context: h }) })
|
|
63
|
+
] });
|
|
64
|
+
}
|
|
65
|
+
function W(e) {
|
|
66
|
+
const {
|
|
67
|
+
parentPath: i,
|
|
68
|
+
questionItem: l
|
|
69
|
+
} = e, {
|
|
70
|
+
linkId: o,
|
|
71
|
+
item: k,
|
|
72
|
+
readOnly: r,
|
|
73
|
+
backgroundImage: u
|
|
74
|
+
} = l, [a, d] = k ?? [], C = [...i, o], {
|
|
75
|
+
value: c,
|
|
76
|
+
onChange: h
|
|
77
|
+
} = $(C, l), [f, y] = P(0);
|
|
78
|
+
if (!a || !d || a.type !== "decimal" || d.type !== "decimal")
|
|
79
|
+
return console.warn(`ImageAnnotation (${o}): the first two child items must be of type decimal`), null;
|
|
80
|
+
l.repeats || console.warn(`ImageAnnotation (${o}): the group must be repeatable`);
|
|
81
|
+
const n = (c == null ? void 0 : c.items) ?? [], g = n[f] ? f : n.length - 1, R = (I) => {
|
|
82
|
+
if (r)
|
|
83
|
+
return;
|
|
84
|
+
const s = I.currentTarget.getBoundingClientRect();
|
|
85
|
+
if (!s.width || !s.height)
|
|
86
|
+
return;
|
|
87
|
+
const _ = K({
|
|
88
|
+
[a.linkId]: O(A(I.clientX - s.left, s.width)),
|
|
89
|
+
[d.linkId]: O(A(I.clientY - s.top, s.height))
|
|
90
|
+
});
|
|
91
|
+
h({
|
|
92
|
+
...c,
|
|
93
|
+
items: [...n, _]
|
|
94
|
+
}), y(n.length);
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ x(m.Container, { "data-testid": o, "data-linkid": o, children: [
|
|
97
|
+
/* @__PURE__ */ x(m.ImagePane, { children: [
|
|
98
|
+
r ? null : /* @__PURE__ */ t(m.Hint, { children: p._(
|
|
99
|
+
/*i18n*/
|
|
100
|
+
{
|
|
101
|
+
id: "2mt1iB"
|
|
102
|
+
}
|
|
103
|
+
) }),
|
|
104
|
+
/* @__PURE__ */ t(B, { imageUrl: u == null ? void 0 : u.url, alt: l.text, items: n, xLinkId: a.linkId, yLinkId: d.linkId, activeIndex: g, onImageClick: r ? void 0 : R, onMarkerClick: y })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ t(m.Details, { children: n[g] ? /* @__PURE__ */ t(N, { index: g, items: n, onChange: h, onRemoved: (I) => y(Math.max(0, I - 1)), groupItem: e }, S(n[g])) : /* @__PURE__ */ t(m.Empty, { children: r ? p._(
|
|
107
|
+
/*i18n*/
|
|
108
|
+
{
|
|
109
|
+
id: "vKC52t"
|
|
110
|
+
}
|
|
111
|
+
) : p._(
|
|
112
|
+
/*i18n*/
|
|
113
|
+
{
|
|
114
|
+
id: "sMXMOk"
|
|
115
|
+
}
|
|
116
|
+
) }) })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
W as ImageAnnotation
|
|
121
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const S: {
|
|
2
|
+
Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
3
|
+
ImagePane: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
4
|
+
Hint: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
5
|
+
ImageWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$clickable"> & {
|
|
6
|
+
$clickable: boolean;
|
|
7
|
+
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$clickable"> & {
|
|
8
|
+
$clickable: boolean;
|
|
9
|
+
}, never>>> & string;
|
|
10
|
+
Image: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>>> & string;
|
|
11
|
+
Marker: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$active"> & {
|
|
12
|
+
$active: boolean;
|
|
13
|
+
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$active"> & {
|
|
14
|
+
$active: boolean;
|
|
15
|
+
}, never>>> & string;
|
|
16
|
+
Details: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
17
|
+
DetailsHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
18
|
+
DetailsItems: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
19
|
+
Empty: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/controls/ImageAnnotation/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC;;;;;oBAwB6B,OAAO;;oBAAP,OAAO;;;;iBAcb,OAAO;;iBAAP,OAAO;;;;;;CA0C3C,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import i from "styled-components";
|
|
2
|
+
const o = {
|
|
3
|
+
Container: i.div.withConfig({
|
|
4
|
+
displayName: "ImageAnnotation__Container",
|
|
5
|
+
componentId: "sc-px6yxv-0"
|
|
6
|
+
})(["display:flex;flex-direction:row;width:100%;min-height:320px;border:1px solid ", ";border-radius:8px;overflow:hidden;"], ({
|
|
7
|
+
theme: e
|
|
8
|
+
}) => e.neutral.dividers),
|
|
9
|
+
ImagePane: i.div.withConfig({
|
|
10
|
+
displayName: "ImageAnnotation__ImagePane",
|
|
11
|
+
componentId: "sc-px6yxv-1"
|
|
12
|
+
})(["display:flex;flex-direction:column;align-items:center;gap:16px;flex:1 1 50%;min-width:0;padding:20px 24px;background-color:", ";"], ({
|
|
13
|
+
theme: e
|
|
14
|
+
}) => e.neutralPalette.gray_2),
|
|
15
|
+
Hint: i.div.withConfig({
|
|
16
|
+
displayName: "ImageAnnotation__Hint",
|
|
17
|
+
componentId: "sc-px6yxv-2"
|
|
18
|
+
})(["text-align:center;color:", ";"], ({
|
|
19
|
+
theme: e
|
|
20
|
+
}) => e.neutral.primaryText),
|
|
21
|
+
ImageWrapper: i.div.withConfig({
|
|
22
|
+
displayName: "ImageAnnotation__ImageWrapper",
|
|
23
|
+
componentId: "sc-px6yxv-3"
|
|
24
|
+
})(["position:relative;display:inline-block;max-width:100%;line-height:0;cursor:", ";user-select:none;"], ({
|
|
25
|
+
$clickable: e
|
|
26
|
+
}) => e ? "crosshair" : "default"),
|
|
27
|
+
Image: i.img.withConfig({
|
|
28
|
+
displayName: "ImageAnnotation__Image",
|
|
29
|
+
componentId: "sc-px6yxv-4"
|
|
30
|
+
})(["display:block;max-width:100%;height:auto;-webkit-user-drag:none;"]),
|
|
31
|
+
Marker: i.button.withConfig({
|
|
32
|
+
displayName: "ImageAnnotation__Marker",
|
|
33
|
+
componentId: "sc-px6yxv-5"
|
|
34
|
+
})(["position:absolute;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;transform:translate(-50%,-50%);border-radius:50%;border:1px solid ", ";background-color:", ";color:", ";font-size:16px;font-weight:600;line-height:1;cursor:pointer;box-shadow:", ";"], ({
|
|
35
|
+
theme: e,
|
|
36
|
+
$active: n
|
|
37
|
+
}) => n ? e.error : "transparent", ({
|
|
38
|
+
theme: e
|
|
39
|
+
}) => `${e.error}40`, ({
|
|
40
|
+
theme: e
|
|
41
|
+
}) => e.error, ({
|
|
42
|
+
theme: e,
|
|
43
|
+
$active: n
|
|
44
|
+
}) => n ? `0 0 0 4px ${e.error}33` : "none"),
|
|
45
|
+
Details: i.div.withConfig({
|
|
46
|
+
displayName: "ImageAnnotation__Details",
|
|
47
|
+
componentId: "sc-px6yxv-6"
|
|
48
|
+
})(["display:flex;flex-direction:column;gap:16px;flex:1 1 50%;min-width:0;padding:20px 24px;"]),
|
|
49
|
+
DetailsHeader: i.div.withConfig({
|
|
50
|
+
displayName: "ImageAnnotation__DetailsHeader",
|
|
51
|
+
componentId: "sc-px6yxv-7"
|
|
52
|
+
})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:16px;"]),
|
|
53
|
+
DetailsItems: i.div.withConfig({
|
|
54
|
+
displayName: "ImageAnnotation__DetailsItems",
|
|
55
|
+
componentId: "sc-px6yxv-8"
|
|
56
|
+
})(["display:flex;flex-direction:column;gap:16px;"]),
|
|
57
|
+
Empty: i.div.withConfig({
|
|
58
|
+
displayName: "ImageAnnotation__Empty",
|
|
59
|
+
componentId: "sc-px6yxv-9"
|
|
60
|
+
})(["color:", ";"], ({
|
|
61
|
+
theme: e
|
|
62
|
+
}) => e.neutral.secondaryText)
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
o as S
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/controls/ImageAnnotation/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,SAAS,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI7F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import c from "lodash";
|
|
2
|
+
function l(o, e) {
|
|
3
|
+
var n, u, a;
|
|
4
|
+
const r = (a = (u = (n = o == null ? void 0 : o[e]) == null ? void 0 : n[0]) == null ? void 0 : u.value) == null ? void 0 : a.decimal;
|
|
5
|
+
return c.isNumber(r) ? r : void 0;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
l as getCoordinate
|
|
9
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { usePublisher as l, insertDirective$ as d, useTranslation as s, Select as c, NestedLexicalEditor as m, useMdastNodeUpdater as u } from "@mdxeditor/editor";
|
|
3
|
-
import {
|
|
3
|
+
import { Popover as p, Select as b } from "antd";
|
|
4
4
|
import { useMemo as g } from "react";
|
|
5
5
|
const i = [{
|
|
6
6
|
name: "note",
|
|
@@ -61,7 +61,7 @@ const i = [{
|
|
|
61
61
|
}), triggerTitle: n("toolbar.admonition", "Insert Admonition"), placeholder: n("toolbar.admonition", "Insert Admonition"), items: r });
|
|
62
62
|
}, h = (e) => {
|
|
63
63
|
const n = u(), r = e.mdastNode.name;
|
|
64
|
-
return /* @__PURE__ */ a(
|
|
64
|
+
return /* @__PURE__ */ a(b, { size: "small", variant: "borderless", value: r, onChange: (t) => n({
|
|
65
65
|
name: t
|
|
66
66
|
}), options: i.map(({
|
|
67
67
|
name: t,
|
|
@@ -75,7 +75,7 @@ const i = [{
|
|
|
75
75
|
}, v = ({
|
|
76
76
|
children: e,
|
|
77
77
|
dropdown: n
|
|
78
|
-
}) => /* @__PURE__ */ a(
|
|
78
|
+
}) => /* @__PURE__ */ a(p, { content: n, trigger: "hover", placement: "topRight", styles: {
|
|
79
79
|
body: {
|
|
80
80
|
padding: 4
|
|
81
81
|
}
|
|
@@ -2,7 +2,7 @@ import { jsxs as V, jsx as v } from "react/jsx-runtime";
|
|
|
2
2
|
import { i18n as L } from "@lingui/core";
|
|
3
3
|
import { EditOutlined as ne } from "@ant-design/icons";
|
|
4
4
|
import { headingsPlugin as oe, listsPlugin as ce, quotePlugin as X, linkPlugin as se, linkDialogPlugin as ie, markdownShortcutPlugin as ae, imagePlugin as le, codeBlockPlugin as ue, codeMirrorPlugin as de, directivesPlugin as pe, thematicBreakPlugin as fe, diffSourcePlugin as ge, tablePlugin as me, DiffSourceToggleWrapper as ve, UndoRedo as Re, BlockTypeSelect as we, BoldItalicUnderlineToggles as he, ListsToggle as Ue, CodeToggle as be, InsertImage as ke, CreateLink as Ie, InsertTable as Me, ConditionalContents as ye, ChangeAdmonitionType as xe, InsertThematicBreak as Pe, toolbarPlugin as Le } from "@mdxeditor/editor";
|
|
5
|
-
import {
|
|
5
|
+
import { notification as Ce, Divider as _ } from "antd";
|
|
6
6
|
import { useRef as x, useContext as Se, useState as W, useMemo as j, useCallback as m, Fragment as z, useEffect as D } from "react";
|
|
7
7
|
import { renderToStaticMarkup as Te } from "react-dom/server";
|
|
8
8
|
import { useTheme as Oe } from "styled-components";
|
|
@@ -10,7 +10,7 @@ import { AsyncSelect as M } from "../../components/Select/index.js";
|
|
|
10
10
|
import { loadResourceOptions as L } from "../../services/questionnaire.js";
|
|
11
11
|
import "fhirpath/fhir-context/r4";
|
|
12
12
|
import { evaluate as R } from "../../utils/fhirpath.js";
|
|
13
|
-
import {
|
|
13
|
+
import { getAnswerCode as T, getAnswerDisplay as U } from "../../utils/questionnaire.js";
|
|
14
14
|
import "../../sharedState/index.js";
|
|
15
15
|
function ie(t) {
|
|
16
16
|
const {
|
|
@@ -101,7 +101,7 @@ function z(t) {
|
|
|
101
101
|
onSelect: m,
|
|
102
102
|
disabled: f
|
|
103
103
|
} = n, e = w(a) ? a.data : [];
|
|
104
|
-
return /* @__PURE__ */ b(E.Item, { ...u, "data-testid": s, "data-linkid": s, children: /* @__PURE__ */ b(M, { onChange: m, value: n.value, loadOptions: r, defaultOptions: e, getOptionLabel: (o) =>
|
|
104
|
+
return /* @__PURE__ */ b(E.Item, { ...u, "data-testid": s, "data-linkid": s, children: /* @__PURE__ */ b(M, { onChange: m, value: n.value, loadOptions: r, defaultOptions: e, getOptionLabel: (o) => U(o.value), getOptionValue: (o) => T(o.value), isMulti: d, placeholder: l, isDisabled: f, isLoading: N(a) }) });
|
|
105
105
|
}
|
|
106
106
|
function ae(t) {
|
|
107
107
|
const {
|
|
@@ -71,10 +71,9 @@ function q({
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
a(h ? [...n ?? [], o] : [o]);
|
|
74
|
-
} else
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
});
|
|
74
|
+
} else r === "error" && d.error({
|
|
75
|
+
message: `${t.file.name} file upload failed.`
|
|
76
|
+
});
|
|
78
77
|
}, [i, s, a, n]), E = m((t) => {
|
|
79
78
|
const r = s.current[t.uid] ?? t.uid;
|
|
80
79
|
a((n ?? []).filter(({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { Trans as u } from "@lingui/react";
|
|
3
3
|
import { InboxOutlined as f } from "@ant-design/icons";
|
|
4
|
-
import {
|
|
4
|
+
import { Upload as s, Form as h } from "antd";
|
|
5
5
|
import { useUploader as g } from "./hooks.js";
|
|
6
6
|
const {
|
|
7
7
|
Dragger: x
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/controls/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,oCAAoC,EACpC,uCAAuC,EACvC,4BAA4B,EAC/B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/controls/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,oCAAoC,EACpC,uCAAuC,EACvC,4BAA4B,EAC/B,MAAM,SAAS,CAAC;AA8CjB,eAAO,MAAM,sBAAsB,EAAE,4BAepC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAA0B,CAAC;AAE5D,eAAO,MAAM,iCAAiC,EAAE,uCAiB/C,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,oCAoB5C,CAAC"}
|