@bahmni/widgets 0.0.1-dev.459 → 0.0.1-dev.462

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aw as o, au as r, a4 as n, at as c, aR as g, a5 as l, a9 as m, C as d, al as P, aC as u, a6 as v, S as T, a7 as C, a2 as D, T as p, V as A, af as S, ai as b, ac as L, aN as N, aP as y, aQ as E, aT as I, a8 as U, aS as f, an as h, ao as O, O as R, a3 as W, ah as _, aj as x, ab as F, aa as G, ad as M, ag as V, aL as k, aK as w, as as H, ak as K, ae as q, aB as z, ay as B, ax as Y, Y as j, aU as J, s as Q, aI as Z, aH as X, Z as $, aA as aa, aE as ea, aF as sa, aG as ta, _ as ia, az as oa, aD as ra, a0 as na, aJ as ca, a1 as ga, av as la, am as ma, ap as da, ar as Pa, b as ua, aO as va, a as Ta, aq as Ca, u as Da, aM as pa, l as Aa } from "./index-BgKZQd55.js";
1
+ import { ax as o, av as r, a5 as n, au as c, aS as g, a6 as l, aa as m, C as d, am as P, aD as u, a7 as v, T, a8 as C, a3 as D, V as p, X as A, ag as S, aj as b, ad as L, aO as N, aQ as y, aR as E, aU as I, a9 as U, aT as f, ao as h, ap as O, O as R, a4 as W, ai as _, ak as x, ac as V, ab as F, ae as G, ah as M, aM as k, aL as w, at as H, al as K, af as q, aC as z, az as B, ay as Y, Y as j, aV as J, t as Q, aJ as X, aI as Z, _ as $, aB as aa, aF as ea, aG as ta, aH as sa, a0 as ia, aA as oa, aE as ra, a1 as na, aK as ca, a2 as ga, aw as la, an as ma, aq as da, as as Pa, b as ua, aP as va, a as Ta, ar as Ca, u as Da, aN as pa, l as Aa } from "./index-UBpwKR4V.js";
2
2
  import "react/jsx-runtime";
3
3
  import "@tanstack/react-query";
4
4
  import "react";
