@bahmni/registration-app 0.0.1-dev.304 → 0.0.1-dev.305

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,5 +1,5 @@
1
1
  import { jsx as r, jsxs as h, Fragment as Q } from "react/jsx-runtime";
2
- import { h as Y, u as x, Y as W, G as J, m as X, a as Z, c as ee, o as te } from "./index-LWCdD7Wl.js";
2
+ import { h as Y, u as x, Y as W, G as J, m as X, a as Z, c as ee, o as te } from "./index-BWjmaYXp.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as N, useMemo as p } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as re, Fragment as oe } from "react/jsx-runtime";
2
- import { u as te, h as ae, y as se, K as ne, W as de, q as ie, U as le, e as me, _ as q, a as ue, m as ce, c as H, T as fe, O as ye, o as he, J as be, F as pe } from "./index-LWCdD7Wl.js";
2
+ import { u as te, h as ae, y as se, K as ne, W as de, q as ie, U as le, e as me, _ as q, a as ue, m as ce, c as H, T as fe, O as ye, o as he, J as be, F as pe } from "./index-BWjmaYXp.js";
3
3
  import { useQueryClient as ge, useQuery as h } from "@tanstack/react-query";
4
4
  import { useState as K, useMemo as d, useCallback as b } from "react";
5
5
  const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", T = {
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-g-1SKLdZ.js";
2
- import { k as p, l as d, p as e } from "./index-LWCdD7Wl.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Bp8u4rjh.js";
2
+ import { k as p, l as d, p as e } from "./index-BWjmaYXp.js";
3
3
  var f = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-g-1SKLdZ.js";
