@beda.software/web-item-controls 0.1.25-group-new-design.8 → 0.1.25
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 +45 -44
- 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.js +1 -1
- 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 +17 -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,94 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { i18n as r } from "@lingui/core";
|
|
3
|
-
import { PlusOutlined as R, RightOutlined as $ } from "@ant-design/icons";
|
|
4
|
-
import { Fragment as w } from "react";
|
|
5
|
-
import { S as t } from "./styles.js";
|
|
6
|
-
function S(m) {
|
|
7
|
-
const {
|
|
8
|
-
section: e,
|
|
9
|
-
depth: d = 0,
|
|
10
|
-
expandedRootKey: c,
|
|
11
|
-
expandedKeys: u,
|
|
12
|
-
selectedKey: p,
|
|
13
|
-
onToggleRoot: h,
|
|
14
|
-
onToggleExpand: b,
|
|
15
|
-
onSelect: g,
|
|
16
|
-
onAdd: o
|
|
17
|
-
} = m, x = d === 0, l = x || !e.isRepeatable ? d : d + 1, a = e.nodes.map((s) => /* @__PURE__ */ n(C, { node: s, depth: l, siblingCount: e.nodes.length, expandedRootKey: c, expandedKeys: u, selectedKey: p, onToggleRoot: h, onToggleExpand: b, onSelect: g, onAdd: o }, s.key));
|
|
18
|
-
return x ? e.nodes.length === 0 ? /* @__PURE__ */ i(t.Row, { $depth: d, children: [
|
|
19
|
-
/* @__PURE__ */ n(t.RowLabel, { children: e.text }),
|
|
20
|
-
e.isRepeatable && !e.hideAddButton && o ? /* @__PURE__ */ n(t.ExpandButton, { type: "button", "aria-label": r._(
|
|
21
|
-
/*i18n*/
|
|
22
|
-
{
|
|
23
|
-
id: "3nLdaX",
|
|
24
|
-
values: {
|
|
25
|
-
0: e.text
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
), "data-testid": `sidebar-menu-add-${e.linkId}`, onClick: () => o(e), children: /* @__PURE__ */ n(R, {}) }) : null
|
|
29
|
-
] }) : /* @__PURE__ */ i(t.Section, { children: [
|
|
30
|
-
a,
|
|
31
|
-
e.isRepeatable && !e.hideAddButton && o ? /* @__PURE__ */ n(t.Row, { $depth: d, children: /* @__PURE__ */ i(t.AddButton, { type: "button", "data-testid": `sidebar-menu-add-${e.linkId}`, onClick: () => o(e), children: [
|
|
32
|
-
/* @__PURE__ */ n(R, {}),
|
|
33
|
-
r._(
|
|
34
|
-
/*i18n*/
|
|
35
|
-
{
|
|
36
|
-
id: "3nLdaX",
|
|
37
|
-
values: {
|
|
38
|
-
0: e.text
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
] }) }) : null
|
|
43
|
-
] }) : e.isRepeatable ? /* @__PURE__ */ i(t.Section, { children: [
|
|
44
|
-
/* @__PURE__ */ i(t.Row, { $depth: d, children: [
|
|
45
|
-
/* @__PURE__ */ n(t.RowLabel, { children: e.text }),
|
|
46
|
-
!e.hideAddButton && o ? /* @__PURE__ */ n(t.ExpandButton, { type: "button", "aria-label": r._(
|
|
47
|
-
/*i18n*/
|
|
48
|
-
{
|
|
49
|
-
id: "3nLdaX",
|
|
50
|
-
values: {
|
|
51
|
-
0: e.text
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
), "data-testid": `sidebar-menu-add-${e.linkId}`, onClick: () => o(e), children: /* @__PURE__ */ n(R, {}) }) : null
|
|
55
|
-
] }),
|
|
56
|
-
a
|
|
57
|
-
] }) : /* @__PURE__ */ n(t.Section, { children: a });
|
|
58
|
-
}
|
|
59
|
-
function C(m) {
|
|
60
|
-
const {
|
|
61
|
-
node: e,
|
|
62
|
-
depth: d,
|
|
63
|
-
siblingCount: c,
|
|
64
|
-
expandedRootKey: u,
|
|
65
|
-
expandedKeys: p,
|
|
66
|
-
selectedKey: h,
|
|
67
|
-
onToggleRoot: b,
|
|
68
|
-
onToggleExpand: g,
|
|
69
|
-
onSelect: o,
|
|
70
|
-
onAdd: x
|
|
71
|
-
} = m, l = d === 0, a = e.sections.length > 0, s = l ? e.key === u : p.has(e.key), k = a && (!l || c >= 2), f = h === e.key;
|
|
72
|
-
return /* @__PURE__ */ i(w, { children: [
|
|
73
|
-
/* @__PURE__ */ i(t.Row, { $depth: d, $selected: f, $clickable: !0, onClick: () => o(e), "data-testid": `sidebar-menu-row-${e.key}`, children: [
|
|
74
|
-
/* @__PURE__ */ n(t.RowLabel, { children: e.text }),
|
|
75
|
-
k ? /* @__PURE__ */ n(t.ExpandButton, { type: "button", "aria-label": s ? r._(
|
|
76
|
-
/*i18n*/
|
|
77
|
-
{
|
|
78
|
-
id: "H86f9p"
|
|
79
|
-
}
|
|
80
|
-
) : r._(
|
|
81
|
-
/*i18n*/
|
|
82
|
-
{
|
|
83
|
-
id: "1A3EXy"
|
|
84
|
-
}
|
|
85
|
-
), "data-testid": `sidebar-menu-toggle-${e.key}`, onClick: (y) => {
|
|
86
|
-
y.stopPropagation(), l ? b(e) : g(e.key);
|
|
87
|
-
}, children: /* @__PURE__ */ n($, { rotate: s ? 90 : 0 }) }) : null
|
|
88
|
-
] }),
|
|
89
|
-
a && (s || l && c < 2) ? e.sections.map((y) => /* @__PURE__ */ n(S, { section: y, depth: d + 1, expandedRootKey: u, expandedKeys: p, selectedKey: h, onToggleRoot: b, onToggleExpand: g, onSelect: o, onAdd: x }, y.key)) : null
|
|
90
|
-
] });
|
|
91
|
-
}
|
|
92
|
-
export {
|
|
93
|
-
S as SidebarMenu
|
|
94
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GroupItemProps } from 'sdc-qrf';
|
|
2
|
-
export declare function GroupWizardSidebar(props: GroupItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
-
export { shouldApplySidebarDesign } from './utils';
|
|
4
|
-
export type { SidebarMenuNode, SidebarMenuSection } from './types';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/controls/GroupWizard/GroupWizardSidebar/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAkC,MAAM,SAAS,CAAC;AA+BzE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,kDAmSvD;AAED,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnD,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as K, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import { Trans as L } from "@lingui/react";
|
|
3
|
-
import { i18n as Q } from "@lingui/core";
|
|
4
|
-
import { DeleteOutlined as Z } from "@ant-design/icons";
|
|
5
|
-
import { Popconfirm as $, Button as J } from "antd";
|
|
6
|
-
import z from "lodash";
|
|
7
|
-
import { useState as E, useMemo as F, useEffect as U } from "react";
|
|
8
|
-
import { useWatch as Y, useFormContext as ee } from "react-hook-form";
|
|
9
|
-
import { QuestionItems as te, populateItemKey as ne } from "sdc-qrf";
|
|
10
|
-
import { Text as oe } from "../../../components/Typography.js";
|
|
11
|
-
import { GroupWizardBus as y } from "../index.js";
|
|
12
|
-
import { ParentPreviewFields as se } from "./ParentPreviewFields.js";
|
|
13
|
-
import { SidebarMenu as re } from "./SidebarMenu.js";
|
|
14
|
-
import { S as h } from "./styles.js";
|
|
15
|
-
import { buildRootSection as ie, shouldApplySidebarDesign as de, findSectionByLinkId as ce } from "./utils.js";
|
|
16
|
-
function O(g, m, u) {
|
|
17
|
-
g.nodes.forEach((f) => {
|
|
18
|
-
u.nodesByKey.set(f.key, f), u.ancestorsByKey.set(f.key, m), f.sections.forEach((s) => O(s, [...m, f.key], u));
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
function ae(g) {
|
|
22
|
-
const m = {
|
|
23
|
-
nodesByKey: /* @__PURE__ */ new Map(),
|
|
24
|
-
ancestorsByKey: /* @__PURE__ */ new Map()
|
|
25
|
-
};
|
|
26
|
-
return O(g, [], m), m;
|
|
27
|
-
}
|
|
28
|
-
function Pe(g) {
|
|
29
|
-
var N, W;
|
|
30
|
-
const {
|
|
31
|
-
parentPath: m,
|
|
32
|
-
questionItem: u,
|
|
33
|
-
context: f
|
|
34
|
-
} = g, {
|
|
35
|
-
linkId: s,
|
|
36
|
-
hidden: V,
|
|
37
|
-
readOnly: k
|
|
38
|
-
} = u, P = f[0], B = Y(), {
|
|
39
|
-
getValues: G,
|
|
40
|
-
setValue: j
|
|
41
|
-
} = ee(), [M, x] = E(null), [_, w] = E(/* @__PURE__ */ new Set()), [d, v] = E(null), o = F(() => ie(u, m, B, P), [u, m, B, P]), {
|
|
42
|
-
nodesByKey: I,
|
|
43
|
-
ancestorsByKey: T
|
|
44
|
-
} = F(() => ae(o), [o]), r = d ? I.get(d) : void 0, q = (d ? T.get(d) ?? [] : []).map((e) => I.get(e)).filter((e) => !!e && e.contentItems.length > 0), A = d ? ((N = T.get(d)) == null ? void 0 : N[0]) ?? d : (W = o.nodes[0]) == null ? void 0 : W.key, p = A ? I.get(A) : void 0, R = (e) => p ? ce(p.sections, e) : void 0;
|
|
45
|
-
U(() => {
|
|
46
|
-
if (!r && o.nodes.length > 0) {
|
|
47
|
-
const e = o.nodes[0];
|
|
48
|
-
v(e.key), x(e.key);
|
|
49
|
-
}
|
|
50
|
-
}, [r, o]);
|
|
51
|
-
const b = (e) => {
|
|
52
|
-
v(e);
|
|
53
|
-
const t = T.get(e) ?? [], [n, ...i] = t;
|
|
54
|
-
x(n ?? e), i.length > 0 && w((c) => /* @__PURE__ */ new Set([...c, ...i]));
|
|
55
|
-
}, X = (e) => {
|
|
56
|
-
const t = o.nodes.map((c) => c.key);
|
|
57
|
-
if (t.length < 2)
|
|
58
|
-
return;
|
|
59
|
-
if (M !== e.key) {
|
|
60
|
-
x(e.key);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const i = (t.indexOf(e.key) + 1) % t.length;
|
|
64
|
-
x(t[i]);
|
|
65
|
-
}, C = (e, t) => {
|
|
66
|
-
const n = z.get(G(), e.fieldPath), i = (n == null ? void 0 : n.items) ?? [], c = [...i, {}].map(ne), l = [...e.fieldPath, "items", i.length.toString()].join(".");
|
|
67
|
-
j(e.fieldPath.join("."), {
|
|
68
|
-
...n,
|
|
69
|
-
items: c
|
|
70
|
-
}, {
|
|
71
|
-
shouldDirty: !0
|
|
72
|
-
}), v(l), e === o ? x(l) : t && p && (x(p.key), w((S) => /* @__PURE__ */ new Set([...S, ...t])));
|
|
73
|
-
}, D = (e) => {
|
|
74
|
-
if (e.repeatIndex === void 0 || !e.fieldPath)
|
|
75
|
-
return;
|
|
76
|
-
const t = z.get(G(), e.fieldPath), i = ((t == null ? void 0 : t.items) ?? []).filter((c, l) => l !== e.repeatIndex);
|
|
77
|
-
j(e.fieldPath.join("."), {
|
|
78
|
-
...t,
|
|
79
|
-
items: i
|
|
80
|
-
}, {
|
|
81
|
-
shouldDirty: !0
|
|
82
|
-
}), v(null);
|
|
83
|
-
};
|
|
84
|
-
return y.useBus("sidebarSelect", (e) => {
|
|
85
|
-
e.type !== "sidebarSelect" || e.groupLinkId !== s || !I.has(e.key) || b(e.key);
|
|
86
|
-
}, [s, I]), y.useBus("sidebarGoToIndex", (e) => {
|
|
87
|
-
if (e.type !== "sidebarGoToIndex" || e.groupLinkId !== s)
|
|
88
|
-
return;
|
|
89
|
-
const t = o.nodes[e.index];
|
|
90
|
-
t && b(t.key);
|
|
91
|
-
}, [s, o]), y.useBus("sidebarGoToPrevious", ({
|
|
92
|
-
groupLinkId: e
|
|
93
|
-
}) => {
|
|
94
|
-
var l;
|
|
95
|
-
const t = e === s ? o : (l = R(e)) == null ? void 0 : l.section;
|
|
96
|
-
if (!t)
|
|
97
|
-
return;
|
|
98
|
-
const n = t.nodes.findIndex((S) => S.key === d), i = Math.max(0, (n === -1 ? t.nodes.length : n) - 1), c = t.nodes[i];
|
|
99
|
-
c && b(c.key);
|
|
100
|
-
}, [s, o, p, d]), y.useBus("sidebarGoToNext", ({
|
|
101
|
-
groupLinkId: e
|
|
102
|
-
}) => {
|
|
103
|
-
var l;
|
|
104
|
-
const t = e === s ? o : (l = R(e)) == null ? void 0 : l.section;
|
|
105
|
-
if (!t)
|
|
106
|
-
return;
|
|
107
|
-
const n = t.nodes.findIndex((S) => S.key === d), i = Math.min(t.nodes.length - 1, n + 1), c = t.nodes[i];
|
|
108
|
-
c && b(c.key);
|
|
109
|
-
}, [s, o, p, d]), y.useBus("sidebarAddElement", ({
|
|
110
|
-
groupLinkId: e
|
|
111
|
-
}) => {
|
|
112
|
-
if (e === s) {
|
|
113
|
-
C(o);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
const t = R(e);
|
|
117
|
-
t && C(t.section, t.nestedAncestorKeys);
|
|
118
|
-
}, [s, o, p]), y.useBus("sidebarRemove", ({
|
|
119
|
-
groupLinkId: e
|
|
120
|
-
}) => {
|
|
121
|
-
k || !r || r.item.linkId !== e || D(r);
|
|
122
|
-
}, [k, r]), V || !u.item ? null : de(u) ? /* @__PURE__ */ K(h.Container, { children: [
|
|
123
|
-
/* @__PURE__ */ a(h.Sider, { children: /* @__PURE__ */ a(re, { section: o, expandedRootKey: M, expandedKeys: _, selectedKey: d, onToggleRoot: X, onToggleExpand: (e) => w((t) => {
|
|
124
|
-
const n = new Set(t);
|
|
125
|
-
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
126
|
-
}), onSelect: (e) => y.dispatch({
|
|
127
|
-
type: "sidebarSelect",
|
|
128
|
-
groupLinkId: s,
|
|
129
|
-
key: e.key
|
|
130
|
-
}), onAdd: k ? void 0 : C }) }),
|
|
131
|
-
/* @__PURE__ */ a(h.Content, { children: r ? /* @__PURE__ */ K(H, { children: [
|
|
132
|
-
q.map((e) => /* @__PURE__ */ K(h.ParentPreview, { children: [
|
|
133
|
-
/* @__PURE__ */ a(h.ParentPreviewTitle, { level: 5, children: e.text }),
|
|
134
|
-
/* @__PURE__ */ a(se, { ancestorNode: e, formValues: B })
|
|
135
|
-
] }, e.key)),
|
|
136
|
-
/* @__PURE__ */ K(h.ContentHeader, { children: [
|
|
137
|
-
/* @__PURE__ */ a(h.ContentTitle, { level: 4, children: r.text }),
|
|
138
|
-
!k && r.repeatIndex !== void 0 ? /* @__PURE__ */ a($, { title: Q._(
|
|
139
|
-
/*i18n*/
|
|
140
|
-
{
|
|
141
|
-
id: "XtpCjZ"
|
|
142
|
-
}
|
|
143
|
-
), onConfirm: () => D(r), children: /* @__PURE__ */ a(J, { danger: !0, icon: /* @__PURE__ */ a(Z, {}), "data-testid": `sidebar-menu-remove-${r.key}` }) }) : null
|
|
144
|
-
] }),
|
|
145
|
-
/* @__PURE__ */ a(te, { questionItems: r.contentItems, parentPath: r.path, context: P })
|
|
146
|
-
] }) : null })
|
|
147
|
-
] }) : (console.error("GroupWizardSidebar was used for a group that does not match the sidebar design criteria"), /* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(L, { id: "vya+nX" }) }));
|
|
148
|
-
}
|
|
149
|
-
export {
|
|
150
|
-
Pe as GroupWizardSidebar,
|
|
151
|
-
de as shouldApplySidebarDesign
|
|
152
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare const SIDEBAR_WIDTH = 260;
|
|
2
|
-
export declare const ROW_INDENT = 16;
|
|
3
|
-
export declare const S: {
|
|
4
|
-
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;
|
|
5
|
-
Sider: 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;
|
|
6
|
-
Section: 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;
|
|
7
|
-
Row: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$depth" | "$selected" | "$clickable"> & {
|
|
8
|
-
$depth: number;
|
|
9
|
-
$selected?: boolean;
|
|
10
|
-
$clickable?: boolean;
|
|
11
|
-
}, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$depth" | "$selected" | "$clickable"> & {
|
|
12
|
-
$depth: number;
|
|
13
|
-
$selected?: boolean;
|
|
14
|
-
$clickable?: boolean;
|
|
15
|
-
}, never>>> & string;
|
|
16
|
-
RowLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
17
|
-
ExpandButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
|
|
18
|
-
AddButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
|
|
19
|
-
Content: 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
|
-
ContentHeader: 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;
|
|
21
|
-
ContentTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>, "ref"> & {
|
|
22
|
-
ref?: ((instance: HTMLElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLElement> | null | undefined;
|
|
23
|
-
}, never> & Partial<Pick<Omit<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>, "ref"> & {
|
|
24
|
-
ref?: ((instance: HTMLElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLElement> | null | undefined;
|
|
25
|
-
}, never>>> & string & Omit<import('react').ForwardRefExoticComponent<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>>, keyof import('react').Component<any, {}, any>>;
|
|
26
|
-
ParentPreview: 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;
|
|
27
|
-
ParentPreviewTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>, "ref"> & {
|
|
28
|
-
ref?: ((instance: HTMLElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLElement> | null | undefined;
|
|
29
|
-
}, never> & Partial<Pick<Omit<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>, "ref"> & {
|
|
30
|
-
ref?: ((instance: HTMLElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLElement> | null | undefined;
|
|
31
|
-
}, never>>> & string & Omit<import('react').ForwardRefExoticComponent<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>>, keyof import('react').Component<any, {}, any>>;
|
|
32
|
-
ParentPreviewField: 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;
|
|
33
|
-
ParentPreviewFieldLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/controls/GroupWizard/GroupWizardSidebar/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,eAAO,MAAM,CAAC;;;;;gBAsBgB,MAAM;oBAAc,OAAO;qBAAe,OAAO;;gBAAjD,MAAM;oBAAc,OAAO;qBAAe,OAAO;;;;;;;;;;;;;;;;;;;;CAwG9E,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import i, { css as r } from "styled-components";
|
|
2
|
-
import { Title as t } from "../../../components/Typography.js";
|
|
3
|
-
const a = 260, d = 16, c = {
|
|
4
|
-
Container: i.div.withConfig({
|
|
5
|
-
displayName: "GroupWizardSidebar__Container",
|
|
6
|
-
componentId: "sc-v63n5x-0"
|
|
7
|
-
})(["display:flex;align-items:stretch;gap:24px;border:1px solid ", ";border-radius:12px;overflow:hidden;"], ({
|
|
8
|
-
theme: e
|
|
9
|
-
}) => e.neutralPalette.gray_4),
|
|
10
|
-
Sider: i.div.withConfig({
|
|
11
|
-
displayName: "GroupWizardSidebar__Sider",
|
|
12
|
-
componentId: "sc-v63n5x-1"
|
|
13
|
-
})(["display:flex;flex-direction:column;gap:8px;width:", "px;flex:0 0 auto;padding:12px 8px;background-color:", ";"], a, ({
|
|
14
|
-
theme: e
|
|
15
|
-
}) => e.neutralPalette.gray_2),
|
|
16
|
-
Section: i.div.withConfig({
|
|
17
|
-
displayName: "GroupWizardSidebar__Section",
|
|
18
|
-
componentId: "sc-v63n5x-2"
|
|
19
|
-
})(["display:flex;flex-direction:column;"]),
|
|
20
|
-
Row: i.div.withConfig({
|
|
21
|
-
displayName: "GroupWizardSidebar__Row",
|
|
22
|
-
componentId: "sc-v63n5x-3"
|
|
23
|
-
})(["display:flex;align-items:center;gap:8px;padding:4px 8px 4px ", "px;border-left:2px solid transparent;border-radius:0 4px 4px 0;cursor:", ";", " ", ""], ({
|
|
24
|
-
$depth: e
|
|
25
|
-
}) => 16 + e * d, ({
|
|
26
|
-
$clickable: e
|
|
27
|
-
}) => e ? "pointer" : "default", ({
|
|
28
|
-
$selected: e
|
|
29
|
-
}) => e && r(["border-left-color:", ";*{color:", ";font-weight:600;}"], ({
|
|
30
|
-
theme: n
|
|
31
|
-
}) => {
|
|
32
|
-
var o;
|
|
33
|
-
return (o = n.antdTheme) == null ? void 0 : o.colorPrimary;
|
|
34
|
-
}, ({
|
|
35
|
-
theme: n
|
|
36
|
-
}) => {
|
|
37
|
-
var o;
|
|
38
|
-
return (o = n.antdTheme) == null ? void 0 : o.colorPrimary;
|
|
39
|
-
}), ({
|
|
40
|
-
$clickable: e,
|
|
41
|
-
$selected: n
|
|
42
|
-
}) => e && !n && r(["&:hover{background-color:", ";}"], ({
|
|
43
|
-
theme: o
|
|
44
|
-
}) => o.neutralPalette.gray_3)),
|
|
45
|
-
RowLabel: i.span.withConfig({
|
|
46
|
-
displayName: "GroupWizardSidebar__RowLabel",
|
|
47
|
-
componentId: "sc-v63n5x-4"
|
|
48
|
-
})(["flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;"]),
|
|
49
|
-
ExpandButton: i.button.withConfig({
|
|
50
|
-
displayName: "GroupWizardSidebar__ExpandButton",
|
|
51
|
-
componentId: "sc-v63n5x-5"
|
|
52
|
-
})(["display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 auto;border:none;background:transparent;cursor:pointer;color:", ";&:hover{color:", ";}"], ({
|
|
53
|
-
theme: e
|
|
54
|
-
}) => e.neutral.secondaryText, ({
|
|
55
|
-
theme: e
|
|
56
|
-
}) => {
|
|
57
|
-
var n;
|
|
58
|
-
return (n = e.antdTheme) == null ? void 0 : n.colorPrimary;
|
|
59
|
-
}),
|
|
60
|
-
AddButton: i.button.withConfig({
|
|
61
|
-
displayName: "GroupWizardSidebar__AddButton",
|
|
62
|
-
componentId: "sc-v63n5x-6"
|
|
63
|
-
})(["display:flex;align-items:center;gap:7px;border:none;background:transparent;color:", ";cursor:pointer;font-size:14px;padding:4px 8px;"], ({
|
|
64
|
-
theme: e
|
|
65
|
-
}) => {
|
|
66
|
-
var n;
|
|
67
|
-
return (n = e.antdTheme) == null ? void 0 : n.colorLink;
|
|
68
|
-
}),
|
|
69
|
-
Content: i.div.withConfig({
|
|
70
|
-
displayName: "GroupWizardSidebar__Content",
|
|
71
|
-
componentId: "sc-v63n5x-7"
|
|
72
|
-
})(["flex:1;min-width:0;padding:12px 12px 12px 0;display:flex;flex-direction:column;gap:16px;"]),
|
|
73
|
-
ContentHeader: i.div.withConfig({
|
|
74
|
-
displayName: "GroupWizardSidebar__ContentHeader",
|
|
75
|
-
componentId: "sc-v63n5x-8"
|
|
76
|
-
})(["display:flex;align-items:center;gap:24px;"]),
|
|
77
|
-
ContentTitle: i(t).withConfig({
|
|
78
|
-
displayName: "GroupWizardSidebar__ContentTitle",
|
|
79
|
-
componentId: "sc-v63n5x-9"
|
|
80
|
-
})(["flex:1;min-width:0;margin:0 !important;"]),
|
|
81
|
-
ParentPreview: i.div.withConfig({
|
|
82
|
-
displayName: "GroupWizardSidebar__ParentPreview",
|
|
83
|
-
componentId: "sc-v63n5x-10"
|
|
84
|
-
})(["display:flex;flex-direction:column;gap:8px;"]),
|
|
85
|
-
ParentPreviewTitle: i(t).withConfig({
|
|
86
|
-
displayName: "GroupWizardSidebar__ParentPreviewTitle",
|
|
87
|
-
componentId: "sc-v63n5x-11"
|
|
88
|
-
})(["margin:0 !important;color:", " !important;"], ({
|
|
89
|
-
theme: e
|
|
90
|
-
}) => e.neutral.secondaryText),
|
|
91
|
-
ParentPreviewField: i.div.withConfig({
|
|
92
|
-
displayName: "GroupWizardSidebar__ParentPreviewField",
|
|
93
|
-
componentId: "sc-v63n5x-12"
|
|
94
|
-
})(["display:flex;gap:8px;font-size:14px;"]),
|
|
95
|
-
ParentPreviewFieldLabel: i.span.withConfig({
|
|
96
|
-
displayName: "GroupWizardSidebar__ParentPreviewFieldLabel",
|
|
97
|
-
componentId: "sc-v63n5x-13"
|
|
98
|
-
})(["flex:0 0 auto;color:", ";&::after{content:':';}"], ({
|
|
99
|
-
theme: e
|
|
100
|
-
}) => e.neutral.secondaryText)
|
|
101
|
-
};
|
|
102
|
-
export {
|
|
103
|
-
d as ROW_INDENT,
|
|
104
|
-
c as S,
|
|
105
|
-
a as SIDEBAR_WIDTH
|
|
106
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FCEQuestionnaireItem } from 'sdc-qrf';
|
|
2
|
-
export interface SidebarMenuNode {
|
|
3
|
-
key: string;
|
|
4
|
-
text: string;
|
|
5
|
-
item: FCEQuestionnaireItem;
|
|
6
|
-
path: string[];
|
|
7
|
-
fieldPath?: string[];
|
|
8
|
-
repeatIndex?: number;
|
|
9
|
-
sections: SidebarMenuSection[];
|
|
10
|
-
contentItems: FCEQuestionnaireItem[];
|
|
11
|
-
}
|
|
12
|
-
export interface SidebarMenuSection {
|
|
13
|
-
key: string;
|
|
14
|
-
linkId: string;
|
|
15
|
-
text: string;
|
|
16
|
-
isRepeatable: boolean;
|
|
17
|
-
hideAddButton: boolean;
|
|
18
|
-
fieldPath: string[];
|
|
19
|
-
nodes: SidebarMenuNode[];
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/controls/GroupWizard/GroupWizardSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,oBAAoB,CAAC;IAE3B,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,YAAY,EAAE,oBAAoB,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,eAAe,EAAE,CAAC;CAC5B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FCEQuestionnaireItem, FormItems, ItemContext } from 'sdc-qrf';
|
|
2
|
-
import { SidebarMenuSection } from './types';
|
|
3
|
-
export declare function getItemControlCode(item: FCEQuestionnaireItem): string | undefined;
|
|
4
|
-
export declare function isGroupVoiceItem(item: FCEQuestionnaireItem): boolean;
|
|
5
|
-
export declare function shouldApplySidebarDesign(questionItem: FCEQuestionnaireItem): boolean;
|
|
6
|
-
export declare function buildRootSection(questionItem: FCEQuestionnaireItem, parentPath: string[], formValues: FormItems, groupContext: ItemContext): SidebarMenuSection;
|
|
7
|
-
export interface SectionMatch {
|
|
8
|
-
section: SidebarMenuSection;
|
|
9
|
-
nestedAncestorKeys: string[];
|
|
10
|
-
}
|
|
11
|
-
export declare function findSectionByLinkId(sections: SidebarMenuSection[], targetLinkId: string, nestedAncestorKeys?: string[]): SectionMatch | undefined;
|
|
12
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/controls/GroupWizard/GroupWizardSidebar/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAuB,MAAM,SAAS,CAAC;AAI5F,OAAO,EAAmB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,GAAG,SAAS,CAEjF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAEpE;AAqBD,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAcpF;AA6ED,wBAAgB,gBAAgB,CAC5B,YAAY,EAAE,oBAAoB,EAClC,UAAU,EAAE,MAAM,EAAE,EACpB,UAAU,EAAE,SAAS,EACrB,YAAY,EAAE,WAAW,GAC1B,kBAAkB,CAEpB;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,kBAAkB,CAAC;IAG5B,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAChC;AAMD,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,kBAAkB,EAAE,EAC9B,YAAY,EAAE,MAAM,EACpB,kBAAkB,GAAE,MAAM,EAAO,GAClC,YAAY,GAAG,SAAS,CAgB1B"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import y from "lodash";
|
|
2
|
-
import { getEnabledQuestions as S } from "sdc-qrf";
|
|
3
|
-
import { isGroupAddItemButtonHidden as k } from "../../../utils/questionnaire.js";
|
|
4
|
-
function C(n) {
|
|
5
|
-
var e, t, o;
|
|
6
|
-
return (o = (t = (e = n.itemControl) == null ? void 0 : e.coding) == null ? void 0 : t[0]) == null ? void 0 : o.code;
|
|
7
|
-
}
|
|
8
|
-
function m(n) {
|
|
9
|
-
return C(n) === "group-voice";
|
|
10
|
-
}
|
|
11
|
-
function a(n) {
|
|
12
|
-
return n.type === "group";
|
|
13
|
-
}
|
|
14
|
-
function g(n) {
|
|
15
|
-
return a(n) && !m(n);
|
|
16
|
-
}
|
|
17
|
-
function v(n) {
|
|
18
|
-
return (n.item ?? []).some(g);
|
|
19
|
-
}
|
|
20
|
-
function $(n) {
|
|
21
|
-
const e = (n.item ?? []).filter(g);
|
|
22
|
-
return e.length < 2 ? !1 : e.length > 2 || e.some((t) => t.repeats === !0) || e.some((t) => (t.item ?? []).some(g));
|
|
23
|
-
}
|
|
24
|
-
function A(n, e) {
|
|
25
|
-
const t = y.get(n, [...e, "items"]);
|
|
26
|
-
return Array.isArray(t) ? t.length : 0;
|
|
27
|
-
}
|
|
28
|
-
function R(n, e, t, o) {
|
|
29
|
-
return S(n.item ?? [], e, t, o).filter((i) => !i.hidden);
|
|
30
|
-
}
|
|
31
|
-
function b(n, e, t, o, i, s, c) {
|
|
32
|
-
const u = R(n, t, s, c), d = u.filter((r) => a(r) && (!m(r) || v(r))), f = u.filter((r) => !a(r) || m(r)), l = d.map((r) => h(r, t, s, c));
|
|
33
|
-
return {
|
|
34
|
-
key: t.join("."),
|
|
35
|
-
text: e,
|
|
36
|
-
item: n,
|
|
37
|
-
path: t,
|
|
38
|
-
fieldPath: o,
|
|
39
|
-
repeatIndex: i,
|
|
40
|
-
sections: l,
|
|
41
|
-
contentItems: f
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function h(n, e, t, o) {
|
|
45
|
-
const {
|
|
46
|
-
linkId: i,
|
|
47
|
-
text: s = i,
|
|
48
|
-
repeats: c
|
|
49
|
-
} = n, u = [...e, i], d = k(n);
|
|
50
|
-
if (!c) {
|
|
51
|
-
const r = [...u, "items"], p = b(n, s, r, void 0, void 0, t, o);
|
|
52
|
-
return {
|
|
53
|
-
key: u.join("."),
|
|
54
|
-
linkId: i,
|
|
55
|
-
text: s,
|
|
56
|
-
isRepeatable: !1,
|
|
57
|
-
hideAddButton: d,
|
|
58
|
-
fieldPath: u,
|
|
59
|
-
nodes: [p]
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
const f = A(t, u), l = y.range(f).map((r) => {
|
|
63
|
-
const p = [...u, "items", r.toString()], I = `${s} ${r + 1}`;
|
|
64
|
-
return b(n, I, p, u, r, t, o);
|
|
65
|
-
});
|
|
66
|
-
return {
|
|
67
|
-
key: u.join("."),
|
|
68
|
-
linkId: i,
|
|
69
|
-
text: s,
|
|
70
|
-
isRepeatable: !0,
|
|
71
|
-
hideAddButton: d,
|
|
72
|
-
fieldPath: u,
|
|
73
|
-
nodes: l
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function D(n, e, t, o) {
|
|
77
|
-
return h(n, e, t, o);
|
|
78
|
-
}
|
|
79
|
-
function j(n, e, t = []) {
|
|
80
|
-
for (const o of n) {
|
|
81
|
-
if (o.linkId === e)
|
|
82
|
-
return {
|
|
83
|
-
section: o,
|
|
84
|
-
nestedAncestorKeys: t
|
|
85
|
-
};
|
|
86
|
-
for (const i of o.nodes) {
|
|
87
|
-
const s = j(i.sections, e, [...t, i.key]);
|
|
88
|
-
if (s)
|
|
89
|
-
return s;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
export {
|
|
94
|
-
D as buildRootSection,
|
|
95
|
-
j as findSectionByLinkId,
|
|
96
|
-
C as getItemControlCode,
|
|
97
|
-
m as isGroupVoiceItem,
|
|
98
|
-
$ as shouldApplySidebarDesign
|
|
99
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/readonly-controls/GroupWizardSidebar/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAkCxD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,kDAkNvD"}
|