@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.
- package/README.md +0 -12
- package/dist/components/BaseQuestionnaireResponseForm/hooks.d.ts +4 -4
- package/dist/components/BaseQuestionnaireResponseForm/hooks.d.ts.map +1 -1
- package/dist/components/BaseQuestionnaireResponseForm/hooks.js +28 -56
- package/dist/components/BaseQuestionnaireResponseForm/utils.d.ts.map +1 -1
- package/dist/components/BaseQuestionnaireResponseForm/utils.js +12 -3
- package/dist/components/FormWrapper/index.d.ts +4 -3
- package/dist/components/FormWrapper/index.d.ts.map +1 -1
- package/dist/components/SearchBar/SearchBarMobile/index.js +36 -0
- package/dist/components/SearchBar/SearchBarMobile/styles.js +49 -37
- package/dist/components/SearchBar/hooks.js +70 -0
- package/dist/components/SearchBar/index.js +27 -0
- package/dist/components/SearchBar/styles.js +23 -16
- package/dist/components/SearchBar/utils.js +10 -0
- package/dist/components/SearchBar/validate.js +46 -0
- package/dist/components/Table/TableCards/index.js +60 -0
- package/dist/components/Table/TableCards/styles.js +43 -31
- package/dist/components/Table/index.js +17 -0
- package/dist/components/Table/styles.js +18 -12
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +26 -0
- package/dist/controls/Boolean/index.js +10 -10
- package/dist/controls/Display/index.js +6 -5
- package/dist/controls/EditableGroup/hooks.js +5 -5
- package/dist/controls/GroupTable/RenderFormItemReadOnly/index.js +6 -5
- package/dist/controls/GroupTable/hooks.js +13 -13
- package/dist/controls/GroupTable/index.d.ts +3 -0
- package/dist/controls/GroupTable/index.d.ts.map +1 -1
- package/dist/controls/GroupTable/index.js +28 -25
- package/dist/controls/InsideText/index.js +10 -10
- package/dist/controls/Number/index.js +37 -37
- package/dist/controls/PasswordInput/index.d.ts.map +1 -1
- package/dist/controls/PasswordInput/index.js +12 -12
- package/dist/controls/Reference/index.d.ts +3 -3
- package/dist/controls/Reference/index.d.ts.map +1 -1
- package/dist/controls/String/index.d.ts.map +1 -1
- package/dist/controls/String/index.js +31 -31
- package/dist/controls/controls.d.ts +6 -0
- package/dist/controls/controls.d.ts.map +1 -0
- package/dist/controls/controls.js +137 -0
- package/dist/controls/index.d.ts +2 -1
- package/dist/controls/index.d.ts.map +1 -1
- package/dist/controls/index.js +83 -71
- package/dist/readonly-controls/Display/index.js +6 -5
- package/dist/readonly-controls/index.d.ts +1 -0
- package/dist/readonly-controls/index.d.ts.map +1 -1
- package/dist/readonly-controls/index.js +41 -36
- package/dist/readonly-controls/readonly-controls.d.ts +6 -0
- package/dist/readonly-controls/readonly-controls.d.ts.map +1 -0
- package/dist/readonly-controls/readonly-controls.js +57 -0
- package/dist/style.css +1 -1
- package/dist/theme/palette.d.ts +2 -2
- package/dist/utils/theme.d.ts +1 -1
- package/package.json +48 -38
- package/src/locale/de/messages.po +6 -6
- package/src/locale/en/messages.po +6 -6
- package/src/locale/es/messages.po +6 -6
- package/src/locale/ru/messages.po +6 -6
- package/dist/components/BaseQuestionnaireResponseForm/controls.d.ts +0 -6
- 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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
}) => e.neutralPalette.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})([""]),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})(["
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
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
|
|
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
|
|
5
|
+
function g({
|
|
6
6
|
parentPath: a,
|
|
7
7
|
questionItem: o
|
|
8
8
|
}) {
|
|
9
9
|
const {
|
|
10
10
|
linkId: r,
|
|
11
|
-
text:
|
|
12
|
-
} = o,
|
|
13
|
-
value:
|
|
14
|
-
onChange:
|
|
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:
|
|
18
|
-
} = p(
|
|
19
|
-
return /* @__PURE__ */ e(
|
|
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
|
-
|
|
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 "
|
|
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
|
|
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
|
-
|
|
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
|
-
} = _(), [
|
|
24
|
+
} = _(), [v, m] = I(!1), [u, p] = I(null), [E, f] = I(null), R = z({
|
|
25
25
|
control: O
|
|
26
|
-
}), o = t.get(
|
|
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:
|
|
57
|
+
isModalVisible: v,
|
|
58
58
|
handleCancel: G,
|
|
59
59
|
handleUpdate: w,
|
|
60
60
|
handleSave: N,
|
|
61
|
-
snapshotDataSource:
|
|
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 "
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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)),
|
|
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:
|
|
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), [
|
|
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
|
-
} =
|
|
200
|
+
} = ve(), {
|
|
201
201
|
populateColumnWithSorters: X
|
|
202
|
-
} =
|
|
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:
|
|
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
|
-
|
|
360
|
-
|
|
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
|
|
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
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { ModalQuestionnaireGroupItem as
|
|
6
|
-
import { useGroupTable as
|
|
7
|
-
import { GroupTableChart as
|
|
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:
|
|
12
|
+
chartHeight: f
|
|
12
13
|
} = a, {
|
|
13
|
-
repeats:
|
|
14
|
-
hidden:
|
|
15
|
-
title:
|
|
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:
|
|
21
|
-
editIndex:
|
|
22
|
-
handleCancel:
|
|
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
|
-
} =
|
|
36
|
-
return
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */ e(s.Title, { level: 4, children:
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
o && /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
|
2
|
-
import { useFieldController as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
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:
|
|
14
|
-
onBlur:
|
|
15
|
-
placeholder:
|
|
16
|
-
} =
|
|
17
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
20
|
+
g as QuestionInputInsideText
|
|
21
21
|
};
|