@beda.software/web-item-controls 0.1.25-group-new-design.7 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) 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/group.module.scss.js +6 -10
  10. package/dist/controls/Group/index.d.ts.map +1 -1
  11. package/dist/controls/Group/index.js +45 -47
  12. package/dist/controls/GroupTable/RenderFormItemReadOnly/index.js +6 -7
  13. package/dist/controls/GroupTable/hooks.js +1 -1
  14. package/dist/controls/GroupWizard/GroupWizard.stories.utils.d.ts +1 -1
  15. package/dist/controls/GroupWizard/GroupWizard.stories.utils.d.ts.map +1 -1
  16. package/dist/controls/GroupWizard/index.d.ts +1 -61
  17. package/dist/controls/GroupWizard/index.d.ts.map +1 -1
  18. package/dist/controls/ImageAnnotation/AnnotationImage.d.ts +16 -0
  19. package/dist/controls/ImageAnnotation/AnnotationImage.d.ts.map +1 -0
  20. package/dist/controls/ImageAnnotation/AnnotationImage.js +37 -0
  21. package/dist/controls/ImageAnnotation/index.d.ts +9 -0
  22. package/dist/controls/ImageAnnotation/index.d.ts.map +1 -0
  23. package/dist/controls/ImageAnnotation/index.js +121 -0
  24. package/dist/controls/ImageAnnotation/styles.d.ts +21 -0
  25. package/dist/controls/ImageAnnotation/styles.d.ts.map +1 -0
  26. package/dist/controls/ImageAnnotation/styles.js +66 -0
  27. package/dist/controls/ImageAnnotation/utils.d.ts +3 -0
  28. package/dist/controls/ImageAnnotation/utils.d.ts.map +1 -0
  29. package/dist/controls/ImageAnnotation/utils.js +9 -0
  30. package/dist/controls/MDEditorControl/MarkDownEditor/directives.js +3 -3
  31. package/dist/controls/MDEditorControl/MarkDownEditor/hooks.js +1 -1
  32. package/dist/controls/Reference/index.js +2 -2
  33. package/dist/controls/UploadFileControl/hooks.js +3 -4
  34. package/dist/controls/UploadFileControl/index.js +1 -1
  35. package/dist/controls/controls.d.ts.map +1 -1
  36. package/dist/controls/controls.js +42 -41
  37. package/dist/controls/index.d.ts +1 -1
  38. package/dist/controls/index.d.ts.map +1 -1
  39. package/dist/controls/index.js +44 -46
  40. package/dist/ext/d3-array/src/bisect.js +6 -7
  41. package/dist/ext/d3-array/src/bisector.js +2 -4
  42. package/dist/ext/d3-array/src/ticks.js +7 -18
  43. package/dist/ext/d3-color/src/color.js +3 -6
  44. package/dist/ext/d3-color/src/define.js +1 -2
  45. package/dist/ext/d3-format/src/defaultLocale.js +3 -4
  46. package/dist/ext/d3-format/src/formatDecimal.js +1 -2
  47. package/dist/ext/d3-format/src/formatPrefixAuto.js +1 -2
  48. package/dist/ext/d3-format/src/formatRounded.js +1 -2
  49. package/dist/ext/d3-format/src/formatSpecifier.js +1 -2
  50. package/dist/ext/d3-format/src/formatTrim.js +13 -15
  51. package/dist/ext/d3-interpolate/src/array.js +3 -6
  52. package/dist/ext/d3-interpolate/src/numberArray.js +1 -2
  53. package/dist/ext/d3-interpolate/src/object.js +1 -2
  54. package/dist/ext/d3-interpolate/src/string.js +1 -2
  55. package/dist/ext/d3-scale/src/continuous.js +4 -4
  56. package/dist/ext/unist-util-is/lib/index.js +2 -4
  57. package/dist/locale/de/messages.d.ts.map +1 -1
  58. package/dist/locale/de/messages.js +1 -4
  59. package/dist/locale/en/messages.d.ts.map +1 -1
  60. package/dist/locale/en/messages.js +1 -4
  61. package/dist/locale/es/messages.d.ts.map +1 -1
  62. package/dist/locale/es/messages.js +1 -4
  63. package/dist/locale/ru/messages.d.ts.map +1 -1
  64. package/dist/locale/ru/messages.js +1 -4
  65. package/dist/readonly-controls/Display/index.js +4 -4
  66. package/dist/readonly-controls/Group/index.d.ts.map +1 -1
  67. package/dist/readonly-controls/Group/index.js +25 -27
  68. package/dist/readonly-controls/ImageAnnotation/index.d.ts +4 -0
  69. package/dist/readonly-controls/ImageAnnotation/index.d.ts.map +1 -0
  70. package/dist/readonly-controls/ImageAnnotation/index.js +45 -0
  71. package/dist/readonly-controls/MarkdownRender/index.js +1 -1
  72. package/dist/readonly-controls/index.d.ts +1 -1
  73. package/dist/readonly-controls/index.d.ts.map +1 -1
  74. package/dist/readonly-controls/index.js +17 -17
  75. package/dist/readonly-controls/readonly-controls.d.ts.map +1 -1
  76. package/dist/readonly-controls/readonly-controls.js +33 -42
  77. package/dist/services/fhir.js +73 -46
  78. package/dist/services/i18n.js +12 -33
  79. package/dist/style.css +1 -1
  80. package/dist/utils/date.js +1 -1
  81. package/dist/utils/fhirpath.d.ts +1 -0
  82. package/dist/utils/fhirpath.d.ts.map +1 -1
  83. package/dist/utils/fhirpath.js +3 -2
  84. package/package.json +17 -13
  85. package/src/locale/de/messages.po +23 -32
  86. package/src/locale/de/messages.ts +1 -1
  87. package/src/locale/en/messages.po +23 -32
  88. package/src/locale/en/messages.ts +1 -1
  89. package/src/locale/es/messages.po +23 -32
  90. package/src/locale/es/messages.ts +1 -1
  91. package/src/locale/ru/messages.po +23 -32
  92. package/src/locale/ru/messages.ts +1 -1
  93. package/dist/components/Table/table.scss.js +0 -4
  94. package/dist/containers/App/utils.d.ts +0 -6
  95. package/dist/containers/App/utils.d.ts.map +0 -1
  96. package/dist/controls/GroupWizard/GroupWizardSidebar/GroupWizardSidebar.stories.utils.d.ts +0 -10
  97. package/dist/controls/GroupWizard/GroupWizardSidebar/GroupWizardSidebar.stories.utils.d.ts.map +0 -1
  98. package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.d.ts +0 -9
  99. package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.d.ts.map +0 -1
  100. package/dist/controls/GroupWizard/GroupWizardSidebar/ParentPreviewFields.js +0 -29
  101. package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.d.ts +0 -14
  102. package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.d.ts.map +0 -1
  103. package/dist/controls/GroupWizard/GroupWizardSidebar/SidebarMenu.js +0 -94
  104. package/dist/controls/GroupWizard/GroupWizardSidebar/index.d.ts +0 -5
  105. package/dist/controls/GroupWizard/GroupWizardSidebar/index.d.ts.map +0 -1
  106. package/dist/controls/GroupWizard/GroupWizardSidebar/index.js +0 -152
  107. package/dist/controls/GroupWizard/GroupWizardSidebar/styles.d.ts +0 -35
  108. package/dist/controls/GroupWizard/GroupWizardSidebar/styles.d.ts.map +0 -1
  109. package/dist/controls/GroupWizard/GroupWizardSidebar/styles.js +0 -106
  110. package/dist/controls/GroupWizard/GroupWizardSidebar/types.d.ts +0 -20
  111. package/dist/controls/GroupWizard/GroupWizardSidebar/types.d.ts.map +0 -1
  112. package/dist/controls/GroupWizard/GroupWizardSidebar/utils.d.ts +0 -12
  113. package/dist/controls/GroupWizard/GroupWizardSidebar/utils.d.ts.map +0 -1
  114. package/dist/controls/GroupWizard/GroupWizardSidebar/utils.js +0 -96
  115. package/dist/readonly-controls/GroupWizardSidebar/index.d.ts +0 -3
  116. package/dist/readonly-controls/GroupWizardSidebar/index.d.ts.map +0 -1
  117. package/dist/readonly-controls/GroupWizardSidebar/index.js +0 -104
