@beda.software/web-item-controls 0.1.6 → 0.1.14-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +0 -12
  2. package/dist/components/BaseQuestionnaireResponseForm/hooks.d.ts +4 -4
  3. package/dist/components/BaseQuestionnaireResponseForm/hooks.d.ts.map +1 -1
  4. package/dist/components/BaseQuestionnaireResponseForm/hooks.js +28 -56
  5. package/dist/components/BaseQuestionnaireResponseForm/utils.d.ts.map +1 -1
  6. package/dist/components/BaseQuestionnaireResponseForm/utils.js +12 -3
  7. package/dist/components/FormWrapper/index.d.ts +4 -3
  8. package/dist/components/FormWrapper/index.d.ts.map +1 -1
  9. package/dist/components/SearchBar/SearchBarMobile/index.js +36 -0
  10. package/dist/components/SearchBar/SearchBarMobile/styles.js +49 -37
  11. package/dist/components/SearchBar/hooks.js +70 -0
  12. package/dist/components/SearchBar/index.js +27 -0
  13. package/dist/components/SearchBar/styles.js +23 -16
  14. package/dist/components/SearchBar/utils.js +10 -0
  15. package/dist/components/SearchBar/validate.js +46 -0
  16. package/dist/components/Table/TableCards/index.js +60 -0
  17. package/dist/components/Table/TableCards/styles.js +43 -31
  18. package/dist/components/Table/index.js +17 -0
  19. package/dist/components/Table/styles.js +18 -12
  20. package/dist/components/index.d.ts +10 -0
  21. package/dist/components/index.d.ts.map +1 -0
  22. package/dist/components/index.js +26 -0
  23. package/dist/controls/Boolean/index.js +10 -10
  24. package/dist/controls/Display/index.js +6 -5
  25. package/dist/controls/EditableGroup/hooks.js +5 -5
  26. package/dist/controls/GroupTable/RenderFormItemReadOnly/index.js +6 -5
  27. package/dist/controls/GroupTable/hooks.js +13 -13
  28. package/dist/controls/GroupTable/index.d.ts +3 -0
  29. package/dist/controls/GroupTable/index.d.ts.map +1 -1
  30. package/dist/controls/GroupTable/index.js +28 -25
  31. package/dist/controls/InsideText/index.js +10 -10
  32. package/dist/controls/Number/index.js +37 -37
  33. package/dist/controls/PasswordInput/index.d.ts.map +1 -1
  34. package/dist/controls/PasswordInput/index.js +12 -12
  35. package/dist/controls/Reference/index.d.ts +3 -3
  36. package/dist/controls/Reference/index.d.ts.map +1 -1
  37. package/dist/controls/String/index.d.ts.map +1 -1
  38. package/dist/controls/String/index.js +31 -31
  39. package/dist/controls/controls.d.ts +6 -0
  40. package/dist/controls/controls.d.ts.map +1 -0
  41. package/dist/controls/controls.js +137 -0
  42. package/dist/controls/index.d.ts +2 -1
  43. package/dist/controls/index.d.ts.map +1 -1
  44. package/dist/controls/index.js +83 -71
  45. package/dist/readonly-controls/Display/index.js +6 -5
  46. package/dist/readonly-controls/index.d.ts +1 -0
  47. package/dist/readonly-controls/index.d.ts.map +1 -1
  48. package/dist/readonly-controls/index.js +41 -36
  49. package/dist/readonly-controls/readonly-controls.d.ts +6 -0
  50. package/dist/readonly-controls/readonly-controls.d.ts.map +1 -0
  51. package/dist/readonly-controls/readonly-controls.js +57 -0
  52. package/dist/style.css +1 -1
  53. package/dist/theme/palette.d.ts +2 -2
  54. package/dist/utils/theme.d.ts +1 -1
  55. package/package.json +48 -38
  56. package/src/locale/de/messages.po +6 -6
  57. package/src/locale/en/messages.po +6 -6
  58. package/src/locale/es/messages.po +6 -6
  59. package/src/locale/ru/messages.po +6 -6
  60. package/dist/components/BaseQuestionnaireResponseForm/controls.d.ts +0 -6
  61. package/dist/components/BaseQuestionnaireResponseForm/controls.d.ts.map +0 -1
@@ -1,33 +1,45 @@
1
1
  import n from "styled-components";
2
2
  import { Text as a } from "../../Typography.js";
3
- n.div.withConfig({
4
- displayName: "TableCards__Container",
5
- componentId: "sc-1dntn1w-0"
6
- })(["display:flex;flex-direction:column;gap:10px 0;color:", ";"], ({
7
- theme: e
8
- }) => e.neutral.primaryText), n.div.withConfig({
9
- displayName: "TableCards__Card",
10
- componentId: "sc-1dntn1w-1"
11
- })(["display:flex;gap:0 24px;padding:16px;border:1px solid ", ";border-radius:6px;background-color:", ";"], ({
12
- theme: e
13
- }) => e.neutralPalette.gray_4, ({
14
- theme: e
15
- }) => e.neutralPalette.gray_1), n.div.withConfig({
16
- displayName: "TableCards__Columns",
17
- componentId: "sc-1dntn1w-2"
18
- })(["flex:1;display:flex;flex-direction:column;gap:16px 0;"]), n.div.withConfig({
19
- displayName: "TableCards__RowSelection",
20
- componentId: "sc-1dntn1w-3"
21
- })([""]), n.div.withConfig({
22
- displayName: "TableCards__Column",
23
- componentId: "sc-1dntn1w-4"
24
- })(["display:flex;flex-direction:column;gap:4px 0;"]), n(a).withConfig({
25
- displayName: "TableCards__Title",
26
- componentId: "sc-1dntn1w-5"
27
- })(["font-weight:700;"]), n.div.withConfig({
28
- displayName: "TableCards__Content",
29
- componentId: "sc-1dntn1w-6"
30
- })([""]), n.div.withConfig({
31
- displayName: "TableCards__Pagination",
32
- componentId: "sc-1dntn1w-7"
33
- })(["display:flex;justify-content:flex-end;"]);
3
+ const d = {
4
+ Container: n.div.withConfig({
5
+ displayName: "TableCards__Container",
6
+ componentId: "sc-1dntn1w-0"
7
+ })(["display:flex;flex-direction:column;gap:10px 0;color:", ";"], ({
8
+ theme: e
9
+ }) => e.neutral.primaryText),
10
+ Card: n.div.withConfig({
11
+ displayName: "TableCards__Card",
12
+ componentId: "sc-1dntn1w-1"
13
+ })(["display:flex;gap:0 24px;padding:16px;border:1px solid ", ";border-radius:6px;background-color:", ";"], ({
14
+ theme: e
15
+ }) => e.neutralPalette.gray_4, ({
16
+ theme: e
17
+ }) => e.neutralPalette.gray_1),
18
+ Columns: n.div.withConfig({
19
+ displayName: "TableCards__Columns",
20
+ componentId: "sc-1dntn1w-2"
21
+ })(["flex:1;display:flex;flex-direction:column;gap:16px 0;"]),
22
+ RowSelection: n.div.withConfig({
23
+ displayName: "TableCards__RowSelection",
24
+ componentId: "sc-1dntn1w-3"
25
+ })([""]),
26
+ Column: n.div.withConfig({
27
+ displayName: "TableCards__Column",
28
+ componentId: "sc-1dntn1w-4"
29
+ })(["display:flex;flex-direction:column;gap:4px 0;"]),
30
+ Title: n(a).withConfig({
31
+ displayName: "TableCards__Title",
32
+ componentId: "sc-1dntn1w-5"
33
+ })(["font-weight:700;"]),
34
+ Content: n.div.withConfig({
35
+ displayName: "TableCards__Content",
36
+ componentId: "sc-1dntn1w-6"
37
+ })([""]),
38
+ Pagination: n.div.withConfig({
39
+ displayName: "TableCards__Pagination",
40
+ componentId: "sc-1dntn1w-7"
41
+ })(["display:flex;justify-content:flex-end;"])
42
+ };
43
+ export {
44
+ d as S
45
+ };
@@ -0,0 +1,17 @@
1
+ import { jsxs as a, Fragment as d, jsx as r } from "react/jsx-runtime";
2
+ import { Table as l } from "antd";
3
+ import { S as i } from "./styles.js";
4
+ import { TableCards as s } from "./TableCards/index.js";
5
+ import "./table.scss.js";
6
+ function c(e) {
7
+ const {
8
+ showCardsOnMobile: o = !0
9
+ } = e;
10
+ return /* @__PURE__ */ a(d, { children: [
11
+ /* @__PURE__ */ r(i.Table, { $showCardsOnMobile: o, children: /* @__PURE__ */ r(l, { bordered: !0, size: "middle", ...e }) }),
12
+ /* @__PURE__ */ r(i.Cards, { $showCardsOnMobile: o, children: /* @__PURE__ */ r(s, { ...e }) })
13
+ ] });
14
+ }
15
+ export {
16
+ c as Table
17
+ };
@@ -1,13 +1,19 @@
1
1
  import d, { css as e } from "styled-components";
