@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.
Files changed (134) hide show
  1. package/README.md +4 -0
  2. package/dist/components/ModalQuestionnaireGroupItem/hooks.js +7 -10
  3. package/dist/components/ModalQuestionnaireGroupItem/index.js +6 -4
  4. package/dist/components/SearchBar/SearchBarColumn/ReferenceColumn/index.js +2 -2
  5. package/dist/components/SearchBar/SearchBarMobile/styles.js +3 -3
  6. package/dist/components/Table/index.js +1 -1
  7. package/dist/controls/DateTimeSlotPicker/index.js +4 -4
  8. package/dist/controls/Display/index.js +5 -7
  9. package/dist/controls/Group/RepeatableGroups/RepeatableGroupCard/index.d.ts.map +1 -1
  10. package/dist/controls/Group/RepeatableGroups/RepeatableGroupCard/index.js +14 -15
  11. package/dist/controls/Group/RepeatableGroups/RepeatableGroupRow.d.ts.map +1 -1
  12. package/dist/controls/Group/RepeatableGroups/RepeatableGroupRow.js +11 -12
  13. package/dist/controls/Group/RepeatableGroups/index.d.ts.map +1 -1
  14. package/dist/controls/Group/RepeatableGroups/index.js +26 -27
  15. package/dist/controls/Group/group.module.scss.js +6 -10
  16. package/dist/controls/Group/index.d.ts.map +1 -1
  17. package/dist/controls/Group/index.js +45 -47
  18. package/dist/controls/GroupTable/RenderFormItemReadOnly/index.js +6 -7
  19. package/dist/controls/GroupTable/hooks.d.ts +0 -1
  20. package/dist/controls/GroupTable/hooks.d.ts.map +1 -1
  21. package/dist/controls/GroupTable/hooks.js +175 -177
  22. package/dist/controls/GroupTable/index.d.ts.map +1 -1
  23. package/dist/controls/GroupTable/index.js +38 -39
  24. package/dist/controls/GroupWizard/GroupWizard.stories.utils.d.ts +1 -1
  25. package/dist/controls/GroupWizard/GroupWizard.stories.utils.d.ts.map +1 -1
  26. package/dist/controls/GroupWizard/index.d.ts +1 -61
  27. package/dist/controls/GroupWizard/index.d.ts.map +1 -1
  28. package/dist/controls/ImageAnnotation/AnnotationImage.d.ts +16 -0
  29. package/dist/controls/ImageAnnotation/AnnotationImage.d.ts.map +1 -0
  30. package/dist/controls/ImageAnnotation/AnnotationImage.js +37 -0
  31. package/dist/controls/ImageAnnotation/index.d.ts +9 -0
  32. package/dist/controls/ImageAnnotation/index.d.ts.map +1 -0
  33. package/dist/controls/ImageAnnotation/index.js +121 -0
  34. package/dist/controls/ImageAnnotation/styles.d.ts +21 -0
  35. package/dist/controls/ImageAnnotation/styles.d.ts.map +1 -0
  36. package/dist/controls/ImageAnnotation/styles.js +66 -0
  37. package/dist/controls/ImageAnnotation/utils.d.ts +3 -0
  38. package/dist/controls/ImageAnnotation/utils.d.ts.map +1 -0
  39. package/dist/controls/ImageAnnotation/utils.js +9 -0
  40. package/dist/controls/MDEditorControl/MarkDownEditor/directives.js +3 -3
  41. package/dist/controls/MDEditorControl/MarkDownEditor/hooks.js +1 -1
  42. package/dist/controls/Reference/index.js +2 -2
  43. package/dist/controls/UploadFileControl/hooks.js +3 -4
  44. package/dist/controls/UploadFileControl/index.js +1 -1
  45. package/dist/controls/controls.d.ts.map +1 -1
  46. package/dist/controls/controls.js +51 -56
  47. package/dist/controls/index.d.ts +1 -1
  48. package/dist/controls/index.d.ts.map +1 -1
  49. package/dist/controls/index.js +44 -46
  50. package/dist/ext/d3-array/src/bisect.js +6 -7
  51. package/dist/ext/d3-array/src/bisector.js +2 -4
  52. package/dist/ext/d3-array/src/ticks.js +7 -18
  53. package/dist/ext/d3-color/src/color.js +3 -6
  54. package/dist/ext/d3-color/src/define.js +1 -2
  55. package/dist/ext/d3-format/src/defaultLocale.js +3 -4
  56. package/dist/ext/d3-format/src/formatDecimal.js +1 -2
  57. package/dist/ext/d3-format/src/formatPrefixAuto.js +1 -2
  58. package/dist/ext/d3-format/src/formatRounded.js +1 -2
  59. package/dist/ext/d3-format/src/formatSpecifier.js +1 -2
  60. package/dist/ext/d3-format/src/formatTrim.js +13 -15
  61. package/dist/ext/d3-interpolate/src/array.js +3 -6
  62. package/dist/ext/d3-interpolate/src/numberArray.js +1 -2
  63. package/dist/ext/d3-interpolate/src/object.js +1 -2
  64. package/dist/ext/d3-interpolate/src/string.js +1 -2
  65. package/dist/ext/d3-scale/src/continuous.js +4 -4
  66. package/dist/ext/unist-util-is/lib/index.js +2 -4
  67. package/dist/locale/de/messages.d.ts.map +1 -1
  68. package/dist/locale/de/messages.js +1 -4
  69. package/dist/locale/en/messages.d.ts.map +1 -1
  70. package/dist/locale/en/messages.js +1 -4
  71. package/dist/locale/es/messages.d.ts.map +1 -1
  72. package/dist/locale/es/messages.js +1 -4
  73. package/dist/locale/ru/messages.d.ts.map +1 -1
  74. package/dist/locale/ru/messages.js +1 -4
  75. package/dist/readonly-controls/Display/index.js +4 -4
  76. package/dist/readonly-controls/Group/index.d.ts.map +1 -1
  77. package/dist/readonly-controls/Group/index.js +25 -27
  78. package/dist/readonly-controls/ImageAnnotation/index.d.ts +4 -0
  79. package/dist/readonly-controls/ImageAnnotation/index.d.ts.map +1 -0
  80. package/dist/readonly-controls/ImageAnnotation/index.js +45 -0
  81. package/dist/readonly-controls/MarkdownRender/index.d.ts.map +1 -1
  82. package/dist/readonly-controls/MarkdownRender/index.js +51 -41
  83. package/dist/readonly-controls/index.d.ts +1 -1
  84. package/dist/readonly-controls/index.d.ts.map +1 -1
  85. package/dist/readonly-controls/index.js +17 -17
  86. package/dist/readonly-controls/readonly-controls.d.ts.map +1 -1
  87. package/dist/readonly-controls/readonly-controls.js +33 -42
  88. package/dist/services/fhir.js +73 -46
  89. package/dist/services/i18n.js +12 -33
  90. package/dist/style.css +1 -1
  91. package/dist/utils/constants.d.ts +0 -1
  92. package/dist/utils/constants.d.ts.map +1 -1
  93. package/dist/utils/date.js +1 -1
  94. package/dist/utils/fhirpath.d.ts +1 -0
  95. package/dist/utils/fhirpath.d.ts.map +1 -1
  96. package/dist/utils/fhirpath.js +3 -2
  97. package/dist/utils/questionnaire.d.ts +0 -1
  98. package/dist/utils/questionnaire.d.ts.map +1 -1
  99. package/dist/utils/questionnaire.js +17 -23
  100. package/package.json +18 -13
  101. package/src/locale/de/messages.po +39 -48
  102. package/src/locale/de/messages.ts +1 -1
  103. package/src/locale/en/messages.po +39 -48
  104. package/src/locale/en/messages.ts +1 -1
  105. package/src/locale/es/messages.po +39 -48
  106. package/src/locale/es/messages.ts +1 -1
  107. package/src/locale/ru/messages.po +39 -48
  108. package/src/locale/ru/messages.ts +1 -1
  109. package/dist/components/Table/table.scss.js +0 -4
  110. package/dist/containers/App/utils.d.ts +0 -6
  111. package/dist/containers/App/utils.d.ts.map +0 -1
  112. package/dist/controls/GroupWizard/GroupWizardSidebar/GroupWizardSidebar.stories.utils.d.ts +0 -10
  113. package/dist/controls/GroupWizard/GroupWizardSidebar/GroupWizardSidebar.stories.utils.d.ts.map +0 -1
  114. package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.d.ts +0 -9
  115. package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.d.ts.map +0 -1
  116. package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.js +0 -29
  117. package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.d.ts +0 -14
  118. package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.d.ts.map +0 -1
  119. package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.js +0 -94
  120. package/dist/controls/GroupWizard/GroupWizardSidebar/index.d.ts +0 -5
  121. package/dist/controls/GroupWizard/GroupWizardSidebar/index.d.ts.map +0 -1
  122. package/dist/controls/GroupWizard/GroupWizardSidebar/index.js +0 -152
  123. package/dist/controls/GroupWizard/GroupWizardSidebar/styles.d.ts +0 -35
  124. package/dist/controls/GroupWizard/GroupWizardSidebar/styles.d.ts.map +0 -1
  125. package/dist/controls/GroupWizard/GroupWizardSidebar/styles.js +0 -106
  126. package/dist/controls/GroupWizard/GroupWizardSidebar/types.d.ts +0 -21
  127. package/dist/controls/GroupWizard/GroupWizardSidebar/types.d.ts.map +0 -1
  128. package/dist/controls/GroupWizard/GroupWizardSidebar/utils.d.ts +0 -12
  129. package/dist/controls/GroupWizard/GroupWizardSidebar/utils.d.ts.map +0 -1
  130. package/dist/controls/GroupWizard/GroupWizardSidebar/utils.js +0 -99
  131. package/dist/readonly-controls/GroupWizardSidebar/index.d.ts +0 -3
  132. package/dist/readonly-controls/GroupWizardSidebar/index.d.ts.map +0 -1
  133. package/dist/readonly-controls/GroupWizardSidebar/index.js +0 -104
  134. package/dist/utils/constants.js +0 -4