package/README.md CHANGED
@@ -4,6 +4,10 @@ Reusable FHIR Questionnaire web itemControls and readonly itemControls for Beda-
4
4
 
5
5
  This repository is a package, not a standalone frontend application. Storybook is the local development surface, and the library build publishes only the package entry points described below.
6
6
 
7
+ ## Storybook
8
+
9
+ The latest published Storybook (most recent `master` build on Chromatic): https://master--6a0186ef4bcbb3928488373e.chromatic.com
10
+
7
11
  ## Public API
8
12
 
9
13
  Only these package subpaths are supported:
@@ -1,5 +1,5 @@
1
- import x from "lodash";
2
- import { useMemo as I, useContext as v } from "react";
1
+ import I from "lodash";
2
+ import { useMemo as S, useContext as v } from "react";
3
3
  import { useFormContext as V } from "react-hook-form";
4
4
  import { questionnaireItemsToValidationSchema as k } from "@beda.software/fhir-questionnaire/components";
5
5
  import { BaseQuestionnaireResponseFormPropsContext as C } from "@beda.software/fhir-questionnaire/contexts";
@@ -16,21 +16,18 @@ function $(m) {
16
16
  } = u, {
17
17
  item: d,
18
18
  linkId: o
19
- } = r, p = I(() => [...e, o, "items", ...t !== void 0 ? [t.toString()] : []], [e, o, t]), {
19
+ } = r, p = S(() => [...e, o, "items", ...t !== void 0 ? [t.toString()] : []], [e, o, t]), {
20
20
  trigger: n,
21
21
  getValues: f
22
22
  } = V() ?? {
23
- trigger: void 0,
24
- formState: {
25
- isSubmitted: !1
26
- }
23
+ trigger: void 0
27
24
  }, s = v(C);
28
25
  if (t === void 0)
29
26
  return null;
30
- const h = x.get(f(), p), a = !!r.repeats, S = a ? `${i} ${t + 1}` : i, g = a ? [...e, o, "items", t.toString()] : [...e, o, "items"];
27
+ const h = I.get(f(), p), a = !!r.repeats, g = a ? `${i} ${t + 1}` : i, x = a ? [...e, o, "items", t.toString()] : [...e, o, "items"];
31
28
  return {
32
- modalTitle: S,
33
- modalParentPath: g,
29
+ modalTitle: g,
30
+ modalParentPath: x,
34
31
  handleOk: async () => {
35
32
  await (n == null ? void 0 : n()), k(d, s == null ? void 0 : s.customYupTests).isValidSync(h) === !1 || c();
36
33
  },
@@ -12,7 +12,7 @@ import "../Select/styles.js";
12
12
  import "lodash";
13
13
  import "../../contexts/valueset-expand.js";
14
14
  import "../../contexts/markdown-editor-context.js";
15
- import "moment";
15
+ import "../SearchBar/SearchBarColumn/DateColumn/index.js";
16
16
  import "@lingui/core";
17
17
  import "yup";
18
18
  import "@beda.software/fhir-react";
@@ -23,15 +23,17 @@ import "../../services/fhir.js";
23
23
  import "fhirpath/fhir-context/r4";
24
24
  import "../../sharedState/index.js";
25
25
  import "@ant-design/icons";
26
+ import "../Typography.js";
26
27
  import "../SearchBar/SearchBarMobile/styles.js";
27
28
  import "../SearchBar/styles.js";
29
+ import "moment";
28
30
  import "../Table/styles.js";
29
31
  import "../Table/TableCards/styles.js";
30
- import "../Table/table.scss.js";
32
+ /* empty css */
31
33
  import "../TimePicker/index.js";
32
34
  import m from "../BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.module.scss.js";
33
35
  import { useModalQuestionnaireGroupItem as I } from "./hooks.js";
34
- function X(t) {
36
+ function Z(t) {
35
37
  const {
36
38
  open: i,
37
39
  groupItem: e,
@@ -52,5 +54,5 @@ function X(t) {
52
54
  return /* @__PURE__ */ o(h, { title: u, open: i, onOk: a, onCancel: p, destroyOnClose: !0, closable: !1, children: /* @__PURE__ */ o("div", { className: d(m.content, "form__content", m.form), children: /* @__PURE__ */ o(f, { questionItems: s, parentPath: [...c], context: l }) }) });
53
55
  }
54
56
  export {
55
- X as ModalQuestionnaireGroupItem
57
+ Z as ModalQuestionnaireGroupItem
56
58
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { AsyncSelect as r } from "../../../Select/index.js";
3
- import { getAnswerDisplay as i, getAnswerCode as p } from "../../../../utils/questionnaire.js";
3
+ import { getAnswerCode as i, getAnswerDisplay as p } from "../../../../utils/questionnaire.js";
4
4
  import { useReferenceColumn as s } from "./hooks.js";
5
5
  function O(o) {
6
6
  const {
@@ -10,7 +10,7 @@ function O(o) {
10
10
  debouncedLoadOptions: l,
11
11
  onOptionChange: u
12
12
  } = s(o);
13
- return /* @__PURE__ */ a(r, { onChange: u, value: n.value, loadOptions: l, defaultOptions: !0, getOptionLabel: (e) => i(e.value), getOptionValue: (e) => p(e.value), isMulti: !1, placeholder: n.column.placeholder, defaultMenuIsOpen: t, isClearable: !0 });
13
+ return /* @__PURE__ */ a(r, { onChange: u, value: n.value, loadOptions: l, defaultOptions: !0, getOptionLabel: (e) => p(e.value), getOptionValue: (e) => i(e.value), isMulti: !1, placeholder: n.column.placeholder, defaultMenuIsOpen: t, isClearable: !0 });
14
14
  }
15
15
  export {
16
16
  O as ReferenceColumn
@@ -1,4 +1,4 @@
1
- import { Badge as o, Button as a, Drawer as i } from "antd";
1
+ import { Drawer as o, Button as a, Badge as i } from "antd";
2
2
  import t from "styled-components";
3
3
  const p = {
4
4
  Container: t.div.withConfig({
@@ -9,7 +9,7 @@ const p = {
9
9
  displayName: "SearchBarMobile__FiltersButton",
10
10
  componentId: "sc-nh45q8-1"
11
11
  })(["position:relative;"]),
12
- Badge: t(o).withConfig({
12
+ Badge: t(i).withConfig({
13
13
  displayName: "SearchBarMobile__Badge",
14
14
  componentId: "sc-nh45q8-2"
15
15
  })(["position:absolute;right:-3px;top:-3px;.ant-badge-count{background-color:", ";color:", ";}"], ({
@@ -23,7 +23,7 @@ const p = {
23
23
  })(["height:56px;width:48px !important;color:", " !important;&:hover{background:0 !important;}"], ({
24
24
  theme: e
25
25
  }) => e.neutralPalette.gray_7),
26
- Drawer: t(i).withConfig({
26
+ Drawer: t(o).withConfig({
27
27
  displayName: "SearchBarMobile__Drawer",
28
28
  componentId: "sc-nh45q8-4"
29
29
  })(["padding-top:56px;padding-bottom:129px;background-color:", ";.ant-drawer-body{padding:0;display:flex;flex-direction:column;justify-content:space-between;}.ant-input-search,.ant-picker,.react-select__control{width:100%;max-width:450px;}"], ({
@@ -2,7 +2,7 @@ import { jsxs as a, Fragment as d, jsx as r } from "react/jsx-runtime";
2
2
  import { Table as l } from "antd";
3
3
  import { S as i } from "./styles.js";
4
4
  import { TableCards as s } from "./TableCards/index.js";
5
- import "./table.scss.js";
5
+ /* empty css */
6
6
  function c(e) {
7
7
  const {
8
8
  showCardsOnMobile: o = !0
@@ -4,12 +4,12 @@ import c from "lodash";
4
4
  import H from "moment";
5
5
  import { useState as F, useEffect as P } from "react";
6
6
  import { useFormContext as S } from "react-hook-form";
7
- import { RenderRemoteData as w, parseFHIRDateTime as p, formatFHIRDate as I, useService as x, formatFHIRDateTime as T, extractBundleResources as M } from "@beda.software/fhir-react";
7
+ import { RenderRemoteData as w, formatFHIRDate as I, parseFHIRDateTime as p, useService as x, formatFHIRDateTime as T, extractBundleResources as M } from "@beda.software/fhir-react";
8
8
  import { mapSuccess as A, resolveMap as B } from "@beda.software/remote-data";
9
9
  import { useFieldController as k } from "../../components/BaseQuestionnaireResponseForm/hooks.js";
10
10
  import { DatePicker as q } from "../../components/DatePicker/index.js";
11
11
  import { Spinner as y } from "../../components/Spinner/index.js";
12
- import { getFHIRResource as O, getAllFHIRResources as N } from "../../services/fhir.js";
12
+ import { getAllFHIRResources as O, getFHIRResource as N } from "../../services/fhir.js";
13
13
  import { humanDateTime as v } from "../../utils/date.js";
14
14
  import { useCalendarOptions as $ } from "./useCalendarOptions.js";
15
15
  import { getTimeSlots as j } from "./utils.js";
@@ -19,8 +19,8 @@ function E(t) {
19
19
  } = $(), {
20
20
  slotDuration: i
21
21
  } = o, [s] = x(async () => A(await B({
22
- practitionerRole: O(t),
23
- appointmentsBundle: N("Appointment", {
22
+ practitionerRole: N(t),
23
+ appointmentsBundle: O("Appointment", {
24
24
  actor: t.reference,
25
25
  date: [`ge${T(H().startOf("day"))}`]
26
26
  })
@@ -11,12 +11,10 @@ import "../../components/AudioRecorder/styles.js";
11
11
  import "react";
12
12
  import "@beda.software/remote-data";
13
13
  import "@beda.software/fhir-questionnaire";
14
- import "../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.module.scss.js";
15
14
  import "../Group/context.js";
16
15
  import "../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.styles.js";
17
16
  import "@beda.software/emr-config";
18
17
  import "../../services/fhir.js";
19
- import "../../readonly-controls/ReadonlyWidgets.module.scss.js";
20
18
  import "../../readonly-controls/ReadonlyWidgets.styles.js";
21
19
  import "@lingui/core";
22
20
  import "lodash";
@@ -25,21 +23,21 @@ import "sdc-qrf";
25
23
  import "fhirpath";
26
24
  import "../../utils/yup-locale.js";
27
25
  import { S as d } from "./styles.js";
28
- import "react-hook-form";
29
- import "../GroupWizard/index.js";
30
- import "../GroupWizard/GroupWizardSidebar/styles.js";
31
26
  import "antd/es/layout/layout";
32
27
  import "styled-components";
33
28
  import "antd/es/layout/Sider";
29
+ import "react-hook-form";
34
30
  import "../../components/Wizard/styles.js";
31
+ import "../GroupWizard/index.js";
35
32
  import "../../readonly-controls/GroupWizard/styles.js";
33
+ import "../ImageAnnotation/styles.js";
36
34
  import { MarkdownRender as c } from "../../readonly-controls/MarkdownRender/index.js";
37
35
  import "react-select";
38
36
  import "react-select/async";
39
37
  import "../../components/Select/styles.js";
40
38
  import "fhirpath/fhir-context/r4";
41
39
  import "../../sharedState/index.js";
42
- function tr({
40
+ function C({
43
41
  questionItem: m
44
42
  }) {
45
43
  var p, e;
@@ -65,6 +63,6 @@ const a = ({
65
63
  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));
66
64
  };
67
65
  export {
68
- tr as Display,
66
+ C as Display,
69
67
  a as TextWithLink
70
68
  };
@@ -1,13 +1,9 @@
1
- const o = "_group_1ndd9_1", _ = "_groupTitle_1ndd9_8", r = "_row_1ndd9_14", t = "_col_1ndd9_22", d = {
2
- group: o,
3
- groupTitle: _,
4
- row: r,
5
- col: t
1
+ const o = "_row_1ndd9_14", c = "_col_1ndd9_22", _ = {
2
+ row: o,
3
+ col: c
6
4
  };
7
5
  export {
8
- t as col,
9
- d as default,
10
- o as group,
11
- _ as groupTitle,
12
- r as row
6
+ c as col,
7
+ _ as default,
8
+ o as row
13
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/Group/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAyExD,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,2CAM1C;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,2CAExC;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,2CAExC;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,2CAE3C;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,cAAc,2CAEzC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,2CAE5C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,2CAEvD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,2CAE7C;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,2CAE5C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/Group/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAuExD,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,2CAE1C;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,2CAExC;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,2CAExC;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,2CAE3C;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,cAAc,2CAEzC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,2CAE5C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,2CAEvD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,2CAE7C;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,2CAE5C"}
@@ -1,18 +1,16 @@
1
1
  import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import v from "classnames";
3
- import { QuestionItems as y } from "sdc-qrf";
4
- import { ItemHelpText as w } from "../../components/BaseQuestionnaireResponseForm/ItemHelpText.js";
5
- import { Title as S } from "../../components/Typography.js";
6
- import { GroupWizardSidebar as C } from "../GroupWizard/GroupWizardSidebar/index.js";
7
- import { shouldApplySidebarDesign as R } from "../GroupWizard/GroupWizardSidebar/utils.js";
8
- import { GroupContext as T } from "./context.js";
9
- import { GridGroup as q } from "./GridGroup/index.js";
2
+ import g from "classnames";
3
+ import { QuestionItems as w } from "sdc-qrf";
4
+ import { ItemHelpText as y } from "../../components/BaseQuestionnaireResponseForm/ItemHelpText.js";
5
+ import { Title as C } from "../../components/Typography.js";
6
+ import { GroupContext as R } from "./context.js";
7
+ import { GridGroup as S } from "./GridGroup/index.js";
10
8
  import p from "./group.module.scss.js";
11
- import { GroupCard as l } from "./GroupCard/index.js";
12
- import { GTable as P } from "./GTable/index.js";
13
- import { RepeatableGroups as a } from "./RepeatableGroups/index.js";
9
+ import { GroupCard as a } from "./GroupCard/index.js";
10
+ import { GTable as T } from "./GTable/index.js";
11
+ import { RepeatableGroups as l } from "./RepeatableGroups/index.js";
14
12
  import { S as u } from "./styles.js";
15
- import { RepeatableGroupRow as j } from "./RepeatableGroups/RepeatableGroupRow.js";
13
+ import { RepeatableGroupRow as P } from "./RepeatableGroups/RepeatableGroupRow.js";
16
14
  function o(r) {
17
15
  const {
18
16
  parentPath: d,
@@ -23,66 +21,66 @@ function o(r) {
23
21
  linkId: h,
24
22
  item: m,
25
23
  repeats: G,
26
- text: i,
27
- helpText: n,
28
- hidden: b
24
+ text: n,
25
+ helpText: i,
26
+ hidden: x
29
27
  } = f;
30
- if (b)
28
+ if (x)
31
29
  return null;
32
- const x = () => e === "gtable" ? /* @__PURE__ */ t(P, { groupItem: r }) : e === "row" ? /* @__PURE__ */ t(a, { groupItem: r, renderGroup: (g) => /* @__PURE__ */ t(j, { ...g }) }) : /* @__PURE__ */ t(a, { groupItem: r });
30
+ const b = () => e === "gtable" ? /* @__PURE__ */ t(T, { groupItem: r }) : e === "row" ? /* @__PURE__ */ t(l, { groupItem: r, renderGroup: (I) => /* @__PURE__ */ t(P, { ...I }) }) : /* @__PURE__ */ t(l, { groupItem: r });
33
31
  if (e === "grid")
34
- return /* @__PURE__ */ t(q, { groupItem: r });
32
+ return /* @__PURE__ */ t(S, { groupItem: r });
35
33
  if (G)
36
- return /* @__PURE__ */ t(T.Provider, { value: {
34
+ return /* @__PURE__ */ t(R.Provider, { value: {
37
35
  type: e
38
- }, children: x() });
39
- const I = e === "section" || e === "section-with-divider";
36
+ }, children: b() });
37
+ const v = e === "section" || e === "section-with-divider";
40
38
  return /* @__PURE__ */ c(u.Group, { children: [
41
- i || n ? /* @__PURE__ */ t(u.Header, { $type: e, children: /* @__PURE__ */ c(u.Title, { children: [
42
- i && /* @__PURE__ */ t(S, { level: I ? 4 : 5, children: i }),
43
- n && /* @__PURE__ */ t(w, { helpText: n })
39
+ n || i ? /* @__PURE__ */ t(u.Header, { $type: e, children: /* @__PURE__ */ c(u.Title, { children: [
40
+ n && /* @__PURE__ */ t(C, { level: v ? 4 : 5, children: n }),
41
+ i && /* @__PURE__ */ t(y, { helpText: i })
44
42
  ] }) }) : null,
45
- m && /* @__PURE__ */ t("div", { className: v({
43
+ m && /* @__PURE__ */ t("div", { className: g({
46
44
  [p.row]: e === "row",
47
45
  [p.col]: !e || e === "col"
48
- }), children: /* @__PURE__ */ t(y, { questionItems: m, parentPath: [...d, h, "items"], context: s[0] }) })
46
+ }), children: /* @__PURE__ */ t(w, { questionItems: m, parentPath: [...d, h, "items"], context: s[0] }) })
49
47
  ] });
50
48
  }
51
- function L(r) {
52
- return R(r.questionItem) ? /* @__PURE__ */ t(C, { ...r }) : /* @__PURE__ */ t(o, { ...r });
49
+ function B(r) {
50
+ return /* @__PURE__ */ t(o, { ...r });
53
51
  }
54
- function O(r) {
52
+ function E(r) {
55
53
  return /* @__PURE__ */ t(o, { ...r, type: "col" });
56
54
  }
57
- function U(r) {
55
+ function J(r) {
58
56
  return /* @__PURE__ */ t(o, { ...r, type: "row" });
59
57
  }
60
- function V(r) {
58
+ function K(r) {
61
59
  return /* @__PURE__ */ t(o, { ...r, type: "gtable" });
62
60
  }
63
- function X(r) {
61
+ function L(r) {
64
62
  return /* @__PURE__ */ t(o, { ...r, type: "grid" });
65
63
  }
66
- function Y(r) {
64
+ function O(r) {
67
65
  return /* @__PURE__ */ t(o, { ...r, type: "section" });
68
66
  }
69
- function Z(r) {
67
+ function U(r) {
70
68
  return /* @__PURE__ */ t(o, { ...r, type: "section-with-divider" });
71
69
  }
72
- function _(r) {
73
- return /* @__PURE__ */ t(l, { ...r, variant: "main-card" });
70
+ function V(r) {
71
+ return /* @__PURE__ */ t(a, { ...r, variant: "main-card" });
74
72
  }
75
- function rr(r) {
76
- return /* @__PURE__ */ t(l, { ...r, variant: "sub-card" });
73
+ function X(r) {
74
+ return /* @__PURE__ */ t(a, { ...r, variant: "sub-card" });
77
75
  }
78
76
  export {
79
- O as Col,
80
- X as Grid,
81
- L as Group,
82
- V as Gtable,
83
- _ as MainCard,
84
- U as Row,
85
- Y as Section,
86
- Z as SectionWithDivider,
87
- rr as SubCard
77
+ E as Col,
78
+ L as Grid,
79
+ B as Group,
80
+ K as Gtable,
81
+ V as MainCard,
82
+ J as Row,
83
+ O as Section,
84
+ U as SectionWithDivider,
85
+ X as SubCard
88
86
  };
@@ -5,16 +5,15 @@ import "@ant-design/icons";
5
5
  import "antd";
6
6
  import "react-audio-voice-recorder";
7
7
  import "@beda.software/fhir-react";
8
+ import "../../../components/Typography.js";
8
9
  import "../../../components/AudioRecorder/styles.js";
9
10
  import "react";
10
11
  import "@beda.software/remote-data";
11
12
  import "@beda.software/fhir-questionnaire";
12
- import "../../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.module.scss.js";
13
13
  import "../../../components/BaseQuestionnaireResponseForm/BaseQuestionnaireResponseForm.styles.js";
14
14
  import "../../Group/context.js";
15
15
  import "@beda.software/emr-config";
16
16
  import "../../../services/fhir.js";
17
- import "../../../readonly-controls/ReadonlyWidgets.module.scss.js";
18
17
  import "../../../readonly-controls/ReadonlyWidgets.styles.js";
19
18
  import "@lingui/core";
20
19
  import "lodash";
@@ -23,14 +22,14 @@ import "sdc-qrf";
23
22
  import "fhirpath";
24
23
  import "../../../utils/yup-locale.js";
25
24
  import "../../Display/styles.js";
26
- import "react-hook-form";
27
- import "../../GroupWizard/index.js";
28
- import "../../GroupWizard/GroupWizardSidebar/styles.js";
29
25
  import "antd/es/layout/layout";
30
26
  import "styled-components";
31
27
  import "antd/es/layout/Sider";
28
+ import "react-hook-form";
32
29
  import "../../../components/Wizard/styles.js";
30
+ import "../../GroupWizard/index.js";
33
31
  import "../../../readonly-controls/GroupWizard/styles.js";
32
+ import "../../ImageAnnotation/styles.js";
34
33
  import { MarkdownRender as a } from "../../../readonly-controls/MarkdownRender/index.js";
35
34
  import "react-select";
36
35
  import "react-select/async";
@@ -39,7 +38,7 @@ import "fhirpath/fhir-context/r4";
39
38
  import "../../../sharedState/index.js";
40
39
  import { useRenderFormItemReadOnly as h } from "./hooks.js";
41
40
  import { S as i } from "./styles.js";
42
- const w = (p) => {
41
+ const _ = (p) => {
43
42
  const {
44
43
  rows: m,
45
44
  emptySymbol: e
@@ -53,5 +52,5 @@ const w = (p) => {
53
52
  }) });
54
53
  };
55
54
  export {
56
- w as RenderFormItemReadOnly
55
+ _ as RenderFormItemReadOnly
57
56
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as me, Fragment as We, 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
3
  import { MinusOutlined as Oe, PlusOutlined as Te } from "@ant-design/icons";
4
4
  import { Button as oe, Popconfirm as je } from "antd";
@@ -1,4 +1,4 @@
1
- import { Decorator } from '@storybook/react';
1
+ import { Decorator } from '@storybook/react-vite';
2
2
  import { Questionnaire, QuestionnaireResponse } from 'fhir/r4b';
3
3
  import { FCEQuestionnaireItem, ItemContext } from 'sdc-qrf';
4
4
  export declare const WIZARD_ITEM: FCEQuestionnaireItem;
@@ -1 +1 @@
1
- {"version":3,"file":"GroupWizard.stories.utils.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/GroupWizard.stories.utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAa,WAAW,EAAqC,MAAM,SAAS,CAAC;AAY1G,eAAO,MAAM,WAAW,EAAE,oBAqEzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAI3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,qBAGpC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAAW,EAMhC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,SAsB9C,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,EAAE,oBAAoB,+FAkBpD"}
1
+ {"version":3,"file":"GroupWizard.stories.utils.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/GroupWizard.stories.utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAa,WAAW,EAAqC,MAAM,SAAS,CAAC;AAY1G,eAAO,MAAM,WAAW,EAAE,oBAqEzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAI3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,qBAGpC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAAW,EAMhC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,SAsB9C,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,EAAE,oBAAoB,+FAkBpD"}
@@ -4,76 +4,16 @@ export interface GroupWizardProps extends GroupItemProps {
4
4
  wizard?: Partial<WizardProps>;
5
5
  }
6
6
  export declare const GroupWizardBus: {
7
- useBus: (type: "scrollTo" | "sidebarAddElement" | "sidebarGoToIndex" | "sidebarGoToPrevious" | "sidebarGoToNext" | "sidebarRemove" | "sidebarSelect", callback: (e: {
7
+ useBus: (type: "scrollTo", callback: (e: {
8
8
  type: "scrollTo";
9
9
  groupLinkId: string;
10
- } | {
11
- type: "sidebarAddElement";
12
- groupLinkId: string;
13
- } | {
14
- type: "sidebarGoToIndex";
15
- groupLinkId: string;
16
- index: number;
17
- } | {
18
- type: "sidebarGoToPrevious";
19
- groupLinkId: string;
20
- } | {
21
- type: "sidebarGoToNext";
22
- groupLinkId: string;
23
- } | {
24
- type: "sidebarRemove";
25
- groupLinkId: string;
26
- } | {
27
- type: "sidebarSelect";
28
- groupLinkId: string;
29
- key: string;
30
10
  }) => void, deps: Array<any>) => (action: {
31
11
  type: "scrollTo";
32
12
  groupLinkId: string;
33
- } | {
34
- type: "sidebarAddElement";
35
- groupLinkId: string;
36
- } | {
37
- type: "sidebarGoToIndex";
38
- groupLinkId: string;
39
- index: number;
40
- } | {
41
- type: "sidebarGoToPrevious";
42
- groupLinkId: string;
43
- } | {
44
- type: "sidebarGoToNext";
45
- groupLinkId: string;
46
- } | {
47
- type: "sidebarRemove";
48
- groupLinkId: string;
49
- } | {
50
- type: "sidebarSelect";
51
- groupLinkId: string;
52
- key: string;
53
13
  }) => void;
54
14
  dispatch: (action: {
55
15
  type: "scrollTo";
56
16
  groupLinkId: string;
57
- } | {
58
- type: "sidebarAddElement";
59
- groupLinkId: string;
60
- } | {
61
- type: "sidebarGoToIndex";
62
- groupLinkId: string;
63
- index: number;
64
- } | {
65
- type: "sidebarGoToPrevious";
66
- groupLinkId: string;
67
- } | {
68
- type: "sidebarGoToNext";
69
- groupLinkId: string;
70
- } | {
71
- type: "sidebarRemove";
72
- groupLinkId: string;
73
- } | {
74
- type: "sidebarSelect";
75
- groupLinkId: string;
76
- key: string;
77
17
  }) => void;
78
18
  };
79
19
  export declare function GroupWizardVertical(props: GroupWizardProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACH,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,WAAW,EAGd,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAsB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKxE,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,cAAc;;cAEX,UAAU;qBACH,MAAM;;cAGb,mBAAmB;qBACZ,MAAM;;cAGb,kBAAkB;qBACX,MAAM;eACZ,MAAM;;cAGP,qBAAqB;qBACd,MAAM;;cAGb,iBAAiB;qBACV,MAAM;;cAGb,eAAe;qBACR,MAAM;;cAGb,eAAe;qBACR,MAAM;aACd,MAAM;;cA3BL,UAAU;qBACH,MAAM;;cAGb,mBAAmB;qBACZ,MAAM;;cAGb,kBAAkB;qBACX,MAAM;eACZ,MAAM;;cAGP,qBAAqB;qBACd,MAAM;;cAGb,iBAAiB;qBACV,MAAM;;cAGb,eAAe;qBACR,MAAM;;cAGb,eAAe;qBACR,MAAM;aACd,MAAM;;;cA3BL,UAAU;qBACH,MAAM;;cAGb,mBAAmB;qBACZ,MAAM;;cAGb,kBAAkB;qBACX,MAAM;eACZ,MAAM;;cAGP,qBAAqB;qBACd,MAAM;;cAGb,iBAAiB;qBACV,MAAM;;cAGb,eAAe;qBACR,MAAM;;cAGb,eAAe;qBACR,MAAM;aACd,MAAM;;CAElB,CAAC;AAEJ,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,2CAU1D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,gBAAgB,2CAS9D;AAED,MAAM,WAAW,UAAU;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,yBAAyB,EAAE,MAAM,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAkJlD;AAED,eAAO,MAAM,aAAa,GACtB,WAAW,oBAAoB,EAC/B,YAAY,MAAM,EAAE,EACpB,YAAY,SAAS,EACrB,SAAS,WAAW,KACrB,UAeF,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/GroupWizard/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACH,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,WAAW,EAGd,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAsB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKxE,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,cAAc;;cACjB,UAAU;qBACH,MAAM;;cADb,UAAU;qBACH,MAAM;;;cADb,UAAU;qBACH,MAAM;;CACnB,CAAC;AAEL,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,2CAU1D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,gBAAgB,2CAS9D;AAED,MAAM,WAAW,UAAU;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,yBAAyB,EAAE,MAAM,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAkJlD;AAED,eAAO,MAAM,aAAa,GACtB,WAAW,oBAAoB,EAC/B,YAAY,MAAM,EAAE,EACpB,YAAY,SAAS,EACrB,SAAS,WAAW,KACrB,UAeF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { MouseEvent } from 'react';
2
+ import { FormItems } from 'sdc-qrf';
3
+ interface AnnotationImageProps {
4
+ imageUrl?: string;
5
+ alt?: string;
6
+ items: FormItems[];
7
+ xLinkId: string;
8
+ yLinkId: string;
9
+ activeIndex?: number;
10
+ onImageClick?: (event: MouseEvent<HTMLDivElement>) => void;
11
+ onMarkerClick?: (index: number) => void;
12
+ }
13
+ /** Image with numbered markers positioned by x/y percentages. Shared by the editable and readonly views. */
14
+ export declare function AnnotationImage(props: AnnotationImageProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=AnnotationImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationImage.d.ts","sourceRoot":"","sources":["../../../src/controls/ImageAnnotation/AnnotationImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,SAAS,EAAc,MAAM,SAAS,CAAC;AAKhD,UAAU,oBAAoB;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAkC1D"}
@@ -0,0 +1,37 @@
1
+ import { jsxs as $, jsx as m } from "react/jsx-runtime";
2
+ import { i18n as k } from "@lingui/core";
3
+ import { getItemKey as b } from "sdc-qrf";
4
+ import { S as r } from "./styles.js";
5
+ import { getCoordinate as s } from "./utils.js";
6
+ function x(c) {
7
+ const {
8
+ imageUrl: o,
9
+ alt: p,
10
+ items: d,
11
+ xLinkId: g,
12
+ yLinkId: f,
13
+ activeIndex: I,
14
+ onImageClick: i,
15
+ onMarkerClick: a
16
+ } = c;
17
+ return /* @__PURE__ */ $(r.ImageWrapper, { $clickable: !!i, onClick: i, "data-testid": "image-annotation-canvas", children: [
18
+ o ? /* @__PURE__ */ m(r.Image, { src: o, alt: p ?? "", draggable: !1 }) : null,
19
+ d.map((e, t) => {
20
+ const n = s(e, g), l = s(e, f);
21
+ return n === void 0 || l === void 0 ? null : /* @__PURE__ */ m(r.Marker, { type: "button", disabled: !a, $active: t === I, style: {
22
+ left: `${n}%`,
23
+ top: `${l}%`
24
+ }, onClick: (u) => {
25
+ u.stopPropagation(), a == null || a(t);
26
+ }, "aria-label": `${k._(
27
+ /*i18n*/
28
+ {
29
+ id: "V0Qg8j"
30
+ }
31
+ )} ${t + 1}`, "data-testid": `annotation-marker-${t}`, children: t + 1 }, b(e));
32
+ })
33
+ ] });
34
+ }
35
+ export {
36
+ x as AnnotationImage
37
+ };
@@ -0,0 +1,9 @@
1
+ import { GroupItemProps } from 'sdc-qrf';
2
+ /**
3
+ * Repeatable group rendered on top of an image (`backgroundImage` extension).
4
+ * The first two children must be decimals: they store the marker position as a percentage
5
+ * of the image width (x) and height (y). All the other children describe the annotation
6
+ * and are shown for the currently selected marker only.
7
+ */
8
+ export declare function ImageAnnotation(props: GroupItemProps): import("react/jsx-runtime").JSX.Element | null;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/ImageAnnotation/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEH,cAAc,EAKjB,MAAM,SAAS,CAAC;AA0DjB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,kDA0EpD"}