@@ -34,10 +34,10 @@ export {
34
34
  W as PatientDetails,
35
35
  _ as PatientProgramsTable,
36
36
  x as ProgramDetails,
37
- F as RadiologyInvestigationReport,
38
- G as RadiologyInvestigationTable,
39
- M as SearchPatient,
40
- V as TaskList,
37
+ V as RadiologyInvestigationReport,
38
+ F as RadiologyInvestigationTable,
39
+ G as SearchPatient,
40
+ M as TaskList,
41
41
  k as UserActionProvider,
42
42
  w as UserGlobalAction,
43
43
  H as UserPrivilegeProvider,
@@ -49,13 +49,13 @@ export {
49
49
  j as createEmptyDocumentEntry,
50
50
  J as deriveFormSchemaData,
51
51
  Q as extractFormName,
52
- Z as getAllWidgetConfigs,
53
- X as getAllWidgetTypes,
52
+ X as getAllWidgetConfigs,
53
+ Z as getAllWidgetTypes,
54
54
  $ as getDefaultDocumentType,
55
55
  aa as getSearchWidget,
56
56
  ea as getWidget,
57
- sa as getWidgetConfig,
58
- ta as hasWidget,
57
+ ta as getWidgetConfig,
58
+ sa as hasWidget,
59
59
  ia as isDocumentEntryEmpty,
60
60
  oa as registerSearchWidget,
61
61
  ra as registerWidget,
@@ -1 +1 @@
1
- {"version":3,"file":"MedicationsTable.d.ts","sourceRoot":"","sources":["../../src/medications/MedicationsTable.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgEhD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4Y3C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"MedicationsTable.d.ts","sourceRoot":"","sources":["../../src/medications/MedicationsTable.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgEhD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA2Y3C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -4,7 +4,6 @@ import { MedicationAction } from '../models';
4
4
  type ActionsProps = {
5
5
  actions: MedicationAction[];
6
6
  medication: MedicationRequest;
7
- startDate?: string;
8
7
  disabledActionTypes?: string[];
9
8
  };
10
9
  declare const Actions: React.FC<ActionsProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../src/medications/components/Actions.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAO7C,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAgFnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../src/medications/components/Actions.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAO7C,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA6EnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { MedicationRequest } from 'fhir/r4';
2
2
  import { MedicationAction } from '../models';
3
- export declare const handleAction: (action: MedicationAction, fhirResource?: MedicationRequest, startDate?: string) => void;
3
+ export declare const handleAction: (action: MedicationAction, fhirResource?: MedicationRequest) => void;
4
4
  //# sourceMappingURL=actionHandlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actionHandlers.d.ts","sourceRoot":"","sources":["../../../src/medications/components/actionHandlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAgD7C,eAAO,MAAM,YAAY,GACvB,QAAQ,gBAAgB,EACxB,eAAe,iBAAiB,EAChC,YAAY,MAAM,KACjB,IAmCF,CAAC"}
1
+ {"version":3,"file":"actionHandlers.d.ts","sourceRoot":"","sources":["../../../src/medications/components/actionHandlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAyB7C,eAAO,MAAM,YAAY,GACvB,QAAQ,gBAAgB,EACxB,eAAe,iBAAiB,KAC/B,IAsBF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { AppointmentSearchResult, SearchActionConfig, UserPrivilege, PatientSearchResultBundle, Notification } from '@bahmni/services';
2
- import { NavigateFunction } from 'react-router-dom';
2
+ import { NavigateFunction } from 'react-router';
3
3
  import { PatientSearchViewModel } from '../utils';
4
4
  export declare const getAppointmentStatusClassName: (status: string) => string;
5
5
  export declare const updateAppointmentStatusInResults: (appointmentPatientData: AppointmentSearchResult[], responseUuid: string, responseStatus: string) => AppointmentSearchResult[];
@@ -1 +1 @@
1
- {"version":3,"file":"appointmentSearchResultActionHandler.d.ts","sourceRoot":"","sources":["../../../../src/search/searchPatient/actions/appointmentSearchResultActionHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAGlB,aAAa,EAEb,yBAAyB,EAEzB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,6BAA6B,GAAI,QAAQ,MAAM,KAAG,MAkB9D,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAC3C,wBAAwB,uBAAuB,EAAE,EACjD,cAAc,MAAM,EACpB,gBAAgB,MAAM,KACrB,uBAAuB,EAOzB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,eAAe,MAAM,EACrB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,gBAAgB,SAU3B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,QAAQ,kBAAkB,EAC1B,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,EACpD,mBAAmB,yBAAyB,EAC5C,sBAAsB,CAAC,IAAI,EAAE,yBAAyB,KAAK,IAAI,EAC/D,UAAU,gBAAgB,EAC1B,iBAAiB,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,IAAI,EACjE,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,kBAiE3B,CAAC;AAQF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,kBAAkB,EAC1B,gBAAgB,aAAa,EAAE,EAC/B,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,KACnD,OAcF,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,QAAQ,MAAM,EAAE,GAAG,SAAS,EAC5B,eAAe,MAAM,EAAE,GAAG,SAAS,EACnC,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,KACnD,OASF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC5B,gBAAgB,aAAa,EAAE,MAAM,OAAO,MAAM,EAAE,YAEpD,CAAC;AAEJ,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,EAAE,EACf,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,YAIrD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,EAAE,EACf,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,YAkBrD,CAAC"}
1
+ {"version":3,"file":"appointmentSearchResultActionHandler.d.ts","sourceRoot":"","sources":["../../../../src/search/searchPatient/actions/appointmentSearchResultActionHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAGlB,aAAa,EAEb,yBAAyB,EAEzB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,6BAA6B,GAAI,QAAQ,MAAM,KAAG,MAkB9D,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAC3C,wBAAwB,uBAAuB,EAAE,EACjD,cAAc,MAAM,EACpB,gBAAgB,MAAM,KACrB,uBAAuB,EAOzB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,eAAe,MAAM,EACrB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,gBAAgB,SAU3B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,QAAQ,kBAAkB,EAC1B,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,EACpD,mBAAmB,yBAAyB,EAC5C,sBAAsB,CAAC,IAAI,EAAE,yBAAyB,KAAK,IAAI,EAC/D,UAAU,gBAAgB,EAC1B,iBAAiB,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,IAAI,EACjE,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,kBAiE3B,CAAC;AAQF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,kBAAkB,EAC1B,gBAAgB,aAAa,EAAE,EAC/B,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,KACnD,OAcF,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,QAAQ,MAAM,EAAE,GAAG,SAAS,EAC5B,eAAe,MAAM,EAAE,GAAG,SAAS,EACnC,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,KACnD,OASF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC5B,gBAAgB,aAAa,EAAE,MAAM,OAAO,MAAM,EAAE,YAEpD,CAAC;AAEJ,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,EAAE,EACf,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,YAIrD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,EAAE,EACf,KAAK,sBAAsB,CAAC,uBAAuB,CAAC,YAkBrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"actionHandlers.d.ts","sourceRoot":"","sources":["../../../src/tasks/actions/actionHandlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKzD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA8E3D,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,UAAU,EAClB,MAAM,aAAa,EACnB,aAAa,WAAW,KACvB,IAAI,GAAG,OAAO,CAAC,IAAI,CAOrB,CAAC"}
1
+ {"version":3,"file":"actionHandlers.d.ts","sourceRoot":"","sources":["../../../src/tasks/actions/actionHandlers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKzD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA0E3D,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,UAAU,EAClB,MAAM,aAAa,EACnB,aAAa,WAAW,KACvB,IAAI,GAAG,OAAO,CAAC,IAAI,CAOrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
3
- "version": "0.0.1-dev.459",
3
+ "version": "0.0.1-dev.462",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -35,9 +35,9 @@
35
35
  "@carbon/icons-react": "^11.65.0",
36
36
  "@carbon/react": "^1.83.0",
37
37
  "@tanstack/react-query": "^5.85.5",
38
- "react": ">=18.0.0",
39
- "react-dom": ">=18.0.0",
40
- "react-router-dom": ">=6.0.0"
38
+ "react": ">=19.2.7",
39
+ "react-dom": ">=19.2.7",
40
+ "react-router": ">=7.0.0"
41
41
  },
42
42
  "description": "Reusable React display controls and components extracted for sharing across Bahmni modules. Includes common clinical widgets and notification provider to avoid duplication across different Bahmni applications.",
43
43
  "files": [
@@ -1,253 +0,0 @@
1
- import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
2
- import { u as de, b as le, l as me, m as ce, q as ue, n as fe, y as be, r as ye, o as he, s as Ne, Q as Oe, f as ge, z as V, F as x, $ as Te, L as $, t as pe, v as Ee, W as Ie, O as Fe, C as Ae } from "./index-BgKZQd55.js";
3
- import { useQueryClient as ve, useQuery as F } from "@tanstack/react-query";
4
- import { useState as z, useMemo as i, useCallback as d } from "react";
5
- import { useTranslation as _e } from "react-i18next";
6
- const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", N = {
7
- formsTableBody: Re,
8
- modalHeading: De,
9
- customAccordianItem: Le
10
- }, Ce = "startConsultation", Ue = ({
11
- episodeOfCareUuids: A,
12
- encounterUuids: m,
13
- config: G,
14
- disableActions: Q = !1,
15
- activeEncounterUuid: b = null
16
- }) => {
17
- const { t: o } = _e(), c = de(), [O, v] = z(!1), [a, _] = z(null), {
18
- numberOfVisits: j,
19
- hideThumbnail: K = !1,
20
- forms: y
21
- } = G ?? {}, W = le(
22
- Ae.EDIT_OBSERVATIONS
23
- ), { userPrivileges: h } = me(), g = W && !Q && !!b, R = ce(
24
- A,
25
- m
26
- ), Y = ve(), {
27
- data: D = [],
28
- isLoading: L,
29
- isError: C,
30
- error: J,
31
- refetch: X
32
- } = F({
33
- queryKey: ["forms", c, A],
34
- queryFn: () => ue(c, void 0, j),
35
- enabled: !!c && !R
36
- }), S = i(() => {
37
- let e = D;
38
- return m && m.length > 0 && (e = e.filter(
39
- (t) => m.includes(t.encounterUuid)
40
- )), Array.isArray(y) && y.length > 0 && (e = e.filter(
41
- (t) => y.some((s) => s.toLowerCase() === t.formName.toLowerCase())
42
- )), e;
43
- }, [D, m, y]), { data: B = [] } = F({
44
- queryKey: ["observationForms"],
45
- queryFn: () => fe()
46
- }), M = d(
47
- (e) => {
48
- const t = B.find(
49
- (r) => r.name.toLowerCase() === e.toLowerCase()
50
- );
51
- if (!t?.privileges || t.privileges.length === 0) return !0;
52
- if (!h || h.length === 0) return !1;
53
- const s = new Set(h.map((r) => r.name));
54
- return t.privileges.some(
55
- (r) => s.has(r.privilegeName) && r.editable
56
- );
57
- },
58
- [B, h]
59
- ), u = d(
60
- (e) => !b || e.encounterUuid !== b ? !1 : M(e.formName),
61
- [b, M]
62
- ), {
63
- data: T,
64
- isLoading: Z,
65
- isError: ee,
66
- error: p
67
- } = F({
68
- queryKey: ["formsEncounterFHIR", a?.encounterUuid],
69
- queryFn: () => be(a.encounterUuid),
70
- enabled: !!a?.encounterUuid && O
71
- });
72
- ye(
73
- (e) => {
74
- e.patientUUID === c && (X(), Y.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
75
- },
76
- [c]
77
- );
78
- const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => he(t) ? Ne(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [T, a?.formName]), te = i(() => {
79
- if (p)
80
- return Oe(p).message;
81
- }, [p]), f = i(
82
- () => [
83
- { key: "recordedOn", header: o("RECORDED_ON") },
84
- { key: "recordedBy", header: o("RECORDED_BY") }
85
- ],
86
- [o]
87
- ), w = i(
88
- () => [...f, { key: "actions", header: o("ACTIONS") }],
89
- [f, o]
90
- ), se = d(
91
- (e) => g && e.some((s) => u(s)) ? w : f,
92
- [g, u, w, f]
93
- ), oe = f, ae = i(
94
- () => [
95
- { key: "recordedOn", sortable: !0 },
96
- { key: "recordedBy", sortable: !0 }
97
- ],
98
- []
99
- ), k = i(() => {
100
- const e = S.reduce(
101
- (s, r) => {
102
- const l = r.formName;
103
- s[l] ??= [];
104
- const I = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
105
- return s[l].push({
106
- id: r.encounterUuid,
107
- formName: r.formName,
108
- recordedOn: ge(r.encounterDateTime, o, !0).formattedResult,
109
- recordedBy: I ?? "--",
110
- encounterDateTime: r.encounterDateTime,
111
- encounterUuid: r.encounterUuid
112
- }), s;
113
- },
114
- {}
115
- );
116
- return Object.entries(e).map(
117
- ([s, r]) => ({
118
- formName: s,
119
- records: r.sort(
120
- (l, I) => I.encounterDateTime - l.encounterDateTime
121
- )
122
- })
123
- ).sort((s, r) => s.formName.localeCompare(r.formName));
124
- }, [S, o]), U = d((e) => {
125
- _(e), v(!0);
126
- }, []), H = d(() => {
127
- v(!1), _(null);
128
- }, []), E = d((e) => {
129
- globalThis.dispatchEvent(
130
- new CustomEvent(Ce, {
131
- detail: {
132
- editOnly: "observationForms",
133
- editTitle: "EDIT_OBSERVATION_FORM_TITLE",
134
- sourceEncounterUuid: e.encounterUuid,
135
- formName: e.formName,
136
- directFormMode: !0
137
- }
138
- })
139
- );
140
- }, []), q = d(
141
- (e, t) => {
142
- switch (t) {
143
- case "recordedOn":
144
- return /* @__PURE__ */ n(Te, { onClick: () => U(e), children: e.recordedOn });
145
- case "recordedBy":
146
- return e.recordedBy;
147
- case "actions":
148
- return u(e) ? /* @__PURE__ */ n(
149
- V,
150
- {
151
- label: o("EDIT_OBSERVATION_FORM"),
152
- kind: "ghost",
153
- size: "sm",
154
- testId: `edit-form-${e.encounterUuid}`,
155
- onClick: () => E(e),
156
- children: /* @__PURE__ */ n(x, {})
157
- }
158
- ) : null;
159
- default:
160
- return null;
161
- }
162
- },
163
- [U, E, u, o]
164
- );
165
- return /* @__PURE__ */ P(ie, { children: [
166
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || C || k.length === 0 || R ? /* @__PURE__ */ n(
167
- $,
168
- {
169
- headers: oe,
170
- ariaLabel: o("FORMS_HEADING"),
171
- rows: [],
172
- loading: L,
173
- errorStateMessage: C ? J?.message : void 0,
174
- emptyStateMessage: o("FORMS_UNAVAILABLE"),
175
- renderCell: q,
176
- className: N.formsTableBody,
177
- dataTestId: "forms-table"
178
- }
179
- ) : /* @__PURE__ */ n(pe, { align: "start", children: k.map((e, t) => {
180
- const { formName: s, records: r } = e, l = se(r);
181
- return /* @__PURE__ */ n(
182
- Ee,
183
- {
184
- title: s,
185
- className: N.customAccordianItem,
186
- testId: `accordian-title-${s}`,
187
- open: t === 0,
188
- children: /* @__PURE__ */ n(
189
- $,
190
- {
191
- headers: l,
192
- ariaLabel: o("FORMS_HEADING"),
193
- rows: r,
194
- loading: !1,
195
- errorStateMessage: "",
196
- sortable: ae,
197
- emptyStateMessage: o("FORMS_UNAVAILABLE"),
198
- renderCell: q,
199
- className: N.formsTableBody,
200
- dataTestId: `forms-table-${s}`
201
- }
202
- )
203
- },
204
- s
205
- );
206
- }) }) }),
207
- O && a && /* @__PURE__ */ n(
208
- Ie,
209
- {
210
- id: "modalIdForActionAreaLayout",
211
- portalId: "main-display-area",
212
- open: O,
213
- onRequestClose: H,
214
- modalHeading: /* @__PURE__ */ P("div", { className: N.modalHeading, children: [
215
- /* @__PURE__ */ n("span", { children: a.formName }),
216
- g && u(a) && /* @__PURE__ */ n(
217
- V,
218
- {
219
- label: o("EDIT_OBSERVATION_FORM"),
220
- kind: "ghost",
221
- size: "sm",
222
- testId: `edit-form-modal-${a.encounterUuid}`,
223
- onClick: () => {
224
- H(), E(a);
225
- },
226
- children: /* @__PURE__ */ n(x, {})
227
- }
228
- )
229
- ] }),
230
- modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
231
- passiveModal: !0,
232
- size: "md",
233
- testId: "form-details-modal",
234
- children: /* @__PURE__ */ n(
235
- Fe,
236
- {
237
- observations: re,
238
- isLoading: Z,
239
- isError: ee,
240
- errorMessage: te,
241
- emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
242
- testIdPrefix: a.formName,
243
- hideThumbnail: K,
244
- formName: a.formName
245
- }
246
- )
247
- }
248
- )
249
- ] });
250
- };
251
- export {
252
- Ue as default
253
- };