2
- import { k as v, l as C, p as e } from "./index-LWCdD7Wl.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Bp8u4rjh.js";
2
+ import { k as v, l as C, p as e } from "./index-BWjmaYXp.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { h as M, Y as V, u as N, P as Q, j as q, e as j, t as k, r as w, n as P, X as x, c as G, Q as X, b as A, d as Y, f as z, g as Z, A as J, Z as W, i as ee } from "./index-LWCdD7Wl.js";
2
+ import { h as M, Y as V, u as N, P as Q, j as q, e as j, t as k, r as w, n as P, X as x, c as G, Q as X, b as A, d as Y, f as z, g as Z, A as J, Z as W, i as ee } from "./index-BWjmaYXp.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as T } from "react";
5
5
  const D = (t, n, d, l, b, r) => {
@@ -1,4 +1,4 @@
1
- import { s as we, v as z, w as xt, x as B, l as q, p as y, z as Ro, B as ye, S as R, C as _, D as k, E as N, H as A, I as bs, L as ir, M as $e, N as U, R as Hn, V as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-LWCdD7Wl.js";
1
+ import { s as we, v as z, w as xt, x as B, l as q, p as y, z as Ro, B as ye, S as R, C as _, D as k, E as N, H as A, I as bs, L as ir, M as $e, N as U, R as Hn, V as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-BWjmaYXp.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,6 +1,7 @@
1
1
  export interface RegistrationActionsProps {
2
2
  extensionPointId?: string;
3
3
  onBeforeNavigate?: () => Promise<string | null>;
4
+ disabled?: boolean;
4
5
  }
5
6
  /**
6
7
  * Component that renders extensions based on type
@@ -12,5 +13,5 @@ export interface RegistrationActionsProps {
12
13
  * Parent should handle validation and save patient data
13
14
  * If validation fails, parent should show error notification and throw to prevent navigation
14
15
  */
15
- export declare const RegistrationActions: ({ extensionPointId, onBeforeNavigate, }: RegistrationActionsProps) => import("react/jsx-runtime").JSX.Element | null;
16
+ export declare const RegistrationActions: ({ extensionPointId, onBeforeNavigate, disabled, }: RegistrationActionsProps) => import("react/jsx-runtime").JSX.Element | null;
16
17
  //# sourceMappingURL=RegistrationActions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegistrationActions.d.ts","sourceRoot":"","sources":["../../../src/components/registrationActions/RegistrationActions.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,wBAAwB;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,GAAI,yCAGjC,wBAAwB,mDA2F1B,CAAC"}
1
+ {"version":3,"file":"RegistrationActions.d.ts","sourceRoot":"","sources":["../../../src/components/registrationActions/RegistrationActions.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,wBAAwB;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,GAAI,mDAIjC,wBAAwB,mDA6F1B,CAAC"}
@@ -172954,7 +172954,7 @@ function Znt(t, e, r) {
172954
172954
  return o;
172955
172955
  };
172956
172956
  }
172957
- wt(() => Promise.resolve().then(() => _1t)), wt(() => Promise.resolve().then(() => o2t)), wt(() => Promise.resolve().then(() => R2t)), wt(() => Promise.resolve().then(() => F2t)), wt(() => import("./DocumentsTable-BRN1ibfx-JQh0d8ol.js")), wt(() => Promise.resolve().then(() => Jrt)), wt(() => import("./FormsTable-u8hD7pNk-SOJAA9oS.js")), wt(() => Promise.resolve().then(() => Hrt)), wt(() => import("./Observations-DUdH2i49-W1_oGnSS.js")), wt(
172957
+ wt(() => Promise.resolve().then(() => _1t)), wt(() => Promise.resolve().then(() => o2t)), wt(() => Promise.resolve().then(() => R2t)), wt(() => Promise.resolve().then(() => F2t)), wt(() => import("./DocumentsTable-BRN1ibfx-DnW11QIv.js")), wt(() => Promise.resolve().then(() => Jrt)), wt(() => import("./FormsTable-u8hD7pNk-DFiDCSoS.js")), wt(() => Promise.resolve().then(() => Hrt)), wt(() => import("./Observations-DUdH2i49-CkC833u8.js")), wt(
172958
172958
  () => Promise.resolve().then(() => int)
172959
172959
  ), wt(
172960
172960
  () => Promise.resolve().then(() => Utt)
@@ -174794,7 +174794,7 @@ var v5t = (t, e = !1) => {
174794
174794
  const e = EX1(() => {
174795
174795
  const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [i] = this.#c, [l] = this.#p, [s] = this.#t;
174796
174796
  let u;
174797
- return this.#i ? u = this.#i : (u = gX1(() => import("./LNWAZHJI-pi10izKs.js")), this.#i = u), kX1(this.#h, this.#r), mX1(u, wX1({
174797
+ return this.#i ? u = this.#i : (u = gX1(() => import("./LNWAZHJI-D6KNiFJi.js")), this.#i = u), kX1(this.#h, this.#r), mX1(u, wX1({
174798
174798
  get queryFlavor() {
174799
174799
  return r.#d;
174800
174800
  },
@@ -174892,7 +174892,7 @@ var v5t = (t, e = !1) => {
174892
174892
  const e = EX1(() => {
174893
174893
  const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [i] = this.#c, [l] = this.#p, [s] = this.#t, [u] = this.#i;
174894
174894
  let d;
174895
- return this.#l ? d = this.#l : (d = gX1(() => import("./MWZ6AO7Z-DHa37bH-.js")), this.#l = d), kX1(this.#h, this.#r), mX1(d, wX1({
174895
+ return this.#l ? d = this.#l : (d = gX1(() => import("./MWZ6AO7Z-YrtcMM8e.js")), this.#l = d), kX1(this.#h, this.#r), mX1(d, wX1({
174896
174896
  get queryFlavor() {
174897
174897
  return r.#d;
174898
174898
  },
@@ -182874,11 +182874,12 @@ const me2 = () => {
182874
182874
  }, est = ({
182875
182875
  onVisitTypeSelect: t,
182876
182876
  activeVisitLabel: e,
182877
- onActiveVisitClick: r
182877
+ onActiveVisitClick: r,
182878
+ disabled: o = !1
182878
182879
  }) => {
182879
- const { t: o } = F1(), { patientUuid: a } = Ca(), { hasActiveVisit: c } = we2(a), { registrationConfig: i } = Qn(), { visitTypes: l, isLoading: s } = Klt(), u = Ylt(l), d = u.find(
182880
- (h) => h.name === i?.defaultVisitType
182881
- ) ?? u[0];
182880
+ const { t: a } = F1(), { patientUuid: c } = Ca(), { hasActiveVisit: i } = we2(c), { registrationConfig: l } = Qn(), { visitTypes: s, isLoading: u } = Klt(), d = Ylt(s), h = d.find(
182881
+ (p) => p.name === l?.defaultVisitType
182882
+ ) ?? d[0];
182882
182883
  return /* @__PURE__ */ qe("div", { className: mf.opdVisitGroup, children: [
182883
182884
  /* @__PURE__ */ ae(
182884
182885
  it,
@@ -182886,12 +182887,12 @@ const me2 = () => {
182886
182887
  id: "visit-button",
182887
182888
  "data-testid": "start-visit-button",
182888
182889
  className: mf.visitButton,
182889
- kind: c ? "primary" : "tertiary",
182890
- disabled: s || u.length === 0,
182890
+ kind: i ? "primary" : "tertiary",
182891
+ disabled: o || u || d.length === 0,
182891
182892
  onClick: () => {
182892
- c && r ? r() : d && t(d);
182893
+ i && r ? r() : h && t(h);
182893
182894
  },
182894
- renderIcon: c ? () => /* @__PURE__ */ ae(
182895
+ renderIcon: i ? () => /* @__PURE__ */ ae(
182895
182896
  gl,
182896
182897
  {
182897
182898
  id: "patient-dashboard-arrow",
@@ -182901,24 +182902,24 @@ const me2 = () => {
182901
182902
  padding: Dn.NONE
182902
182903
  }
182903
182904
  ) : void 0,
182904
- children: !s && d ? c ? e ?? o("ENTER_VISIT_DETAILS") : o("START_VISIT_TYPE", { visitType: d.name }) : ""
182905
+ children: !u && h ? i ? e ?? a("ENTER_VISIT_DETAILS") : a("START_VISIT_TYPE", { visitType: h.name }) : ""
182905
182906
  }
182906
182907
  ),
182907
- !c && /* @__PURE__ */ ae(
182908
+ !i && /* @__PURE__ */ ae(
182908
182909
  T5,
182909
182910
  {
182910
182911
  id: "visit-dropdown",
182911
182912
  "data-testid": "visit-type-dropdown",
182912
182913
  className: mf.visitDropdown,
182913
- items: u.filter(
182914
- (h) => h.uuid !== d?.uuid
182914
+ items: d.filter(
182915
+ (p) => p.uuid !== h?.uuid
182915
182916
  ),
182916
- itemToString: (h) => h ? o("START_VISIT_TYPE", { visitType: h.name }) : "",
182917
- onChange: ({ selectedItem: h }) => h && t(h),
182917
+ itemToString: (p) => p ? a("START_VISIT_TYPE", { visitType: p.name }) : "",
182918
+ onChange: ({ selectedItem: p }) => p && t(p),
182918
182919
  label: "",
182919
182920
  type: "inline",
182920
182921
  size: "lg",
182921
- disabled: s || u.length === 0,
182922
+ disabled: o || u || d.length === 0,
182922
182923
  titleText: "",
182923
182924
  selectedItem: null
182924
182925
  }
@@ -182930,50 +182931,53 @@ const me2 = () => {
182930
182931
  o.startsWith("#") ? r(o.slice(1)) : window.location.href = o;
182931
182932
  }, tst = ({
182932
182933
  extensionPointId: t,
182933
- onBeforeNavigate: e
182934
+ onBeforeNavigate: e,
182935
+ disabled: r = !1
182934
182936
  }) => {
182935
- const { t: r } = F1(), o = Y9(), a = Ca(), { createVisit: c } = Glt(), { filteredExtensions: i, isLoading: l } = Plt({
182937
+ const { t: o } = F1(), a = Y9(), c = Ca(), { createVisit: i } = Glt(), { filteredExtensions: l, isLoading: s } = Plt({
182936
182938
  extensionPointId: t
182937
- }), s = Object.fromEntries(
182938
- Object.entries(a).filter(([, p]) => p !== void 0)
182939
+ }), u = Object.fromEntries(
182940
+ Object.entries(c).filter(([, f]) => f !== void 0)
182939
182941
  );
182940
- if (l || i.length === 0)
182942
+ if (s || l.length === 0)
182941
182943
  return null;
182942
- const u = async (p) => {
182944
+ const d = async (f) => {
182943
182945
  if (!e) return;
182944
- const f = await e();
182945
- f && await c(f, p);
182946
- }, d = async (p) => {
182947
- !e || !await e() || p.url && JT1(p.url, s, o);
182948
- }, h = async (p) => {
182949
- !e || !await e() || p.url && JT1(p.url, s, o);
182946
+ const M = await e();
182947
+ M && await i(M, f);
182948
+ }, h = async (f) => {
182949
+ !e || !await e() || f.url && JT1(f.url, u, a);
182950
+ }, p = async (f) => {
182951
+ !e || !await e() || f.url && JT1(f.url, u, a);
182950
182952
  };
182951
- return /* @__PURE__ */ ae(J2, { children: i.map((p) => p.type === "startVisit" ? /* @__PURE__ */ ae(
182953
+ return /* @__PURE__ */ ae(J2, { children: l.map((f) => f.type === "startVisit" ? /* @__PURE__ */ ae(
182952
182954
  est,
182953
182955
  {
182954
- onVisitTypeSelect: (f) => u(f),
182955
- activeVisitLabel: r("PATIENT_DASHBOARD_REDIRECT"),
182956
- onActiveVisitClick: () => d(p),
182956
+ onVisitTypeSelect: (M) => d(M),
182957
+ activeVisitLabel: o("PATIENT_DASHBOARD_REDIRECT"),
182958
+ onActiveVisitClick: () => h(f),
182959
+ disabled: r,
182957
182960
  "data-testid": "visit-type-selector"
182958
182961
  },
182959
- p.id
182962
+ f.id
182960
182963
  ) : /* @__PURE__ */ ae(
182961
182964
  it,
182962
182965
  {
182963
- kind: p.kind ?? "primary",
182964
- onClick: () => h(p),
182966
+ kind: f.kind ?? "primary",
182967
+ onClick: () => p(f),
182968
+ disabled: r,
182965
182969
  "data-testid": "registration-action-button",
182966
- renderIcon: p.icon ? () => /* @__PURE__ */ ae(
182970
+ renderIcon: f.icon ? () => /* @__PURE__ */ ae(
182967
182971
  gl,
182968
182972
  {
182969
- id: p.id,
182970
- name: p.icon,
182973
+ id: f.id,
182974
+ name: f.icon,
182971
182975
  size: G3.SM
182972
182976
  }
182973
182977
  ) : void 0,
182974
- children: r(p.translationKey)
182978
+ children: o(f.translationKey)
182975
182979
  },
182976
- p.id
182980
+ f.id
182977
182981
  )) });
182978
182982
  }, rst = ["identifierTypes"], Mu = () => n2({
182979
182983
  queryKey: rst,
@@ -185332,7 +185336,8 @@ const d6t = [
185332
185336
  tst,
185333
185337
  {
185334
185338
  extensionPointId: "org.bahmni.registration.navigation",
185335
- onBeforeNavigate: F
185339
+ onBeforeNavigate: F,
185340
+ disabled: I
185336
185341
  }
185337
185342
  )
185338
185343
  ] })
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { av as s, at as t, au as E } from "./index-LWCdD7Wl.js";
1
+ import { av as s, at as t, au as E } from "./index-BWjmaYXp.js";
2
2
  export {
3
3
  s as IDENTIFIER_TYPES_QUERY_KEY,
4
4
  t as RegistrationApp,
@@ -1 +1 @@
1
- {"version":3,"file":"PatientRegister.d.ts","sourceRoot":"","sources":["../../../src/pages/PatientRegister/PatientRegister.tsx"],"names":[],"mappings":"AAwCA,QAAA,MAAM,eAAe,+CAyVpB,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"PatientRegister.d.ts","sourceRoot":"","sources":["../../../src/pages/PatientRegister/PatientRegister.tsx"],"names":[],"mappings":"AAwCA,QAAA,MAAM,eAAe,+CA0VpB,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -5,7 +5,8 @@ interface VisitTypeSelectorProps {
5
5
  }) => void;
6
6
  activeVisitLabel?: string;
7
7
  onActiveVisitClick?: () => void;
8
+ disabled?: boolean;
8
9
  }
9
- export declare const VisitTypeSelector: ({ onVisitTypeSelect, activeVisitLabel, onActiveVisitClick, }: VisitTypeSelectorProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const VisitTypeSelector: ({ onVisitTypeSelect, activeVisitLabel, onActiveVisitClick, disabled, }: VisitTypeSelectorProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export {};
11
12
  //# sourceMappingURL=visitTypeSelector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visitTypeSelector.d.ts","sourceRoot":"","sources":["../../../src/pages/PatientRegister/visitTypeSelector.tsx"],"names":[],"mappings":"AAcA,UAAU,sBAAsB;IAC9B,iBAAiB,EAAE,CAAC,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,iBAAiB,GAAI,8DAI/B,sBAAsB,4CA6ExB,CAAC"}
1
+ {"version":3,"file":"visitTypeSelector.d.ts","sourceRoot":"","sources":["../../../src/pages/PatientRegister/visitTypeSelector.tsx"],"names":[],"mappings":"AAcA,UAAU,sBAAsB;IAC9B,iBAAiB,EAAE,CAAC,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,GAAI,wEAK/B,sBAAsB,4CAiFxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/registration-app",
3
- "version": "0.0.1-dev.304",
3
+ "version": "0.0.1-dev.305",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",