2
- import { mobileWidth as a } from "../../theme/utils.js";
3
- d.div.withConfig({
4
- displayName: "Table",
5
- componentId: "sc-9du5mi-0"
6
- })(["overflow:auto;", ""], ({
7
- $showCardsOnMobile: i
8
- }) => i && e(["@media screen and (max-width:", "){display:none;}"], () => `${a - 1}px`)), d.div.withConfig({
9
- displayName: "Table__Cards",
10
- componentId: "sc-9du5mi-1"
11
- })(["", ""], ({
12
- $showCardsOnMobile: i
13
- }) => i && e(["@media screen and (min-width:", "){display:none;}"], () => `${a}px`));
2
+ import { mobileWidth as o } from "../../theme/utils.js";
3
+ const m = {
4
+ Table: d.div.withConfig({
5
+ displayName: "Table",
6
+ componentId: "sc-9du5mi-0"
7
+ })(["overflow:auto;", ""], ({
8
+ $showCardsOnMobile: i
9
+ }) => i && e(["@media screen and (max-width:", "){display:none;}"], () => `${o - 1}px`)),
10
+ Cards: d.div.withConfig({
11
+ displayName: "Table__Cards",
12
+ componentId: "sc-9du5mi-1"
13
+ })(["", ""], ({
14
+ $showCardsOnMobile: i
15
+ }) => i && e(["@media screen and (min-width:", "){display:none;}"], () => `${o}px`))
16
+ };
17
+ export {
18
+ m as S
19
+ };
@@ -0,0 +1,10 @@
1
+ export * from './DatePicker';
2
+ export * from './Modal';
3
+ export * from './SearchBar';
4
+ export * from './SearchBar/hooks';
5
+ export * from './Select';
6
+ export * from './Spinner';
7
+ export * from './Table';
8
+ export * from './TimePicker';
9
+ export * from './Typography';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { DatePicker as o } from "./DatePicker/index.js";
2
+ import { Modal as a } from "./Modal/index.js";
3
+ import { SearchBar as m } from "./SearchBar/index.js";
4
+ import { useSearchBar as x } from "./SearchBar/hooks.js";
5
+ import { AsyncSelect as f, Select as n } from "./Select/index.js";
6
+ import { SpinIndicator as l, Spinner as T } from "./Spinner/index.js";
7
+ import { Table as P } from "./Table/index.js";
8
+ import { RangeTimePicker as d, TimePicker as g } from "./TimePicker/index.js";
9
+ import { Link as B, Paragraph as b, Text as u, Title as y } from "./Typography.js";
10
+ export {
11
+ f as AsyncSelect,
12
+ o as DatePicker,
13
+ B as Link,
14
+ a as Modal,
15
+ b as Paragraph,
16
+ d as RangeTimePicker,
17
+ m as SearchBar,
18
+ n as Select,
19
+ l as SpinIndicator,
20
+ T as Spinner,
21
+ P as Table,
22
+ u as Text,
23
+ g as TimePicker,
24
+ y as Title,
25
+ x as useSearchBar
26
+ };
@@ -1,23 +1,23 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { Form as h, Checkbox as u } from "antd";
2
+ import { Form as u, Checkbox as k } from "antd";
3
3
  import { useFieldController as p } from "../../components/BaseQuestionnaireResponseForm/hooks.js";
