@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,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as b, jsxs as me, Fragment as We } from "react/jsx-runtime";
|
|
2
2
|
import { i18n as re } from "@lingui/core";
|
|
3
|
-
import { MinusOutlined as
|
|
4
|
-
import { Button as oe, Popconfirm as
|
|
3
|
+
import { MinusOutlined as Oe, PlusOutlined as Te } from "@ant-design/icons";
|
|
4
|
+
import { Button as oe, Popconfirm as je } from "antd";
|
|
5
5
|
import s from "lodash";
|
|
6
|
-
import { useMemo as
|
|
7
|
-
import { useFormContext as
|
|
6
|
+
import { useMemo as S, useState as P, useCallback as g, useEffect as z, useRef as v } from "react";
|
|
7
|
+
import { useFormContext as Ge, useWatch as Ke } from "react-hook-form";
|
|
8
8
|
import { populateItemKey as Pe } from "sdc-qrf";
|
|
9
9
|
import { useFieldController as _e } from "../../components/BaseQuestionnaireResponseForm/hooks.js";
|
|
10
10
|
import { TableFilter as qe } from "../../components/Table/TableFilter/index.js";
|
|
11
11
|
import { RenderFormItemReadOnly as ge } from "./RenderFormItemReadOnly/index.js";
|
|
12
|
-
import { isGroupAddItemButtonHidden as Le } from "../../utils/questionnaire.js";
|
|
13
12
|
import { S as se } from "./styles.js";
|
|
14
|
-
import { getChartYRange as
|
|
15
|
-
function
|
|
16
|
-
const [
|
|
13
|
+
import { getChartYRange as Be, getDataSource as Le, getColumnWidth as ze, getSearchBarColumnType as Ne, isColumnTypeArray as xe, createColumnFilterValue as Xe, getGroupSorter as Ye, isTableItemMatchesFilter as $e } from "./utils.js";
|
|
14
|
+
function ve() {
|
|
15
|
+
const [F, y] = P({}), d = g((l, i, a) => {
|
|
17
16
|
y((p) => l && !s.isEmpty(l) ? {
|
|
18
17
|
...p,
|
|
19
18
|
[i]: {
|
|
20
|
-
...
|
|
19
|
+
...a,
|
|
21
20
|
value: l
|
|
22
21
|
}
|
|
23
22
|
} : s.omit(p, i));
|
|
@@ -26,87 +25,87 @@ function Je() {
|
|
|
26
25
|
return s.reduce(i, (p, m) => {
|
|
27
26
|
if (!m.enableFiltering)
|
|
28
27
|
return p;
|
|
29
|
-
const
|
|
30
|
-
return p[
|
|
28
|
+
const E = m.linkId, h = Ne(m);
|
|
29
|
+
return p[E] = h, p;
|
|
31
30
|
}, {});
|
|
32
31
|
}, []);
|
|
33
32
|
return {
|
|
34
33
|
populateColumnWithFilters: g((l, i) => {
|
|
35
|
-
const
|
|
36
|
-
return s.isEmpty(
|
|
37
|
-
var
|
|
38
|
-
const m = p.key.toString(),
|
|
39
|
-
if (!
|
|
34
|
+
const a = u(i);
|
|
35
|
+
return s.isEmpty(a || !xe(l)) ? l : l.map((p) => {
|
|
36
|
+
var w;
|
|
37
|
+
const m = p.key.toString(), E = a[m];
|
|
38
|
+
if (!E)
|
|
40
39
|
return p;
|
|
41
|
-
const h =
|
|
40
|
+
const h = Xe(E), C = F[m], D = h ? (R) => /* @__PURE__ */ b(qe, { ...R, filter: h, onChange: (W, O) => d(W, O, h) }) : void 0, V = !!((w = F[m]) != null && w.value);
|
|
42
41
|
return {
|
|
43
42
|
...p,
|
|
44
43
|
filterDropdown: D,
|
|
45
|
-
filtered:
|
|
46
|
-
filteredValue:
|
|
47
|
-
onFilter: (
|
|
48
|
-
if (!s.isString(
|
|
44
|
+
filtered: V,
|
|
45
|
+
filteredValue: C ? [m] : [],
|
|
46
|
+
onFilter: (R, W) => {
|
|
47
|
+
if (!s.isString(R))
|
|
49
48
|
return !0;
|
|
50
|
-
const
|
|
51
|
-
return
|
|
49
|
+
const O = F[R], _ = W[m];
|
|
50
|
+
return $e(_, O);
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
53
|
});
|
|
55
|
-
}, [
|
|
54
|
+
}, [F, u, d])
|
|
56
55
|
};
|
|
57
56
|
}
|
|
58
|
-
function
|
|
59
|
-
const
|
|
57
|
+
function Ze() {
|
|
58
|
+
const F = (u) => {
|
|
60
59
|
const f = u.item || [];
|
|
61
|
-
return s.reduce(f, (i,
|
|
62
|
-
if (!
|
|
60
|
+
return s.reduce(f, (i, a) => {
|
|
61
|
+
if (!a.enableSort)
|
|
63
62
|
return i;
|
|
64
|
-
const p =
|
|
63
|
+
const p = a.linkId;
|
|
65
64
|
return i[p] = !0, i;
|
|
66
65
|
}, {});
|
|
67
66
|
}, y = (u, f) => {
|
|
68
|
-
var
|
|
69
|
-
const l = (
|
|
67
|
+
var a, p;
|
|
68
|
+
const l = (a = u.defaultSort) == null ? void 0 : a.linkId, i = (p = u.defaultSort) == null ? void 0 : p.sort;
|
|
70
69
|
if (!(!l || l !== f || !i))
|
|
71
70
|
return i === "asc" ? "ascend" : "descend";
|
|
72
71
|
};
|
|
73
72
|
return {
|
|
74
73
|
populateColumnWithSorters: g((u, f) => {
|
|
75
|
-
const l =
|
|
74
|
+
const l = F(f);
|
|
76
75
|
return s.isEmpty(l || !xe(u)) ? u : u.map((i) => {
|
|
77
|
-
const
|
|
78
|
-
if (l[
|
|
76
|
+
const a = i.key.toString();
|
|
77
|
+
if (l[a] !== !0)
|
|
79
78
|
return i;
|
|
80
|
-
const m =
|
|
79
|
+
const m = Ye(f, a), E = y(f, a);
|
|
81
80
|
return {
|
|
82
81
|
...i,
|
|
83
82
|
sorter: m,
|
|
84
|
-
...
|
|
85
|
-
defaultSortOrder:
|
|
83
|
+
...E ? {
|
|
84
|
+
defaultSortOrder: E
|
|
86
85
|
} : {}
|
|
87
86
|
};
|
|
88
87
|
});
|
|
89
88
|
}, [])
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
|
-
function
|
|
91
|
+
function Je(F) {
|
|
93
92
|
const {
|
|
94
93
|
expandableMaxHeight: y,
|
|
95
|
-
dataSource:
|
|
96
|
-
} =
|
|
94
|
+
dataSource: d
|
|
95
|
+
} = F, u = 32, f = v({}), l = v(null), i = v(/* @__PURE__ */ new WeakMap()), a = v(y), [p, m] = P({}), [E, h] = P([]), C = g((t, e) => {
|
|
97
96
|
if (t.length !== e.length)
|
|
98
97
|
return !1;
|
|
99
98
|
const r = new Set(e.map(String));
|
|
100
99
|
return t.every((o) => r.has(String(o)));
|
|
101
100
|
}, []);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}, [y]),
|
|
101
|
+
z(() => {
|
|
102
|
+
a.current = y;
|
|
103
|
+
}, [y]), z(() => {
|
|
105
104
|
const t = new ResizeObserver((e) => {
|
|
106
105
|
e.forEach((r) => {
|
|
107
106
|
const o = i.current.get(r.target);
|
|
108
|
-
!o || r.contentRect.height <=
|
|
109
|
-
...
|
|
107
|
+
!o || r.contentRect.height <= a.current + u || m((H) => H[o] === !0 ? H : {
|
|
108
|
+
...H,
|
|
110
109
|
[o]: !0
|
|
111
110
|
});
|
|
112
111
|
});
|
|
@@ -119,141 +118,141 @@ function Qe(C) {
|
|
|
119
118
|
const r = l.current, o = f.current[t];
|
|
120
119
|
o && o !== e && r && (r.unobserve(o), i.current.delete(o)), e ? (f.current[t] = e, i.current.set(e, t), r == null || r.observe(e)) : (o && i.current.delete(o), delete f.current[t]);
|
|
121
120
|
}, []);
|
|
122
|
-
|
|
123
|
-
const t = new Set(
|
|
121
|
+
z(() => {
|
|
122
|
+
const t = new Set(d.map((e) => e.key));
|
|
124
123
|
m((e) => {
|
|
125
124
|
let r = !1;
|
|
126
125
|
const o = {};
|
|
127
|
-
return Object.keys(e).forEach((
|
|
128
|
-
const
|
|
129
|
-
t.has(
|
|
126
|
+
return Object.keys(e).forEach((k) => {
|
|
127
|
+
const H = e[k];
|
|
128
|
+
t.has(k) && H !== void 0 ? o[k] = H : r = !0;
|
|
130
129
|
}), r ? o : e;
|
|
131
130
|
}), h((e) => {
|
|
132
131
|
const r = e.filter((o) => t.has(String(o)));
|
|
133
132
|
return r.length === e.length ? e : r;
|
|
134
133
|
});
|
|
135
|
-
}, [
|
|
136
|
-
const
|
|
137
|
-
const t =
|
|
134
|
+
}, [d]);
|
|
135
|
+
const V = g(() => {
|
|
136
|
+
const t = a.current + u, e = {};
|
|
138
137
|
Object.entries(f.current).forEach(([r, o]) => {
|
|
139
138
|
o && (e[r] = o.clientHeight > t);
|
|
140
139
|
}), m((r) => {
|
|
141
|
-
const o = Object.keys(r),
|
|
142
|
-
return o.length !==
|
|
140
|
+
const o = Object.keys(r), k = Object.keys(e);
|
|
141
|
+
return o.length !== k.length ? e : o.every((X) => r[X] === e[X]) ? r : e;
|
|
143
142
|
});
|
|
144
143
|
}, [u]);
|
|
145
|
-
|
|
144
|
+
z(() => {
|
|
146
145
|
const t = () => {
|
|
147
|
-
|
|
146
|
+
V();
|
|
148
147
|
};
|
|
149
148
|
return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
150
|
-
}, [
|
|
151
|
-
const
|
|
149
|
+
}, [V]);
|
|
150
|
+
const M = g((t) => {
|
|
152
151
|
var o;
|
|
153
152
|
const e = p[t];
|
|
154
153
|
return e !== void 0 ? e : (((o = f.current[t]) == null ? void 0 : o.clientHeight) ?? 0) > y + u;
|
|
155
|
-
}, [u, y, p]),
|
|
154
|
+
}, [u, y, p]), I = g(() => {
|
|
156
155
|
requestAnimationFrame(() => {
|
|
157
|
-
requestAnimationFrame(
|
|
156
|
+
requestAnimationFrame(V);
|
|
158
157
|
});
|
|
159
|
-
}, [
|
|
158
|
+
}, [V]), N = g((t, e) => {
|
|
160
159
|
h((r) => t ? r.includes(e) ? r : [...r, e] : r.includes(e) ? r.filter((o) => o !== e) : r);
|
|
161
|
-
}, []),
|
|
162
|
-
const t =
|
|
163
|
-
h((e) =>
|
|
164
|
-
}, [
|
|
160
|
+
}, []), w = g(() => {
|
|
161
|
+
const t = d.map((e) => e.key).filter((e) => M(e));
|
|
162
|
+
h((e) => C(e, t) ? e : t);
|
|
163
|
+
}, [C, d, M]), R = g(() => {
|
|
165
164
|
h((t) => t.length === 0 ? t : []);
|
|
166
|
-
}, []),
|
|
165
|
+
}, []), W = S(() => d.map((t) => t.key).filter((t) => M(t)), [d, M]), O = W.length > 0, _ = S(() => new Set(E.map(String)), [E]), B = O && W.every((t) => _.has(t)), Z = E.length > 0;
|
|
167
166
|
return {
|
|
168
167
|
observeRow: D,
|
|
169
|
-
rowHeightExceedsMaxHeight:
|
|
170
|
-
handleRowHeightRecompute:
|
|
171
|
-
handleRowExpand:
|
|
172
|
-
handleRowExpandAll:
|
|
173
|
-
handleRowCollapseAll:
|
|
174
|
-
isRowExpanded:
|
|
175
|
-
hasExpandableRows:
|
|
176
|
-
isAllExpandableRowsExpanded:
|
|
177
|
-
hasExpandedRows:
|
|
168
|
+
rowHeightExceedsMaxHeight: M,
|
|
169
|
+
handleRowHeightRecompute: I,
|
|
170
|
+
handleRowExpand: N,
|
|
171
|
+
handleRowExpandAll: w,
|
|
172
|
+
handleRowCollapseAll: R,
|
|
173
|
+
isRowExpanded: E,
|
|
174
|
+
hasExpandableRows: O,
|
|
175
|
+
isAllExpandableRowsExpanded: B,
|
|
176
|
+
hasExpandedRows: Z
|
|
178
177
|
};
|
|
179
178
|
}
|
|
180
|
-
function
|
|
179
|
+
function ut(F) {
|
|
181
180
|
var ue, pe;
|
|
182
181
|
const {
|
|
183
182
|
parentPath: y,
|
|
184
|
-
questionItem:
|
|
183
|
+
questionItem: d,
|
|
185
184
|
expandableMaxHeight: u = 100,
|
|
186
185
|
columnAlignment: f
|
|
187
|
-
} =
|
|
186
|
+
} = F, {
|
|
188
187
|
linkId: l,
|
|
189
188
|
repeats: i,
|
|
190
|
-
text:
|
|
189
|
+
text: a,
|
|
191
190
|
hidden: p,
|
|
192
191
|
item: m
|
|
193
|
-
} =
|
|
192
|
+
} = d, E = a || l, h = S(() => [...y, l], [y, l]), C = (ue = d.enableChart) == null ? void 0 : ue.linkIdX, D = (pe = d.enableChart) == null ? void 0 : pe.linkIdY, V = Be(d), M = d.chartHighlight, {
|
|
194
193
|
onChange: I
|
|
195
|
-
} = _e(h,
|
|
196
|
-
control:
|
|
197
|
-
getValues:
|
|
194
|
+
} = _e(h, d), {
|
|
195
|
+
control: N,
|
|
196
|
+
getValues: w,
|
|
198
197
|
reset: R
|
|
199
|
-
} =
|
|
200
|
-
populateColumnWithFilters:
|
|
201
|
-
} =
|
|
202
|
-
populateColumnWithSorters:
|
|
203
|
-
} =
|
|
204
|
-
control:
|
|
205
|
-
}),
|
|
206
|
-
observeRow:
|
|
198
|
+
} = Ge(), [W, O] = P(!C && !D), [_, B] = P(!1), [Z, t] = P(void 0), [e, r] = P(null), [o, k] = P(null), {
|
|
199
|
+
populateColumnWithFilters: H
|
|
200
|
+
} = ve(), {
|
|
201
|
+
populateColumnWithSorters: X
|
|
202
|
+
} = Ze(), Ee = Ke({
|
|
203
|
+
control: N
|
|
204
|
+
}), T = s.get(Ee, h), q = S(() => m == null ? void 0 : m.filter((n) => !n.hidden && n.type !== "display"), [m]), j = S(() => (T == null ? void 0 : T.items) || [], [T]), Y = S(() => s.map(q, (n) => n.linkId), [q]), G = S(() => Le(Y, j, d), [Y, j, d]), {
|
|
205
|
+
observeRow: we,
|
|
207
206
|
rowHeightExceedsMaxHeight: J,
|
|
208
207
|
handleRowHeightRecompute: le,
|
|
209
208
|
handleRowExpand: ie,
|
|
210
|
-
handleRowExpandAll:
|
|
211
|
-
handleRowCollapseAll:
|
|
209
|
+
handleRowExpandAll: Re,
|
|
210
|
+
handleRowCollapseAll: ye,
|
|
212
211
|
isRowExpanded: U,
|
|
213
|
-
hasExpandableRows:
|
|
214
|
-
isAllExpandableRowsExpanded:
|
|
215
|
-
hasExpandedRows:
|
|
216
|
-
} =
|
|
212
|
+
hasExpandableRows: be,
|
|
213
|
+
isAllExpandableRowsExpanded: Se,
|
|
214
|
+
hasExpandedRows: Fe
|
|
215
|
+
} = Je({
|
|
217
216
|
expandableMaxHeight: u,
|
|
218
|
-
dataSource:
|
|
217
|
+
dataSource: G
|
|
219
218
|
}), ae = g((n) => {
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
ae(n),
|
|
223
|
-
}, [ae]),
|
|
224
|
-
const n = s.cloneDeep(
|
|
225
|
-
s.set(n, h, s.cloneDeep(
|
|
219
|
+
r(s.cloneDeep(T)), k(s.cloneDeep(G)), t(n);
|
|
220
|
+
}, [G, T]), L = g((n) => {
|
|
221
|
+
ae(n), B(!0);
|
|
222
|
+
}, [ae]), ke = g(() => {
|
|
223
|
+
const n = s.cloneDeep(w());
|
|
224
|
+
s.set(n, h, s.cloneDeep(e)), R(n, {
|
|
226
225
|
keepDirty: !0
|
|
227
|
-
}), I(s.cloneDeep(
|
|
228
|
-
}, [h,
|
|
229
|
-
|
|
230
|
-
const n =
|
|
226
|
+
}), I(s.cloneDeep(e) ?? void 0), r(null), k(null), t(void 0), B(!1);
|
|
227
|
+
}, [h, w, I, R, e]), Ce = g(() => {
|
|
228
|
+
r(null), k(null);
|
|
229
|
+
const n = w();
|
|
231
230
|
R(n, {
|
|
232
231
|
keepDirty: !0
|
|
233
|
-
}),
|
|
234
|
-
}, [
|
|
235
|
-
if (
|
|
236
|
-
|
|
232
|
+
}), B(!1), le();
|
|
233
|
+
}, [w, le, R]), Ie = (n) => [...n, {}].map(Pe), He = g(() => {
|
|
234
|
+
if (G.length === 0 && j.length !== 0)
|
|
235
|
+
L(0);
|
|
237
236
|
else {
|
|
238
|
-
const n =
|
|
239
|
-
...
|
|
237
|
+
const n = Ie(j), x = {
|
|
238
|
+
...T,
|
|
240
239
|
items: n
|
|
241
|
-
},
|
|
242
|
-
s.set(
|
|
240
|
+
}, c = s.cloneDeep(w());
|
|
241
|
+
s.set(c, h, s.cloneDeep(n)), I(x), L(j.length);
|
|
243
242
|
}
|
|
244
|
-
}, [
|
|
245
|
-
const x = s.cloneDeep(
|
|
246
|
-
...
|
|
247
|
-
items: [...
|
|
243
|
+
}, [G, j, L, T, w, h, I]), $ = g((n) => {
|
|
244
|
+
const x = s.cloneDeep(w()), c = s.get(x, h) ?? {}, A = s.isArray(c.items) ? c.items : [], K = s.filter(A, (ee, te) => te !== n), Q = {
|
|
245
|
+
...c,
|
|
246
|
+
items: [...K]
|
|
248
247
|
};
|
|
249
248
|
s.set(x, h, s.cloneDeep(Q)), R(x, {
|
|
250
249
|
keepDirty: !0
|
|
251
250
|
}), I(Q);
|
|
252
|
-
}, [h,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}, [
|
|
256
|
-
const
|
|
251
|
+
}, [h, w, I, R]);
|
|
252
|
+
z(() => {
|
|
253
|
+
G.length === 0 && j.length === 1 && !_ && $(0);
|
|
254
|
+
}, [G.length, j.length, $, _]);
|
|
255
|
+
const Ae = (n) => {
|
|
257
256
|
switch (n.type) {
|
|
258
257
|
case "integer":
|
|
259
258
|
case "decimal":
|
|
@@ -263,100 +262,99 @@ function ft(C) {
|
|
|
263
262
|
return "left";
|
|
264
263
|
}
|
|
265
264
|
}, ce = (() => {
|
|
266
|
-
const n = s.map(
|
|
267
|
-
const A =
|
|
265
|
+
const n = s.map(q, (c) => {
|
|
266
|
+
const A = c.linkId, K = c.type === "text";
|
|
268
267
|
return {
|
|
269
|
-
title:
|
|
268
|
+
title: c.text ? c.text : "",
|
|
270
269
|
dataIndex: A,
|
|
271
270
|
key: A,
|
|
272
|
-
align: f ? typeof f == "function" ? f(
|
|
273
|
-
width:
|
|
271
|
+
align: f ? typeof f == "function" ? f(c) : f : Ae(c),
|
|
272
|
+
width: ze(c),
|
|
274
273
|
render: (ee, te) => {
|
|
275
274
|
const ne = te.key, he = J(ne), fe = U.includes(ne);
|
|
276
|
-
return /* @__PURE__ */ me(
|
|
277
|
-
/* @__PURE__ */ b(se.ReadonlyItemWrapper, { $maxHeight:
|
|
278
|
-
/* @__PURE__ */ b(se.ExpandButton, { $isExpanded: fe, children:
|
|
275
|
+
return /* @__PURE__ */ me(We, { children: [
|
|
276
|
+
/* @__PURE__ */ b(se.ReadonlyItemWrapper, { $maxHeight: K ? u : void 0, $notFitsMaxHeight: he, children: /* @__PURE__ */ b("div", { ref: K ? we(ne) : void 0, children: /* @__PURE__ */ b(ge, { formItem: ee.formItem, questionnaireItem: ee.questionnaireItem }) }) }),
|
|
277
|
+
/* @__PURE__ */ b(se.ExpandButton, { $isExpanded: fe, children: K && he && /* @__PURE__ */ b(oe, { icon: fe ? /* @__PURE__ */ b(Oe, {}) : /* @__PURE__ */ b(Te, {}) }) })
|
|
279
278
|
] });
|
|
280
279
|
}
|
|
281
280
|
};
|
|
282
|
-
}), x =
|
|
283
|
-
return
|
|
284
|
-
})(),
|
|
285
|
-
const n =
|
|
281
|
+
}), x = X(n, d);
|
|
282
|
+
return H(x, d);
|
|
283
|
+
})(), De = S(() => {
|
|
284
|
+
const n = q == null ? void 0 : q.find((c) => c.type === "text"), x = n == null ? void 0 : n.linkId;
|
|
286
285
|
if (x)
|
|
287
286
|
return {
|
|
288
|
-
rowExpandable: (
|
|
287
|
+
rowExpandable: (c) => J(c.key),
|
|
289
288
|
expandedRowKeys: U,
|
|
290
|
-
expandedRowRender: (
|
|
291
|
-
var A,
|
|
292
|
-
return /* @__PURE__ */ b(ge, { formItem: (A =
|
|
289
|
+
expandedRowRender: (c) => {
|
|
290
|
+
var A, K;
|
|
291
|
+
return /* @__PURE__ */ b(ge, { formItem: (A = c[x]) == null ? void 0 : A.formItem, questionnaireItem: (K = c[x]) == null ? void 0 : K.questionnaireItem });
|
|
293
292
|
},
|
|
294
|
-
onExpand: (
|
|
293
|
+
onExpand: (c, A) => ie(c, A.key),
|
|
295
294
|
showExpandColumn: !1,
|
|
296
295
|
expandRowByClick: !0
|
|
297
296
|
};
|
|
298
|
-
}, [U, ie, J,
|
|
297
|
+
}, [U, ie, J, q]), de = S(() => ({
|
|
299
298
|
title: "Actions",
|
|
300
|
-
dataIndex:
|
|
299
|
+
dataIndex: Y[0] ?? "id",
|
|
301
300
|
key: "action",
|
|
302
301
|
width: 180,
|
|
303
302
|
render: (n) => (n == null ? void 0 : n.index) === void 0 ? null : /* @__PURE__ */ me(se.ActionButtons, { children: [
|
|
304
303
|
/* @__PURE__ */ b(oe, { type: "link", onClick: (x) => {
|
|
305
|
-
x.stopPropagation(),
|
|
304
|
+
x.stopPropagation(), L(n == null ? void 0 : n.index);
|
|
306
305
|
}, children: re._(
|
|
307
306
|
/*i18n*/
|
|
308
307
|
{
|
|
309
308
|
id: "ePK91l"
|
|
310
309
|
}
|
|
311
310
|
) }),
|
|
312
|
-
|
|
311
|
+
/* @__PURE__ */ b(je, { title: re._(
|
|
313
312
|
/*i18n*/
|
|
314
313
|
{
|
|
315
314
|
id: "XtpCjZ"
|
|
316
315
|
}
|
|
317
|
-
), onConfirm: () =>
|
|
316
|
+
), onConfirm: () => $(n.index), children: /* @__PURE__ */ b(oe, { type: "link", danger: !0, onClick: (x) => x.stopPropagation(), children: re._(
|
|
318
317
|
/*i18n*/
|
|
319
318
|
{
|
|
320
319
|
id: "cnGeoo"
|
|
321
320
|
}
|
|
322
321
|
) }) })
|
|
323
322
|
] })
|
|
324
|
-
}), [
|
|
325
|
-
if (!(!
|
|
323
|
+
}), [Y, L, $]), Ve = S(() => [...ce, de], [de, ce]), Me = S(() => {
|
|
324
|
+
if (!(!C || !D))
|
|
326
325
|
return (n) => {
|
|
327
|
-
|
|
326
|
+
O(n);
|
|
328
327
|
};
|
|
329
|
-
}, [
|
|
328
|
+
}, [C, D]);
|
|
330
329
|
return {
|
|
331
330
|
repeats: i,
|
|
332
331
|
hidden: p,
|
|
333
|
-
title:
|
|
334
|
-
hideAddButton: H,
|
|
332
|
+
title: E,
|
|
335
333
|
handleAdd: He,
|
|
336
|
-
dataSource:
|
|
337
|
-
columns:
|
|
338
|
-
expandable:
|
|
339
|
-
isModalVisible:
|
|
340
|
-
editIndex:
|
|
341
|
-
handleCancel:
|
|
342
|
-
handleSave:
|
|
343
|
-
snapshotDataSource:
|
|
344
|
-
renderAsTable:
|
|
345
|
-
handleRenderTypeToggle:
|
|
346
|
-
handleRowExpandAll:
|
|
347
|
-
handleRowCollapseAll:
|
|
348
|
-
hasExpandableRows:
|
|
349
|
-
isAllExpandableRowsExpanded:
|
|
350
|
-
hasExpandedRows:
|
|
351
|
-
chartLinkIdX:
|
|
352
|
-
chartLinkIdY:
|
|
334
|
+
dataSource: G,
|
|
335
|
+
columns: Ve,
|
|
336
|
+
expandable: De,
|
|
337
|
+
isModalVisible: _,
|
|
338
|
+
editIndex: Z,
|
|
339
|
+
handleCancel: ke,
|
|
340
|
+
handleSave: Ce,
|
|
341
|
+
snapshotDataSource: o,
|
|
342
|
+
renderAsTable: W,
|
|
343
|
+
handleRenderTypeToggle: Me,
|
|
344
|
+
handleRowExpandAll: Re,
|
|
345
|
+
handleRowCollapseAll: ye,
|
|
346
|
+
hasExpandableRows: be,
|
|
347
|
+
isAllExpandableRowsExpanded: Se,
|
|
348
|
+
hasExpandedRows: Fe,
|
|
349
|
+
chartLinkIdX: C,
|
|
350
|
+
chartLinkIdY: D,
|
|
353
351
|
chartYRange: V,
|
|
354
|
-
chartHighlightAreas:
|
|
352
|
+
chartHighlightAreas: M
|
|
355
353
|
};
|
|
356
354
|
}
|
|
357
355
|
export {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
356
|
+
ut as useGroupTable,
|
|
357
|
+
ve as useGroupTableFilter,
|
|
358
|
+
Ze as useGroupTableSorter,
|
|
359
|
+
Je as useRowExpandability
|
|
362
360
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupTable/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAEzD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupTable/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAEzD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDAqGhD"}
|