@@ -1,23 +1,22 @@
1
- import { jsxs as me, Fragment as Oe, jsx as b } from "react/jsx-runtime";
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 Te, PlusOutlined as Be } from "@ant-design/icons";
4
- import { Button as oe, Popconfirm as Ge } from "antd";
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 k, useState as j, useCallback as g, useEffect as N, useRef as Z } from "react";
7
- import { useFormContext as je, useWatch as Ke } from "react-hook-form";
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 ze, getDataSource as Ne, getColumnWidth as Xe, getSearchBarColumnType as Ye, isColumnTypeArray as xe, createColumnFilterValue as $e, getGroupSorter as ve, isTableItemMatchesFilter as Ze } from "./utils.js";
15
- function Je() {
16
- const [C, y] = j({}), a = g((l, i, c) => {
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
- ...c,
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 w = m.linkId, h = Ye(m);
30
- return p[w] = h, 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 c = u(i);
36
- return s.isEmpty(c || !xe(l)) ? l : l.map((p) => {
37
- var P;
38
- const m = p.key.toString(), w = c[m];
39
- if (!w)
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 = $e(w), H = C[m], D = h ? (E) => /* @__PURE__ */ b(qe, { ...E, filter: h, onChange: (R, M) => a(R, M, h) }) : void 0, S = !!((P = C[m]) != null && P.value);
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: S,
46
- filteredValue: H ? [m] : [],
47
- onFilter: (E, R) => {
48
- if (!s.isString(E))
44
+ filtered: V,
45
+ filteredValue: C ? [m] : [],
46
+ onFilter: (R, W) => {
47
+ if (!s.isString(R))
49
48
  return !0;
50
- const M = C[E], _ = R[m];
51
- return Ze(_, M);
49
+ const O = F[R], _ = W[m];
50
+ return $e(_, O);
52
51
  }
53
52
  };
54
53
  });
55
- }, [C, u, a])
54
+ }, [F, u, d])
56
55
  };