4
4
  import { S as b } from "./styles.js";
5
- function C({
5
+ function g({
6
6
  parentPath: a,
7
7
  questionItem: o
8
8
  }) {
9
9
  const {
10
10
  linkId: r,
11
- text: l
12
- } = o, n = [...a, r, 0, "value", "boolean"], {
13
- value: i,
14
- onChange: d,
11
+ text: n
12
+ } = o, l = [...a, r, 0, "value", "boolean"], {
13
+ value: d,
14
+ onChange: i,
15
15
  disabled: c,
16
16
  formItem: t,
17
- onBlur: m
18
- } = p(n, o), s = t.validateStatus === "error";
19
- return /* @__PURE__ */ e(h.Item, { ...t, valuePropName: "checked", "data-testid": "question-boolean", "data-linkid": r, label: void 0, children: /* @__PURE__ */ e(b.CheckboxWrapper, { $hasError: s, children: /* @__PURE__ */ e(u, { disabled: c, onChange: d, checked: i, "data-testid": "checkbox", onBlur: m, children: l }) }) });
17
+ onBlur: h
18
+ } = p(l, o), m = t.validateStatus === "error";
19
+ return /* @__PURE__ */ e(u.Item, { ...t, valuePropName: "checked", "data-testid": "question-boolean", "data-linkid": r, label: void 0, children: /* @__PURE__ */ e(b.CheckboxWrapper, { $hasError: m, children: /* @__PURE__ */ e(k, { disabled: c, onChange: (s) => i(s.target.checked), checked: d, "data-testid": "checkbox", onBlur: h, children: n }) }) });
20
20
  }
21
21
  export {
22
- C as QuestionBoolean
22
+ g as QuestionBoolean
23
23
  };
@@ -10,9 +10,7 @@ import "@beda.software/fhir-react";
10
10
  import "../../components/AudioRecorder/styles.js";
11
11
  import "react";
12
12
  import "@beda.software/remote-data";
13
- import "lodash";
14
- import "react-hook-form";
15
- import "sdc-qrf";
13
+ import "@beda.software/fhir-questionnaire";
16
14
  import "../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.module.scss.js";
17
15
  import "../Group/context.js";
18
16
  import "../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.styles.js";
@@ -21,13 +19,16 @@ import "../../services/fhir.js";
21
19
  import "../../readonly-controls/ReadonlyWidgets.module.scss.js";
22
20
  import "../../readonly-controls/ReadonlyWidgets.styles.js";
23
21
  import "@lingui/core";
22
+ import "lodash";
24
23
  import "yup";
24
+ import "sdc-qrf";
25
25
  import "fhirpath";
26
26
  import "../../utils/yup-locale.js";
27
27
  import { S as d } from "./styles.js";
28
28
  import "antd/es/layout/layout";
29
29
  import "styled-components";
30
30
  import "antd/es/layout/Sider";
31
+ import "react-hook-form";
31
32
  import "../../components/Wizard/styles.js";
32
33
  import "../GroupWizard/index.js";
33
34
  import "../../readonly-controls/GroupWizard/styles.js";
@@ -37,7 +38,7 @@ import "react-select/async";
37
38
  import "../../components/Select/styles.js";
38
39
  import "fhirpath/fhir-context/r4";
39
40
  import "../../sharedState/index.js";
40
- function C({
41
+ function rr({
41
42
  questionItem: m
42
43
  }) {
43
44
  var p, e;
@@ -63,6 +64,6 @@ const a = ({
63
64
  return t == null ? void 0 : t.map((r, o) => r.startsWith("http://") || r.startsWith("https://") ? /* @__PURE__ */ i("a", { href: r, target: "_blank", rel: "noreferrer", children: r }, o) : /* @__PURE__ */ i("span", { children: r }, o));
64
65
  };
65
66
  export {
66
- C as Display,
67
+ rr as Display,
67
68
  a as TextWithLink
68
69
  };
@@ -21,9 +21,9 @@ function Q(V) {
21
21
  control: O,
22
22
  getValues: l,
23
23
  reset: a
24
- } = _(), [E, m] = I(!1), [u, p] = I(null), [R, f] = I(null), W = z({
24
+ } = _(), [v, m] = I(!1), [u, p] = I(null), [E, f] = I(null), R = z({
25
25
  control: O
26
- }), o = t.get(W, r), h = i(() => s == null ? void 0 : s.filter((e) => !e.hidden && e.type !== "display"), [s]), j = i(() => o != null && o.items ? [o.items] : [], [o]), v = i(() => t.map(h, (e) => e.linkId), [h]), F = H(v, j, n), S = c(() => {
26
+ }), o = t.get(R, r), h = i(() => s == null ? void 0 : s.filter((e) => !e.hidden && e.type !== "display"), [s]), W = i(() => o != null && o.items ? [o.items] : [], [o]), j = i(() => t.map(h, (e) => e.linkId), [h]), F = H(j, W, n), S = c(() => {
27
27
  p(t.cloneDeep(o)), f(t.cloneDeep(F));
28
28
  }, [F, o]), w = c(() => {
29
29
  S(), m(!0);
@@ -32,7 +32,7 @@ function Q(V) {
32
32
  t.set(e, r, t.cloneDeep(u)), a(e, {
33
33
  keepDirty: !0
34
34
  }), y({
35
- items: u
35
+ items: u ?? void 0
36
36
  }), p(null), f(null), m(!1);
37
37
  }, [r, l, y, a, u]), N = c(() => {
38
38
  p(null), f(null);
@@ -54,11 +54,11 @@ function Q(V) {
54
54
  title: q,
55
55
  dataSource: F,
56
56
  dataColumns: P,
57
- isModalVisible: E,
57
+ isModalVisible: v,
58
58
  handleCancel: G,
59
59
  handleUpdate: w,
60
60
  handleSave: N,
61
- snapshotDataSource: R
61
+ snapshotDataSource: E
62
62
  };
63
63
  }
64
64
  export {
@@ -8,9 +8,7 @@ import "@beda.software/fhir-react";
8
8
  import "../../../components/AudioRecorder/styles.js";
9
9
  import "react";
10
10
  import "@beda.software/remote-data";
11
- import "lodash";
12
- import "react-hook-form";
13
- import "sdc-qrf";
11
+ import "@beda.software/fhir-questionnaire";
14
12
  import "../../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.module.scss.js";
15
13
  import "../../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.styles.js";
16
14
  import "../../Group/context.js";
@@ -19,13 +17,16 @@ import "../../../services/fhir.js";
19
17
  import "../../../readonly-controls/ReadonlyWidgets.module.scss.js";
20
18
  import "../../../readonly-controls/ReadonlyWidgets.styles.js";
21
19
  import "@lingui/core";
20
+ import "lodash";
22
21
  import "yup";
22
+ import "sdc-qrf";
23
23
  import "fhirpath";
24
24
  import "../../../utils/yup-locale.js";
25
25
  import "../../Display/styles.js";
26
26
  import "antd/es/layout/layout";
27
27
  import "styled-components";
28
28
  import "antd/es/layout/Sider";
29
+ import "react-hook-form";
29
30
  import "../../../components/Wizard/styles.js";
30
31
  import "../../GroupWizard/index.js";
31
32
  import "../../../readonly-controls/GroupWizard/styles.js";
@@ -37,7 +38,7 @@ import "fhirpath/fhir-context/r4";
37
38
  import "../../../sharedState/index.js";
38
39
  import { useRenderFormItemReadOnly as h } from "./hooks.js";
39
40
  import { S as i } from "./styles.js";
40
- const Z = (p) => {
41
+ const _ = (p) => {
41
42
  const {
42
43
  rows: m,
43
44
  emptySymbol: e
@@ -51,5 +52,5 @@ const Z = (p) => {
51
52
  }) });
52
53
  };
53
54
  export {
54
- Z as RenderFormItemReadOnly
55
+ _ as RenderFormItemReadOnly
55
56
  };
@@ -3,7 +3,7 @@ import { i18n as re } from "@lingui/core";
3
3
  import { MinusOutlined as Oe, PlusOutlined as Te } from "@ant-design/icons";
4
4
  import { Button as oe, Popconfirm as je } from "antd";
5
5
  import s from "lodash";
6
- import { useMemo as S, useState as P, useCallback as g, useEffect as z, useRef as Z } from "react";
6
+ import { useMemo as S, useState as P, useCallback as g, useEffect as z, useRef as v } from "react";
7
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";
@@ -11,7 +11,7 @@ import { TableFilter as qe } from "../../components/Table/TableFilter/index.js";
11
11
  import { RenderFormItemReadOnly as ge } from "./RenderFormItemReadOnly/index.js";
12
12
  import { S as se } from "./styles.js";
13
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 Ze() {
14
+ function ve() {
15
15
  const [F, y] = P({}), d = g((l, i, a) => {
16
16
  y((p) => l && !s.isEmpty(l) ? {
17
17
  ...p,
@@ -54,7 +54,7 @@ function Ze() {
54
54
  }, [F, u, d])
55
55
  };
56
56
  }
57
- function ve() {
57
+ function Ze() {
58
58
  const F = (u) => {
59
59
  const f = u.item || [];
60
60
  return s.reduce(f, (i, a) => {
@@ -92,7 +92,7 @@ function Je(F) {
92
92
  const {
93
93
  expandableMaxHeight: y,
94
94
  dataSource: d
95
- } = F, u = 32, f = Z({}), l = Z(null), i = Z(/* @__PURE__ */ new WeakMap()), a = Z(y), [p, m] = P({}), [E, h] = P([]), C = g((t, e) => {
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) => {
96
96
  if (t.length !== e.length)
97
97
  return !1;
98
98
  const r = new Set(e.map(String));
@@ -162,7 +162,7 @@ function Je(F) {
162
162
  h((e) => C(e, t) ? e : t);
163
163
  }, [C, d, M]), R = g(() => {
164
164
  h((t) => t.length === 0 ? t : []);
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)), v = E.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;
166
166
  return {
167
167
  observeRow: V,
168
168
  rowHeightExceedsMaxHeight: M,
@@ -173,7 +173,7 @@ function Je(F) {
173
173
  isRowExpanded: E,
174
174
  hasExpandableRows: O,
175
175
  isAllExpandableRowsExpanded: B,
176
- hasExpandedRows: v
176
+ hasExpandedRows: Z
177
177
  };
178
178
  }
179
179
  function ut(F) {
@@ -195,11 +195,11 @@ function ut(F) {
195
195
  control: N,
196
196
  getValues: w,
197
197
  reset: R
198
- } = Ge(), [W, O] = P(!C && !V), [_, B] = P(!1), [v, t] = P(void 0), [e, r] = P(null), [o, k] = P(null), {
198
+ } = Ge(), [W, O] = P(!C && !V), [_, B] = P(!1), [Z, t] = P(void 0), [e, r] = P(null), [o, k] = P(null), {
199
199
  populateColumnWithFilters: H
200
- } = Ze(), {
200
+ } = ve(), {
201
201
  populateColumnWithSorters: X
202
- } = ve(), Ee = Ke({
202
+ } = Ze(), Ee = Ke({
203
203
  control: N
204
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
205
  observeRow: we,
@@ -224,7 +224,7 @@ function ut(F) {
224
224
  s.set(n, h, s.cloneDeep(e)), R(n, {
225
225
  keepDirty: !0
226
226
  }), I({
227
- items: e
227
+ items: e ?? void 0
228
228
  }), r(null), k(null), t(void 0), B(!1);
229
229
  }, [h, w, I, R, e]), Ce = g(() => {
230
230
  r(null), k(null);
@@ -337,7 +337,7 @@ function ut(F) {
337
337
  columns: De,
338
338
  expandable: Ve,
339
339
  isModalVisible: _,
340
- editIndex: v,
340
+ editIndex: Z,
341
341
  handleCancel: ke,
342
342
  handleSave: Ce,
343
343
  snapshotDataSource: o,
@@ -356,7 +356,7 @@ function ut(F) {
356
356
  }
357
357
  export {
358
358
  ut as useGroupTable,
359
- Ze as useGroupTableFilter,
360
- ve as useGroupTableSorter,
359
+ ve as useGroupTableFilter,
360
+ Ze as useGroupTableSorter,
361
361
  Je as useRowExpandability
362
362
  };
@@ -1,3 +1,6 @@
1
1
  import { GroupTableProps } from './types';
2
+ export type { GroupTableProps, GroupTableRow, GroupTableItem, ChartHighlightArea } from './types';
3
+ export { getValueFromAnswerValue } from './utils';
4
+ export { useGroupTable } from './hooks';
2
5
  export declare function GroupTable(props: GroupTableProps): import("react/jsx-runtime").JSX.Element | null;
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -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,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDAqGhD"}
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,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDAqGhD"}
@@ -1,25 +1,26 @@
1
- import { jsxs as i, Fragment as O, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as l, Fragment as O, jsx as e } from "react/jsx-runtime";
2
2
  import { i18n as r } from "@lingui/core";
3
- import { ExpandAltOutlined as j, PlusOutlined as z } from "@ant-design/icons";
4
- import { Flex as L, Typography as s, Space as m, Switch as M, Button as u, Table as P, Alert as g } from "antd";
5
- import { ModalQuestionnaireGroupItem as Y } from "../../components/ModalQuestionnaireGroupItem/index.js";
6
- import { useGroupTable as q } from "./hooks.js";
7
- import { GroupTableChart as F } from "./GroupTableChart/index.js";
3
+ import { ExpandAltOutlined as V, PlusOutlined as j } from "@ant-design/icons";
4
+ import { Flex as z, Typography as s, Space as m, Switch as F, Button as u, Table as L, Alert as g } from "antd";
5
+ import { ModalQuestionnaireGroupItem as M } from "../../components/ModalQuestionnaireGroupItem/index.js";
6
+ import { useGroupTable as P } from "./hooks.js";
7
+ import { GroupTableChart as Y } from "./GroupTableChart/index.js";
8
8
  import { S as x } from "./styles.js";
9
+ import { getValueFromAnswerValue as Z } from "./utils.js";
9
10
  function J(a) {
10
11
  const {
11
- chartHeight: y
12
+ chartHeight: f
12
13
  } = a, {
13
- repeats: b,
14
- hidden: f,
15
- title: l,
14
+ repeats: y,
15
+ hidden: b,
16
+ title: i,
16
17
  handleAdd: T,
17
18
  dataSource: n,
18
19
  columns: A,
19
20
  expandable: k,
20
- isModalVisible: I,
21
- editIndex: S,
22
- handleCancel: w,
21
+ isModalVisible: w,
22
+ editIndex: I,
23
+ handleCancel: S,
23
24
  handleSave: C,
24
25
  snapshotDataSource: t,
25
26
  renderAsTable: d,
@@ -32,13 +33,13 @@ function J(a) {
32
33
  chartLinkIdY: p,
33
34
  chartYRange: G,
34
35
  chartHighlightAreas: v
35
- } = q(a);
36
- return f ? null : /* @__PURE__ */ i(O, { children: [
37
- /* @__PURE__ */ i(L, { justify: "space-between", children: [
38
- /* @__PURE__ */ e(s.Title, { level: 4, children: l }),
39
- /* @__PURE__ */ i(m, { size: 16, children: [
40
- o && /* @__PURE__ */ i(m, { size: "small", children: [
41
- /* @__PURE__ */ e(M, { checked: d, onChange: o }),
36
+ } = P(a);
37
+ return b ? null : /* @__PURE__ */ l(O, { children: [
38
+ /* @__PURE__ */ l(z, { justify: "space-between", children: [
39
+ /* @__PURE__ */ e(s.Title, { level: 4, children: i }),
40
+ /* @__PURE__ */ l(m, { size: 16, children: [
41
+ o && /* @__PURE__ */ l(m, { size: "small", children: [
42
+ /* @__PURE__ */ e(F, { checked: d, onChange: o }),
42
43
  /* @__PURE__ */ e(s.Text, { children: r._(
43
44
  /*i18n*/
44
45
  {
@@ -46,7 +47,7 @@ function J(a) {
46
47
  }
47
48
  ) })
48
49
  ] }),
49
- E && /* @__PURE__ */ e(u, { type: "primary", icon: /* @__PURE__ */ e(j, {}), onClick: h ? _ : R, children: h ? r._(
50
+ E && /* @__PURE__ */ e(u, { type: "primary", icon: /* @__PURE__ */ e(V, {}), onClick: h ? _ : R, children: h ? r._(
50
51
  /*i18n*/
51
52
  {
52
53
  id: "qvWGzP"
@@ -57,7 +58,7 @@ function J(a) {
57
58
  id: "OlAl5i"
58
59
  }
59
60
  ) }),
60
- /* @__PURE__ */ e(u, { type: "primary", icon: /* @__PURE__ */ e(z, {}), onClick: T, children: r._(
61
+ /* @__PURE__ */ e(u, { type: "primary", icon: /* @__PURE__ */ e(j, {}), onClick: T, children: r._(
61
62
  /*i18n*/
62
63
  {
63
64
  id: "Rd7v4h"
@@ -65,7 +66,7 @@ function J(a) {
65
66
  ) })
66
67
  ] })
67
68
  ] }),
68
- b ? d ? /* @__PURE__ */ e(x.TableWrapper, { children: /* @__PURE__ */ e(P, { columns: A, dataSource: t ?? n, rowKey: (H) => H.key, pagination: !1, bordered: !0, expandable: k }) }) : c && p ? /* @__PURE__ */ e(x.ChartItem, { $chartHeight: y, children: /* @__PURE__ */ e(F, { dataSource: t ?? n, linkIdX: c, linkIdY: p, chartYRange: G, chartHighlightAreas: v, ...a }) }) : /* @__PURE__ */ e(g, { type: "error", message: r._(
69
+ y ? d ? /* @__PURE__ */ e(x.TableWrapper, { children: /* @__PURE__ */ e(L, { columns: A, dataSource: t ?? n, rowKey: (H) => H.key, pagination: !1, bordered: !0, expandable: k }) }) : c && p ? /* @__PURE__ */ e(x.ChartItem, { $chartHeight: f, children: /* @__PURE__ */ e(Y, { dataSource: t ?? n, linkIdX: c, linkIdY: p, chartYRange: G, chartHighlightAreas: v, ...a }) }) : /* @__PURE__ */ e(g, { type: "error", message: r._(
69
70
  /*i18n*/
70
71
  {
71
72
  id: "hHcMdO"
@@ -76,9 +77,11 @@ function J(a) {
76
77
  id: "VP0gyL"
77
78
  }
78
79
  ) }),
79
- /* @__PURE__ */ e(Y, { open: I, index: S, groupItem: a, title: l, handleCancel: w, handleSave: C })
80
+ /* @__PURE__ */ e(M, { open: w, index: I, groupItem: a, title: i, handleCancel: S, handleSave: C })
80
81
  ] });
81
82
  }
82
83
  export {
83
- J as GroupTable
84
+ J as GroupTable,
85
+ Z as getValueFromAnswerValue,
86
+ P as useGroupTable
84
87
  };
@@ -1,7 +1,7 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { useFieldController as a } from "../../components/BaseQuestionnaireResponseForm/hooks.js";
3
- import p from "./InputInsideText.js";
4
- function m({
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useFieldController as p } from "../../components/BaseQuestionnaireResponseForm/hooks.js";
3
+ import x from "./InputInsideText.js";
4
+ function g({
5
5
  parentPath: t,
6
6
  questionItem: e
7
7
  }) {
@@ -10,12 +10,12 @@ function m({
10
10
  } = e, o = [...t, n, 0, "value", "string"], {
11
11
  value: r,
12
12
  onChange: l,
13
- disabled: i,
14
- onBlur: d,
15
- placeholder: s
16
- } = a(o, e);
17
- return /* @__PURE__ */ u(p, { value: r ?? "", disabled: i, onChange: l, onBlur: d, placeholder: s, text: e.text ?? "" });
13
+ disabled: a,
14
+ onBlur: i,
15
+ placeholder: u
16
+ } = p(o, e);
17
+ return /* @__PURE__ */ s(x, { value: r ?? "", disabled: a, onChange: (d) => l(d.target.value), onBlur: i, placeholder: u, text: e.text ?? "" });
18
18
  }
19
19
  export {
20
- m as QuestionInputInsideText
20
+ g as QuestionInputInsideText
21
21
  };