@openmrs/esm-active-visits-app 4.0.2-pre.919 → 4.0.2-pre.930

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.
@@ -0,0 +1,15 @@
1
+ /*!
2
+ Copyright (c) 2018 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */
6
+
7
+ /**
8
+ * @license React
9
+ * use-sync-external-store-shim.production.min.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
package/dist/399.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_openmrs_esm_active_visits_app=self.webpackChunk_openmrs_esm_active_visits_app||[]).push([[399],{7935:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var a=i(2609),n=i.n(a)()((function(e){return e[1]}));n.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-active-visits__active-visits__productiveHeading01___5dzOt{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px)}.-esm-active-visits__active-visits__productiveHeading02___-o9Tn{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0)}.-esm-active-visits__active-visits__bodyLong01___xwAEE{font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px)}.-esm-active-visits__active-visits__caption01___e7sSC{font-size:var(--cds-legal-01-font-size, 0.75rem);font-weight:var(--cds-legal-01-font-weight, 400);line-height:var(--cds-legal-01-line-height, 1.33333);letter-spacing:var(--cds-legal-01-letter-spacing, 0.32px)}.-esm-active-visits__active-visits__bodyShort02___BiPkR{font-size:var(--cds-body-compact-02-font-size, 1rem);font-weight:var(--cds-body-compact-02-font-weight, 400);line-height:var(--cds-body-compact-02-line-height, 1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing, 0)}.-esm-active-visits__active-visits__text02___lkEHs{color:#525252}.-esm-active-visits__active-visits__text01___iTf3H{color:#161616}.-esm-active-visits__active-visits__activeVisitsContainer___XAE0K{background-color:#fff;border:1px solid #e0e0e0;width:100%;margin:0 auto;max-width:95vw}.-esm-active-visits__active-visits__activeVisitsDetailHeaderContainer___pjwhu{display:flex;justify-content:space-between;align-items:center;padding:.75rem 0 .75rem 1rem;background-color:#fff}.-esm-active-visits__active-visits__backgroundDataFetchingIndicator___YszBc{align-items:center;display:flex;flex:1 1 0%;justify-content:center}.-esm-active-visits__active-visits__tableContainer___27wfu section{position:relative}.-esm-active-visits__active-visits__tableContainer___27wfu a{text-decoration:none}.-esm-active-visits__active-visits__pagination___h8NbE{overflow:hidden}.-esm-active-visits__active-visits__pagination___h8NbE.cds--pagination{border-top:none}.-esm-active-visits__active-visits__hiddenRow___nho0Q{display:none}.-esm-active-visits__active-visits__emptyRow___jKDsj{padding:0 1rem;display:flex;align-items:center}.-esm-active-visits__active-visits__visitSummaryContainer___mBkXn{width:100%;max-width:768px;margin:1rem auto}.-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO>td>div{max-height:max-content !important}.-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO td{padding:0 2rem}.-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO th[colspan] td[colspan]>div:first-child{padding:0 1rem}.-esm-active-visits__active-visits__action___Kn0CE{margin-bottom:.5rem}.-esm-active-visits__active-visits__content___hF3rN{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-active-visits__active-visits__desktopHeading___3cKg8,.-esm-active-visits__active-visits__tabletHeading___vrNoH{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-active-visits__active-visits__desktopHeading___3cKg8 h4,.-esm-active-visits__active-visits__tabletHeading___vrNoH h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-active-visits__active-visits__desktopHeading___3cKg8 h4:after,.-esm-active-visits__active-visits__tabletHeading___vrNoH h4:after{content:"";display:block;width:2rem;padding-top:3px;border-bottom:.375rem solid;border-bottom-color:#007d79;border-bottom-color:var(--brand-03)}.-esm-active-visits__active-visits__tile___OJ1Dy{text-align:center}',""]),n.locals={productiveHeading01:"-esm-active-visits__active-visits__productiveHeading01___5dzOt",productiveHeading02:"-esm-active-visits__active-visits__productiveHeading02___-o9Tn",bodyLong01:"-esm-active-visits__active-visits__bodyLong01___xwAEE",caption01:"-esm-active-visits__active-visits__caption01___e7sSC",bodyShort02:"-esm-active-visits__active-visits__bodyShort02___BiPkR",text02:"-esm-active-visits__active-visits__text02___lkEHs",text01:"-esm-active-visits__active-visits__text01___iTf3H",activeVisitsContainer:"-esm-active-visits__active-visits__activeVisitsContainer___XAE0K",activeVisitsDetailHeaderContainer:"-esm-active-visits__active-visits__activeVisitsDetailHeaderContainer___pjwhu",backgroundDataFetchingIndicator:"-esm-active-visits__active-visits__backgroundDataFetchingIndicator___YszBc",tableContainer:"-esm-active-visits__active-visits__tableContainer___27wfu",pagination:"-esm-active-visits__active-visits__pagination___h8NbE",hiddenRow:"-esm-active-visits__active-visits__hiddenRow___nho0Q",emptyRow:"-esm-active-visits__active-visits__emptyRow___jKDsj",visitSummaryContainer:"-esm-active-visits__active-visits__visitSummaryContainer___mBkXn",expandedActiveVisitRow:"-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO",action:"-esm-active-visits__active-visits__action___Kn0CE",content:"-esm-active-visits__active-visits__content___hF3rN",desktopHeading:"-esm-active-visits__active-visits__desktopHeading___3cKg8",tabletHeading:"-esm-active-visits__active-visits__tabletHeading___vrNoH",tile:"-esm-active-visits__active-visits__tile___OJ1Dy"};const s=n},6824:function(e){e.exports=function(){"use strict";return function(e,t,i){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=i();return this.format(e)===t.format(e)}}}()},9399:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>A});var a=i(5206),n=i.n(a),s=i(1313),r=i(906),c=i(4924),o=function(e){var t=e.width,i=void 0===t?"64":t,a=e.height,s=void 0===a?"64":a;return n().createElement("svg",{width:i,height:s,viewBox:"0 0 64 64"},n().createElement("title",null,"Empty data illustration"),n().createElement("g",{fill:"none",fillRule:"evenodd"},n().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),n().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),n().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),n().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),n().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),n().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),n().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),n().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),n().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),n().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},l=i(9857),v=i(3565),_=i.n(v),d=i(6824),m=i.n(d);const u=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};_().extend(m());var p=i(6062),g=i.n(p),h=i(4036),f=i.n(h),y=i(6793),b=i.n(y),w=i(7892),E=i.n(w),x=i(1173),S=i.n(x),C=i(2464),H=i.n(C),k=i(7935),O={};O.styleTagTransform=H(),O.setAttributes=E(),O.insert=b().bind(null,"head"),O.domAPI=f(),O.insertStyleElement=S(),g()(k.Z,O);const D=k.Z&&k.Z.locals?k.Z.locals:void 0;function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}function N(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function z(){return z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},z.apply(this,arguments)}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a,n,s=[],r=!0,c=!1;try{for(i=i.call(e);!(r=(a=i.next()).done)&&(s.push(a.value),!t||s.length!==t);r=!0);}catch(e){c=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(c)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?V(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var j=function(e){var t=e.from,i=e.to,a=e.children;return n().createElement("a",{onClick:function(e){return function(e,i){e.preventDefault(),(0,r.navigate)({to:i}),localStorage.setItem("fromPage",t)}(e,i)},href:(0,r.interpolateUrl)(i)},a)};const A=function(){var e,t,i,v,d=(0,c.useTranslation)().t,m=(0,r.useConfig)(),p=(0,r.useLayoutType)(),g=function(){var e,t,i=(0,r.useSession)(),a=_()().format("YYYY-MM-DD"),n=null==i||null===(e=i.sessionLocation)||void 0===e?void 0:e.uuid,s="/ws/rest/v1/visit?includeInactive=false&v=".concat("custom:(uuid,patient:(uuid,identifiers:(identifier,uuid),person:(age,display,gender,uuid)),visitType:(uuid,name,display),location:(uuid,name,display),startDatetime,stopDatetime)&fromStartDate="+a+"&location="+n),c=(0,l.ZP)(n?s:null,r.openmrsFetch),o=c.data,v=c.error,d=c.isValidating,m=(null==o||null===(t=o.data)||void 0===t?void 0:t.results.length)?o.data.results.map((function(e){var t,i,a,n,s,r,c,o,l,v,_;return{age:null==e||null===(t=e.patient)||void 0===t||null===(i=t.person)||void 0===i?void 0:i.age,id:e.uuid,idNumber:null===(n=null==e||null===(a=e.patient)||void 0===a?void 0:a.identifiers[0])||void 0===n?void 0:n.identifier,gender:null==e||null===(s=e.patient)||void 0===s||null===(r=s.person)||void 0===r?void 0:r.gender,location:null==e||null===(c=e.location)||void 0===c?void 0:c.uuid,name:null==e||null===(o=e.patient)||void 0===o||null===(l=o.person)||void 0===l?void 0:l.display,patientUuid:null==e||null===(v=e.patient)||void 0===v?void 0:v.uuid,visitStartTime:null==e?void 0:e.startDatetime,visitType:null==e||null===(_=e.visitType)||void 0===_?void 0:_.display,visitUuid:e.uuid}})).filter((function(e){var t=e.visitStartTime;return _()(t).isToday()})):[];return{activeVisits:m,isLoading:!o&&!v,isError:v,isValidating:d}}(),h=g.activeVisits,f=(g.isError,g.isLoading),y=g.isValidating,b=null!==(i=null==m||null===(e=m.activeVisits)||void 0===e?void 0:e.pageSizes)&&void 0!==i?i:[10,20,30,40,50],w=T((0,a.useState)(null!==(v=null==m||null===(t=m.activeVisits)||void 0===t?void 0:t.pageSize)&&void 0!==v?v:10),2),E=w[0],x=w[1],S=T((0,a.useState)(""),2),C=S[0],H=S[1],k=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("/");return u(e)}(window.location.pathname),O=(0,a.useMemo)((function(){return[{id:0,header:d("visitStartTime","Visit Time"),key:"visitStartTime"},{id:1,header:d("idNumber","ID Number"),key:"idNumber"},{id:2,header:d("name","Name"),key:"name"},{id:3,header:d("gender","Gender"),key:"gender"},{id:4,header:d("age","Age"),key:"age"},{id:5,header:d("visitType","Visit Type"),key:"visitType"}]}),[d]),V=h.map((function(e){return t=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},a=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(i).filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable})))),a.forEach((function(t){N(e,t,i[t])}))}return e}({},e),i=null!=(i={visitStartTime:(0,r.formatDatetime)((0,r.parseDate)(e.visitStartTime))})?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):function(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);i.push.apply(i,a)}return i}(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})),t;var t,i})),A=(0,a.useMemo)((function(){if(C&&""!==C.trim()){var e=C.toLowerCase();return V.filter((function(t){return Object.keys(t).some((function(i){return"patientUuid"!==i&&"".concat(t[i]).toLowerCase().includes(e)}))}))}return V}),[C,V]),F=(0,r.usePagination)(A,E),P=F.goTo,R=F.results,L=F.currentPage,M=(0,a.useCallback)((function(e){return H(e.target.value)}),[]);return(0,a.useEffect)((function(){1!==L&&P(1)}),[C]),f?n().createElement(s.gqd,{role:"progressbar"}):(null==h?void 0:h.length)?n().createElement("div",{className:D.activeVisitsContainer},n().createElement("div",{className:D.activeVisitsDetailHeaderContainer},n().createElement("div",{className:(0,r.isDesktop)(p)?D.desktopHeading:D.tabletHeading},n().createElement("h4",null,d("activeVisits","Active Visits"))),n().createElement("div",{className:D.backgroundDataFetchingIndicator},n().createElement("span",null,y?n().createElement(s.lSo,null):null))),n().createElement(s.wQF,{rows:R,headers:O,size:(0,r.isDesktop)(p)?"xs":"md",useZebraStyles:(null==h?void 0:h.length)>1},(function(e){var t=e.rows,i=e.headers,a=e.getHeaderProps,c=e.getTableProps,o=e.getBatchActionProps,l=e.getRowProps;return n().createElement(s.xJi,{className:D.tableContainer},n().createElement(s.fjU,null,n().createElement(s.Vj0,null,n().createElement(s.olm,{tabIndex:o().shouldShowBatchActions?-1:0,labelText:"",placeholder:d("filterTable","Filter table"),onChange:M}))),n().createElement(s.iA_,z({className:D.activeVisitsTable},c()),n().createElement(s.ssF,null,n().createElement(s.SCH,null,n().createElement(s.MOD,null),i.map((function(e){return n().createElement(s.xDH,z({},a({header:e})),e.header)})))),n().createElement(s.RMI,null,t.map((function(e,t){var a,c;return n().createElement(n().Fragment,{key:t},n().createElement(s.RcE,z({},l({row:e})),e.cells.map((function(e){var i;return n().createElement(s.pj1,{key:e.id},"name"===e.info.header?n().createElement(j,{from:k,to:"${openmrsSpaBase}/patient/".concat(null==R||null===(i=R[t])||void 0===i?void 0:i.patientUuid,"/chart/")},e.value):e.value)}))),e.isExpanded?n().createElement(s.SCH,{className:D.expandedActiveVisitRow},n().createElement("th",{colSpan:i.length+2},n().createElement(r.ExtensionSlot,{className:D.visitSummaryContainer,extensionSlotName:"visit-summary-slot",state:{visitUuid:null===(a=R[t])||void 0===a?void 0:a.visitUuid,patientUuid:null===(c=R[t])||void 0===c?void 0:c.patientUuid}}))):n().createElement(s.WdL,{className:D.hiddenRow,colSpan:i.length+2}))})))),0===t.length&&n().createElement("p",{style:{height:(0,r.isDesktop)(p)?"2rem":"3rem",margin:"1rem 1.5rem"},className:"".concat(D.emptyRow," ").concat(D.bodyLong01)},d("noVisitsFound","No matching visits found")),n().createElement(s.tlE,{forwardText:"Next page",backwardText:"Previous page",page:L,pageSize:E,pageSizes:b,totalItems:A.length,className:D.pagination,onChange:function(e){var t=e.pageSize,i=e.page;t!==E&&x(t),i!==L&&P(i)}}))}))):n().createElement("div",{className:D.activeVisitsContainer},n().createElement(s.mh4,null,n().createElement(s.n9L,{className:D.tile},n().createElement("div",{className:(0,r.isDesktop)(p)?D.desktopHeading:D.tabletHeading},n().createElement("h4",null,d("activeVisits","Active Visits"))),n().createElement(o,null),n().createElement("p",{className:D.content},d("noActiveVisitsForLocation","There are no active visits to display for this location.")))))}}}]);
1
+ (self.webpackChunk_openmrs_esm_active_visits_app=self.webpackChunk_openmrs_esm_active_visits_app||[]).push([[399],{7935:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var a=i(2609),n=i.n(a)()((function(e){return e[1]}));n.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-active-visits__active-visits__productiveHeading01___5dzOt{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px)}.-esm-active-visits__active-visits__productiveHeading02___-o9Tn{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0)}.-esm-active-visits__active-visits__bodyLong01___xwAEE{font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px)}.-esm-active-visits__active-visits__caption01___e7sSC{font-size:var(--cds-legal-01-font-size, 0.75rem);font-weight:var(--cds-legal-01-font-weight, 400);line-height:var(--cds-legal-01-line-height, 1.33333);letter-spacing:var(--cds-legal-01-letter-spacing, 0.32px)}.-esm-active-visits__active-visits__bodyShort02___BiPkR{font-size:var(--cds-body-compact-02-font-size, 1rem);font-weight:var(--cds-body-compact-02-font-weight, 400);line-height:var(--cds-body-compact-02-line-height, 1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing, 0)}.-esm-active-visits__active-visits__text02___lkEHs{color:#525252}.-esm-active-visits__active-visits__text01___iTf3H{color:#161616}.-esm-active-visits__active-visits__activeVisitsContainer___XAE0K{background-color:#fff;border:1px solid #e0e0e0;width:100%;margin:0 auto;max-width:95vw}.-esm-active-visits__active-visits__activeVisitsDetailHeaderContainer___pjwhu{display:flex;justify-content:space-between;align-items:center;padding:.75rem 0 .75rem 1rem;background-color:#fff}.-esm-active-visits__active-visits__backgroundDataFetchingIndicator___YszBc{align-items:center;display:flex;flex:1 1 0%;justify-content:center}.-esm-active-visits__active-visits__tableContainer___27wfu section{position:relative}.-esm-active-visits__active-visits__tableContainer___27wfu a{text-decoration:none}.-esm-active-visits__active-visits__pagination___h8NbE{overflow:hidden}.-esm-active-visits__active-visits__pagination___h8NbE.cds--pagination{border-top:none}.-esm-active-visits__active-visits__hiddenRow___nho0Q{display:none}.-esm-active-visits__active-visits__emptyRow___jKDsj{padding:0 1rem;display:flex;align-items:center}.-esm-active-visits__active-visits__visitSummaryContainer___mBkXn{width:100%;max-width:768px;margin:1rem auto}.-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO>td>div{max-height:max-content !important}.-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO td{padding:0 2rem}.-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO th[colspan] td[colspan]>div:first-child{padding:0 1rem}.-esm-active-visits__active-visits__action___Kn0CE{margin-bottom:.5rem}.-esm-active-visits__active-visits__content___hF3rN{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-active-visits__active-visits__desktopHeading___3cKg8,.-esm-active-visits__active-visits__tabletHeading___vrNoH{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-active-visits__active-visits__desktopHeading___3cKg8 h4,.-esm-active-visits__active-visits__tabletHeading___vrNoH h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-active-visits__active-visits__desktopHeading___3cKg8 h4:after,.-esm-active-visits__active-visits__tabletHeading___vrNoH h4:after{content:"";display:block;width:2rem;padding-top:3px;border-bottom:.375rem solid;border-bottom-color:#007d79;border-bottom-color:var(--brand-03)}.-esm-active-visits__active-visits__tile___OJ1Dy{text-align:center}',""]),n.locals={productiveHeading01:"-esm-active-visits__active-visits__productiveHeading01___5dzOt",productiveHeading02:"-esm-active-visits__active-visits__productiveHeading02___-o9Tn",bodyLong01:"-esm-active-visits__active-visits__bodyLong01___xwAEE",caption01:"-esm-active-visits__active-visits__caption01___e7sSC",bodyShort02:"-esm-active-visits__active-visits__bodyShort02___BiPkR",text02:"-esm-active-visits__active-visits__text02___lkEHs",text01:"-esm-active-visits__active-visits__text01___iTf3H",activeVisitsContainer:"-esm-active-visits__active-visits__activeVisitsContainer___XAE0K",activeVisitsDetailHeaderContainer:"-esm-active-visits__active-visits__activeVisitsDetailHeaderContainer___pjwhu",backgroundDataFetchingIndicator:"-esm-active-visits__active-visits__backgroundDataFetchingIndicator___YszBc",tableContainer:"-esm-active-visits__active-visits__tableContainer___27wfu",pagination:"-esm-active-visits__active-visits__pagination___h8NbE",hiddenRow:"-esm-active-visits__active-visits__hiddenRow___nho0Q",emptyRow:"-esm-active-visits__active-visits__emptyRow___jKDsj",visitSummaryContainer:"-esm-active-visits__active-visits__visitSummaryContainer___mBkXn",expandedActiveVisitRow:"-esm-active-visits__active-visits__expandedActiveVisitRow___ONSwO",action:"-esm-active-visits__active-visits__action___Kn0CE",content:"-esm-active-visits__active-visits__content___hF3rN",desktopHeading:"-esm-active-visits__active-visits__desktopHeading___3cKg8",tabletHeading:"-esm-active-visits__active-visits__tabletHeading___vrNoH",tile:"-esm-active-visits__active-visits__tile___OJ1Dy"};const s=n},6824:function(e){e.exports=function(){"use strict";return function(e,t,i){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=i();return this.format(e)===t.format(e)}}}()},9399:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>A});var a=i(5206),n=i.n(a),s=i(1313),r=i(906),c=i(4924),o=function(e){var t=e.width,i=void 0===t?"64":t,a=e.height,s=void 0===a?"64":a;return n().createElement("svg",{width:i,height:s,viewBox:"0 0 64 64"},n().createElement("title",null,"Empty data illustration"),n().createElement("g",{fill:"none",fillRule:"evenodd"},n().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),n().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),n().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),n().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),n().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),n().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),n().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),n().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),n().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),n().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},l=i(9984),v=i(3565),_=i.n(v),d=i(6824),m=i.n(d);const u=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};_().extend(m());var p=i(6062),g=i.n(p),h=i(4036),f=i.n(h),y=i(6793),b=i.n(y),w=i(7892),E=i.n(w),x=i(1173),S=i.n(x),C=i(2464),H=i.n(C),k=i(7935),O={};O.styleTagTransform=H(),O.setAttributes=E(),O.insert=b().bind(null,"head"),O.domAPI=f(),O.insertStyleElement=S(),g()(k.Z,O);const D=k.Z&&k.Z.locals?k.Z.locals:void 0;function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}function N(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function z(){return z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},z.apply(this,arguments)}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a,n,s=[],r=!0,c=!1;try{for(i=i.call(e);!(r=(a=i.next()).done)&&(s.push(a.value),!t||s.length!==t);r=!0);}catch(e){c=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(c)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?V(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var j=function(e){var t=e.from,i=e.to,a=e.children;return n().createElement("a",{onClick:function(e){return function(e,i){e.preventDefault(),(0,r.navigate)({to:i}),localStorage.setItem("fromPage",t)}(e,i)},href:(0,r.interpolateUrl)(i)},a)};const A=function(){var e,t,i,v,d=(0,c.useTranslation)().t,m=(0,r.useConfig)(),p=(0,r.useLayoutType)(),g=function(){var e,t,i=(0,r.useSession)(),a=_()().format("YYYY-MM-DD"),n=null==i||null===(e=i.sessionLocation)||void 0===e?void 0:e.uuid,s="/ws/rest/v1/visit?includeInactive=false&v=".concat("custom:(uuid,patient:(uuid,identifiers:(identifier,uuid),person:(age,display,gender,uuid)),visitType:(uuid,name,display),location:(uuid,name,display),startDatetime,stopDatetime)&fromStartDate="+a+"&location="+n),c=(0,l.ZP)(n?s:null,r.openmrsFetch),o=c.data,v=c.error,d=c.isValidating,m=(null==o||null===(t=o.data)||void 0===t?void 0:t.results.length)?o.data.results.map((function(e){var t,i,a,n,s,r,c,o,l,v,_;return{age:null==e||null===(t=e.patient)||void 0===t||null===(i=t.person)||void 0===i?void 0:i.age,id:e.uuid,idNumber:null===(n=null==e||null===(a=e.patient)||void 0===a?void 0:a.identifiers[0])||void 0===n?void 0:n.identifier,gender:null==e||null===(s=e.patient)||void 0===s||null===(r=s.person)||void 0===r?void 0:r.gender,location:null==e||null===(c=e.location)||void 0===c?void 0:c.uuid,name:null==e||null===(o=e.patient)||void 0===o||null===(l=o.person)||void 0===l?void 0:l.display,patientUuid:null==e||null===(v=e.patient)||void 0===v?void 0:v.uuid,visitStartTime:null==e?void 0:e.startDatetime,visitType:null==e||null===(_=e.visitType)||void 0===_?void 0:_.display,visitUuid:e.uuid}})).filter((function(e){var t=e.visitStartTime;return _()(t).isToday()})):[];return{activeVisits:m,isLoading:!o&&!v,isError:v,isValidating:d}}(),h=g.activeVisits,f=(g.isError,g.isLoading),y=g.isValidating,b=null!==(i=null==m||null===(e=m.activeVisits)||void 0===e?void 0:e.pageSizes)&&void 0!==i?i:[10,20,30,40,50],w=T((0,a.useState)(null!==(v=null==m||null===(t=m.activeVisits)||void 0===t?void 0:t.pageSize)&&void 0!==v?v:10),2),E=w[0],x=w[1],S=T((0,a.useState)(""),2),C=S[0],H=S[1],k=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("/");return u(e)}(window.location.pathname),O=(0,a.useMemo)((function(){return[{id:0,header:d("visitStartTime","Visit Time"),key:"visitStartTime"},{id:1,header:d("idNumber","ID Number"),key:"idNumber"},{id:2,header:d("name","Name"),key:"name"},{id:3,header:d("gender","Gender"),key:"gender"},{id:4,header:d("age","Age"),key:"age"},{id:5,header:d("visitType","Visit Type"),key:"visitType"}]}),[d]),V=h.map((function(e){return t=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},a=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(i).filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable})))),a.forEach((function(t){N(e,t,i[t])}))}return e}({},e),i=null!=(i={visitStartTime:(0,r.formatDatetime)((0,r.parseDate)(e.visitStartTime))})?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):function(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);i.push.apply(i,a)}return i}(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})),t;var t,i})),A=(0,a.useMemo)((function(){if(C&&""!==C.trim()){var e=C.toLowerCase();return V.filter((function(t){return Object.keys(t).some((function(i){return"patientUuid"!==i&&"".concat(t[i]).toLowerCase().includes(e)}))}))}return V}),[C,V]),F=(0,r.usePagination)(A,E),P=F.goTo,R=F.results,L=F.currentPage,M=(0,a.useCallback)((function(e){return H(e.target.value)}),[]);return(0,a.useEffect)((function(){1!==L&&P(1)}),[C]),f?n().createElement(s.gqd,{role:"progressbar"}):(null==h?void 0:h.length)?n().createElement("div",{className:D.activeVisitsContainer},n().createElement("div",{className:D.activeVisitsDetailHeaderContainer},n().createElement("div",{className:(0,r.isDesktop)(p)?D.desktopHeading:D.tabletHeading},n().createElement("h4",null,d("activeVisits","Active Visits"))),n().createElement("div",{className:D.backgroundDataFetchingIndicator},n().createElement("span",null,y?n().createElement(s.lSo,null):null))),n().createElement(s.wQF,{rows:R,headers:O,size:(0,r.isDesktop)(p)?"xs":"md",useZebraStyles:(null==h?void 0:h.length)>1},(function(e){var t=e.rows,i=e.headers,a=e.getHeaderProps,c=e.getTableProps,o=e.getBatchActionProps,l=e.getRowProps;return n().createElement(s.xJi,{className:D.tableContainer},n().createElement(s.fjU,null,n().createElement(s.Vj0,null,n().createElement(s.olm,{tabIndex:o().shouldShowBatchActions?-1:0,labelText:"",placeholder:d("filterTable","Filter table"),onChange:M}))),n().createElement(s.iA_,z({className:D.activeVisitsTable},c()),n().createElement(s.ssF,null,n().createElement(s.SCH,null,n().createElement(s.MOD,null),i.map((function(e){return n().createElement(s.xDH,z({},a({header:e})),e.header)})))),n().createElement(s.RMI,null,t.map((function(e,t){var a,c;return n().createElement(n().Fragment,{key:t},n().createElement(s.RcE,z({},l({row:e})),e.cells.map((function(e){var i;return n().createElement(s.pj1,{key:e.id},"name"===e.info.header?n().createElement(j,{from:k,to:"${openmrsSpaBase}/patient/".concat(null==R||null===(i=R[t])||void 0===i?void 0:i.patientUuid,"/chart/")},e.value):e.value)}))),e.isExpanded?n().createElement(s.SCH,{className:D.expandedActiveVisitRow},n().createElement("th",{colSpan:i.length+2},n().createElement(r.ExtensionSlot,{className:D.visitSummaryContainer,extensionSlotName:"visit-summary-slot",state:{visitUuid:null===(a=R[t])||void 0===a?void 0:a.visitUuid,patientUuid:null===(c=R[t])||void 0===c?void 0:c.patientUuid}}))):n().createElement(s.WdL,{className:D.hiddenRow,colSpan:i.length+2}))})))),0===t.length&&n().createElement("p",{style:{height:(0,r.isDesktop)(p)?"2rem":"3rem",margin:"1rem 1.5rem"},className:"".concat(D.emptyRow," ").concat(D.bodyLong01)},d("noVisitsFound","No matching visits found")),n().createElement(s.tlE,{forwardText:"Next page",backwardText:"Previous page",page:L,pageSize:E,pageSizes:b,totalItems:A.length,className:D.pagination,onChange:function(e){var t=e.pageSize,i=e.page;t!==E&&x(t),i!==L&&P(i)}}))}))):n().createElement("div",{className:D.activeVisitsContainer},n().createElement(s.mh4,null,n().createElement(s.n9L,{className:D.tile},n().createElement("div",{className:(0,r.isDesktop)(p)?D.desktopHeading:D.tabletHeading},n().createElement("h4",null,d("activeVisits","Active Visits"))),n().createElement(o,null),n().createElement("p",{className:D.content},d("noActiveVisitsForLocation","There are no active visits to display for this location.")))))}}}]);
@@ -19,7 +19,7 @@
19
19
  "150.js"
20
20
  ],
21
21
  "auxiliaryFiles": [],
22
- "hash": "7bd98a25e35e7c5b6c2d",
22
+ "hash": "6eab5e646682eda4b561",
23
23
  "childrenByOrder": {}
24
24
  },
25
25
  {
@@ -45,7 +45,7 @@
45
45
  "main.js"
46
46
  ],
47
47
  "auxiliaryFiles": [],
48
- "hash": "d2ed69eb3ed16c294cb4",
48
+ "hash": "e9f2412a2a9fdfd9317a",
49
49
  "childrenByOrder": {}
50
50
  },
51
51
  {
@@ -67,7 +67,7 @@
67
67
  "184.js"
68
68
  ],
69
69
  "auxiliaryFiles": [],
70
- "hash": "ce7aa3ae65d1e3a2fce9",
70
+ "hash": "a33512414e3e60f9746d",
71
71
  "childrenByOrder": {}
72
72
  },
73
73
  {
@@ -159,6 +159,31 @@
159
159
  "hash": "037e43727076747e18e0",
160
160
  "childrenByOrder": {}
161
161
  },
162
+ {
163
+ "rendered": true,
164
+ "initial": false,
165
+ "entry": false,
166
+ "recorded": false,
167
+ "reason": "split chunk (cache group: defaultVendors)",
168
+ "size": 1743161,
169
+ "sizes": {
170
+ "javascript": 1743161
171
+ },
172
+ "names": [],
173
+ "idHints": [
174
+ "vendors"
175
+ ],
176
+ "runtime": [
177
+ "@openmrs/esm-active-visits-app",
178
+ "main"
179
+ ],
180
+ "files": [
181
+ "357.js"
182
+ ],
183
+ "auxiliaryFiles": [],
184
+ "hash": "25e38c7d87b7e13a7e6a",
185
+ "childrenByOrder": {}
186
+ },
162
187
  {
163
188
  "rendered": true,
164
189
  "initial": false,
@@ -179,7 +204,7 @@
179
204
  "399.js"
180
205
  ],
181
206
  "auxiliaryFiles": [],
182
- "hash": "25683800aff75968ce10",
207
+ "hash": "c991ce4c276d18c1a08b",
183
208
  "childrenByOrder": {}
184
209
  },
185
210
  {
@@ -254,31 +279,6 @@
254
279
  "hash": "d6efc5afa65bf72e3dba",
255
280
  "childrenByOrder": {}
256
281
  },
257
- {
258
- "rendered": true,
259
- "initial": false,
260
- "entry": false,
261
- "recorded": false,
262
- "reason": "split chunk (cache group: defaultVendors)",
263
- "size": 1741731,
264
- "sizes": {
265
- "javascript": 1741731
266
- },
267
- "names": [],
268
- "idHints": [
269
- "vendors"
270
- ],
271
- "runtime": [
272
- "@openmrs/esm-active-visits-app",
273
- "main"
274
- ],
275
- "files": [
276
- "723.js"
277
- ],
278
- "auxiliaryFiles": [],
279
- "hash": "dc334e04506b18642cc8",
280
- "childrenByOrder": {}
281
- },
282
282
  {
283
283
  "rendered": true,
284
284
  "initial": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-active-visits-app",
3
- "version": "4.0.2-pre.919",
3
+ "version": "4.0.2-pre.930",
4
4
  "description": "Active visits widget microfrontend for the OpenMRS SPA",
5
5
  "browser": "dist/openmrs-esm-active-visits-app.js",
6
6
  "main": "src/index.ts",
@@ -47,5 +47,5 @@
47
47
  "devDependencies": {
48
48
  "webpack": "^5.74.0"
49
49
  },
50
- "gitHead": "1629f136c047def89ac14e6ef4302be80ad28f0b"
50
+ "gitHead": "e4902663a653e3ca317952e8a2e0eecc3396f9d2"
51
51
  }
@@ -1,20 +0,0 @@
1
- /*!
2
- Copyright (c) 2018 Jed Watson.
3
- Licensed under the MIT License (MIT), see
4
- http://jedwatson.github.io/classnames
5
- */
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */