@bahmni/widgets 0.0.1-dev.433 → 0.0.1-dev.437

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.
@@ -1,9 +1,9 @@
1
1
  import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
2
- import { u as W, a as X, i as J, V as Z, w as x, b as ee, F as te } from "./index-BWaIKbxC.js";
2
+ import { u as W, a as X, i as J, V as Z, w as x, b as ee, F as te } from "./index-BmsXMzpQ.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
6
- const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ue = "DocumentsTable-module_documentImage__KQVgS", c = {
6
+ const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ie = "DocumentsTable-module_documentImage__KQVgS", c = {
7
7
  documentsTableBody: oe,
8
8
  viewAttachmentsLink: se,
9
9
  documentViewerContainer: re,
@@ -11,8 +11,8 @@ const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTab
11
11
  attachmentCounter: de,
12
12
  attachmentError: me,
13
13
  documentIframe: le,
14
- documentImage: ue
15
- }, ie = {
14
+ documentImage: ie
15
+ }, ue = {
16
16
  documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
17
17
  documentType: "DOCUMENTS_TYPE",
18
18
  uploadedOn: "DOCUMENTS_UPLOADED_ON",
@@ -25,7 +25,7 @@ function R(n) {
25
25
  function he(n, f) {
26
26
  return n.map((d) => ({
27
27
  key: d,
28
- header: f(ie[d])
28
+ header: f(ue[d])
29
29
  }));
30
30
  }
31
31
  const Te = [
@@ -39,31 +39,31 @@ const Te = [
39
39
  null
40
40
  ), [V, A] = l(
41
41
  /* @__PURE__ */ new Set()
42
- ), E = W(), { t: o } = ae(), { addNotification: U } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
42
+ ), E = W(), { t: o } = ae(), { addNotification: U } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [i, $] = l(P), [k, O] = l(void 0), v = _((e) => {
43
43
  L(e), M(!0);
44
44
  }, []), z = _(() => {
45
45
  M(!1), L(null), A(/* @__PURE__ */ new Set());
46
46
  }, []), F = _((e) => {
47
47
  A((t) => new Set(t).add(e));
48
- }, []), { data: i, isLoading: H, isError: S, error: b } = ne({
48
+ }, []), { data: u, isLoading: H, isError: S, error: b } = ne({
49
49
  queryKey: [
50
50
  "documents",
51
51
  E,
52
52
  f,
53
53
  N,
54
- u
54
+ i
55
55
  ],
56
56
  enabled: !!E,
57
57
  queryFn: () => J(
58
58
  E,
59
59
  f,
60
- u,
60
+ i,
61
61
  N
62
62
  )
63
63
  });
64
64
  I(() => {
65
- i && O(i.total);
66
- }, [i]), I(() => {
65
+ u && O(u.total);
66
+ }, [u]), I(() => {
67
67
  C(1), O(void 0);
68
68
  }, [E]), I(() => {
69
69
  S && U({
@@ -92,13 +92,13 @@ const Te = [
92
92
  }, [d, s]);
93
93
  const q = _(
94
94
  (e, t) => {
95
- t !== u ? ($(t), C(1), O(void 0)) : C(e);
95
+ t !== i ? ($(t), C(1), O(void 0)) : C(e);
96
96
  },
97
- [u]
97
+ [i]
98
98
  ), D = p(
99
99
  () => n?.fields ?? Te,
100
100
  [n?.fields]
101
- ), j = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), K = p(() => he(D, o), [D, o]), G = p(
101
+ ), j = p(() => [...u?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [u]), K = p(() => he(D, o), [D, o]), G = p(
102
102
  () => D.map((e) => ({
103
103
  key: e,
104
104
  sortable: e !== "attachments"
@@ -152,7 +152,7 @@ const Te = [
152
152
  renderCell: Q,
153
153
  className: c.documentsTableBody,
154
154
  dataTestId: "documents-table",
155
- pageSize: u,
155
+ pageSize: i,
156
156
  totalItems: k,
157
157
  page: N,
158
158
  onPageChange: q
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
2
- import { u as de, c as le, d as me, U as ce, M as ue, x as fe, y as be, Z as he, e as ye, f as Ne, G as Oe, w as ge, C as q, B as x, V as Te, b as G, r as pe, g as Ee, F as Ie, O as Fe, h as Ae } from "./index-BWaIKbxC.js";
2
+ import { u as de, c as le, d as me, U as ce, M as ue, x as fe, y as be, Z as he, e as ye, f as Ne, G as Oe, w as ge, C as q, B as x, V as Te, b as G, r as pe, g as Ee, F as Ie, O as Fe, h as Ae } from "./index-BmsXMzpQ.js";
3
3
  import { useQueryClient as _e, useQuery as F } from "@tanstack/react-query";
4
4
  import { useState as $, useMemo as i, useCallback as d } from "react";
5
5
  import { useTranslation as Re } from "react-i18next";
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as S } from "react/jsx-runtime";
2
- import { j as z, D as C, t as G, l as j, w as H, k as P, T as Z, R as x, S as J, u as Y, a as W, m as X, U as ee, n as se, p as te, Z as re, o as ae, q as oe, s as ne, v as ie, z as ce, b as le } from "./index-BWaIKbxC.js";
2
+ import { j as z, D as C, t as G, l as j, w as H, k as P, T as Z, R as x, S as J, u as Y, a as W, m as X, U as ee, n as se, p as te, Z as re, o as ae, q as oe, s as ne, v as ie, z as ce, b as le } from "./index-BmsXMzpQ.js";
3
3
  import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as U, useMemo as I } from "react";
5
5
  import { useTranslation as w } from "react-i18next";