57
56
  }
58
- function Ue() {
59
- const C = (u) => {
57
+ function Ze() {
58
+ const F = (u) => {
60
59
  const f = u.item || [];
61
- return s.reduce(f, (i, c) => {
62
- if (!c.enableSort)
60
+ return s.reduce(f, (i, a) => {
61
+ if (!a.enableSort)
63
62
  return i;
64
- const p = c.linkId;
63
+ const p = a.linkId;
65
64
  return i[p] = !0, i;
66
65
  }, {});
67
66
  }, y = (u, f) => {
68
- var c, p;
69
- const l = (c = u.defaultSort) == null ? void 0 : c.linkId, i = (p = u.defaultSort) == null ? void 0 : p.sort;
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 = C(f);
74
+ const l = F(f);
76
75
  return s.isEmpty(l || !xe(u)) ? u : u.map((i) => {
77
- const c = i.key.toString();
78
- if (l[c] !== !0)
76
+ const a = i.key.toString();
77
+ if (l[a] !== !0)
79
78
  return i;
80
- const m = ve(f, c), w = y(f, c);
79
+ const m = Ye(f, a), E = y(f, a);
81
80
  return {
82
81
  ...i,
83
82
  sorter: m,
84
- ...w ? {
85
- defaultSortOrder: w
83
+ ...E ? {
84
+ defaultSortOrder: E
86
85
  } : {}
87
86
  };
88
87
  });
89
88
  }, [])
90
89
  };
91
90
  }
92
- function Qe(C) {
91
+ function Je(F) {
93
92
  const {
94
93
  expandableMaxHeight: y,
95
- dataSource: a
96
- } = C, u = 32, f = Z({}), l = Z(null), i = Z(/* @__PURE__ */ new WeakMap()), c = Z(y), [p, m] = j({}), [w, h] = j([]), H = g((t, e) => {
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
- N(() => {
103
- c.current = y;
104
- }, [y]), N(() => {
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 <= c.current + u || m((F) => F[o] === !0 ? F : {
109
- ...F,
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
- N(() => {
123
- const t = new Set(a.map((e) => e.key));
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((W) => {
128
- const F = e[W];
129
- t.has(W) && F !== void 0 ? o[W] = F : r = !0;
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
- }, [a]);
136
- const S = g(() => {
137
- const t = c.current + u, e = {};
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), W = Object.keys(e);
142
- return o.length !== W.length ? e : o.every((Y) => r[Y] === e[Y]) ? r : e;
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
- N(() => {
144
+ z(() => {
146
145
  const t = () => {
147
- S();
146
+ V();
148
147
  };
149
148
  return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
150
- }, [S]);
151
- const V = g((t) => {
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]), X = g(() => {
154
+ }, [u, y, p]), I = g(() => {
156
155
  requestAnimationFrame(() => {
157
- requestAnimationFrame(S);
156
+ requestAnimationFrame(V);
158
157
  });
159
- }, [S]), I = g((t, e) => {
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
- }, []), P = g(() => {
162
- const t = a.map((e) => e.key).filter((e) => V(e));
163
- h((e) => H(e, t) ? e : t);
164
- }, [H, a, V]), E = g(() => {
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
- }, []), R = k(() => a.map((t) => t.key).filter((t) => V(t)), [a, V]), M = R.length > 0, _ = k(() => new Set(w.map(String)), [w]), q = M && R.every((t) => _.has(t)), L = w.length > 0;
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: V,
170
- handleRowHeightRecompute: X,
171
- handleRowExpand: I,
172
- handleRowExpandAll: P,
173
- handleRowCollapseAll: E,
174
- isRowExpanded: w,
175
- hasExpandableRows: M,
176
- isAllExpandableRowsExpanded: q,
177
- hasExpandedRows: L
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 ft(C) {
179
+ function ut(F) {
181
180
  var ue, pe;
182
181
  const {
183
182
  parentPath: y,
184
- questionItem: a,
183
+ questionItem: d,
185
184
  expandableMaxHeight: u = 100,
186
185
  columnAlignment: f
187
- } = C, {
186
+ } = F, {
188
187
  linkId: l,
189
188
  repeats: i,
190
- text: c,
189
+ text: a,
191
190
  hidden: p,
192
191
  item: m
193
- } = a, w = c || l, h = k(() => [...y, l], [y, l]), H = Le(a), D = (ue = a.enableChart) == null ? void 0 : ue.linkIdX, S = (pe = a.enableChart) == null ? void 0 : pe.linkIdY, V = ze(a), X = a.chartHighlight, {
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, a), {
196
- control: P,
197
- getValues: E,
194
+ } = _e(h, d), {
195
+ control: N,
196
+ getValues: w,
198
197
  reset: R
199
- } = je(), [M, _] = j(!D && !S), [q, L] = j(!1), [t, e] = j(void 0), [r, o] = j(null), [W, F] = j(null), {
200
- populateColumnWithFilters: Y
201
- } = Je(), {
202
- populateColumnWithSorters: Ee
203
- } = Ue(), we = Ke({
204
- control: P
205
- }), O = s.get(we, h), K = k(() => m == null ? void 0 : m.filter((n) => !n.hidden && n.type !== "display"), [m]), T = k(() => (O == null ? void 0 : O.items) || [], [O]), $ = k(() => s.map(K, (n) => n.linkId), [K]), B = k(() => Ne($, T, a), [$, T, a]), {
206
- observeRow: Re,
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: ye,
211
- handleRowCollapseAll: be,
209
+ handleRowExpandAll: Re,
210
+ handleRowCollapseAll: ye,
212
211
  isRowExpanded: U,
213
- hasExpandableRows: Se,
214
- isAllExpandableRowsExpanded: Fe,
215
- hasExpandedRows: ke
216
- } = Qe({
212
+ hasExpandableRows: be,
213
+ isAllExpandableRowsExpanded: Se,
214
+ hasExpandedRows: Fe
215
+ } = Je({
217
216
  expandableMaxHeight: u,
218
- dataSource: B
217
+ dataSource: G
219
218
  }), ae = g((n) => {
220
- o(s.cloneDeep(O)), F(s.cloneDeep(B)), e(n);
221
- }, [B, O]), z = g((n) => {
222
- ae(n), L(!0);
223
- }, [ae]), Ce = g(() => {
224
- const n = s.cloneDeep(E());
225
- s.set(n, h, s.cloneDeep(r)), R(n, {
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(r) ?? void 0), o(null), F(null), e(void 0), L(!1);
228
- }, [h, E, I, R, r]), Ie = g(() => {
229
- o(null), F(null);
230
- const n = E();
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
- }), L(!1), le();
234
- }, [E, le, R]), Ae = (n) => [...n, {}].map(Pe), He = g(() => {
235
- if (B.length === 0 && T.length !== 0)
236
- z(0);
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 = Ae(T), x = {
239
- ...O,
237
+ const n = Ie(j), x = {
238
+ ...T,
240
239
  items: n
241
- }, d = s.cloneDeep(E());
242
- s.set(d, h, s.cloneDeep(n)), I(x), z(T.length);
240
+ }, c = s.cloneDeep(w());
241
+ s.set(c, h, s.cloneDeep(n)), I(x), L(j.length);
243
242
  }
244
- }, [B, T, z, O, E, h, I]), v = g((n) => {
245
- const x = s.cloneDeep(E()), d = s.get(x, h) ?? {}, A = s.isArray(d.items) ? d.items : [], G = s.filter(A, (ee, te) => te !== n), Q = {
246
- ...d,
247
- items: [...G]
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, E, I, R]);
253
- N(() => {
254
- B.length === 0 && T.length === 1 && !q && v(0);
255
- }, [B.length, T.length, v, q]);
256
- const De = (n) => {
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(K, (d) => {
267
- const A = d.linkId, G = d.type === "text";
265
+ const n = s.map(q, (c) => {
266
+ const A = c.linkId, K = c.type === "text";
268
267
  return {
269
- title: d.text ? d.text : "",
268
+ title: c.text ? c.text : "",
270
269
  dataIndex: A,
271
270
  key: A,
272
- align: f ? typeof f == "function" ? f(d) : f : De(d),
273
- width: Xe(d),
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(Oe, { children: [
277
- /* @__PURE__ */ b(se.ReadonlyItemWrapper, { $maxHeight: G ? u : void 0, $notFitsMaxHeight: he, children: /* @__PURE__ */ b("div", { ref: G ? Re(ne) : void 0, children: /* @__PURE__ */ b(ge, { formItem: ee.formItem, questionnaireItem: ee.questionnaireItem }) }) }),
278
- /* @__PURE__ */ b(se.ExpandButton, { $isExpanded: fe, children: G && he && /* @__PURE__ */ b(oe, { icon: fe ? /* @__PURE__ */ b(Te, {}) : /* @__PURE__ */ b(Be, {}) }) })
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 = Ee(n, a);
283
- return Y(x, a);
284
- })(), Ve = k(() => {
285
- const n = K == null ? void 0 : K.find((d) => d.type === "text"), x = n == null ? void 0 : n.linkId;
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: (d) => J(d.key),
287
+ rowExpandable: (c) => J(c.key),
289
288
  expandedRowKeys: U,
290
- expandedRowRender: (d) => {
291
- var A, G;
292
- return /* @__PURE__ */ b(ge, { formItem: (A = d[x]) == null ? void 0 : A.formItem, questionnaireItem: (G = d[x]) == null ? void 0 : G.questionnaireItem });
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: (d, A) => ie(d, A.key),
293
+ onExpand: (c, A) => ie(c, A.key),
295
294
  showExpandColumn: !1,
296
295
  expandRowByClick: !0
297
296
  };
298
- }, [U, ie, J, K]), de = k(() => ({
297
+ }, [U, ie, J, q]), de = S(() => ({
299
298
  title: "Actions",
300
- dataIndex: $[0] ?? "id",
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(), z(n == null ? void 0 : n.index);
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
- H ? null : /* @__PURE__ */ b(Ge, { title: re._(
311
+ /* @__PURE__ */ b(je, { title: re._(
313
312
  /*i18n*/
314
313
  {
315
314
  id: "XtpCjZ"
316
315
  }
317
- ), onConfirm: () => v(n.index), children: /* @__PURE__ */ b(oe, { type: "link", danger: !0, onClick: (x) => x.stopPropagation(), children: re._(
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
- }), [$, z, v, H]), Me = k(() => [...ce, de], [de, ce]), We = k(() => {
325
- if (!(!D || !S))
323
+ }), [Y, L, $]), Ve = S(() => [...ce, de], [de, ce]), Me = S(() => {
324
+ if (!(!C || !D))
326
325
  return (n) => {
327
- _(n);
326
+ O(n);
328
327
  };
329
- }, [D, S]);
328
+ }, [C, D]);
330
329
  return {
331
330
  repeats: i,
332
331
  hidden: p,
333
- title: w,
334
- hideAddButton: H,
332
+ title: E,
335
333
  handleAdd: He,
336
- dataSource: B,
337
- columns: Me,
338
- expandable: Ve,
339
- isModalVisible: q,
340
- editIndex: t,
341
- handleCancel: Ce,
342
- handleSave: Ie,
343
- snapshotDataSource: W,
344
- renderAsTable: M,
345
- handleRenderTypeToggle: We,
346
- handleRowExpandAll: ye,
347
- handleRowCollapseAll: be,
348
- hasExpandableRows: Se,
349
- isAllExpandableRowsExpanded: Fe,
350
- hasExpandedRows: ke,
351
- chartLinkIdX: D,
352
- chartLinkIdY: S,
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: X
352
+ chartHighlightAreas: M
355
353
  };
356
354
  }
357
355
  export {
358
- ft as useGroupTable,
359
- Je as useGroupTableFilter,
360
- Ue as useGroupTableSorter,
361
- Qe as useRowExpandability
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,kDAwGhD"}
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"}