@uxland/primary-shell 6.0.1 → 6.0.3

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.
@@ -448,7 +448,7 @@ ${((J=te.searchString)==null?void 0:J.length)>1?ke$1`
448
448
  ${r$F(J)}
449
449
  </style>
450
450
  ${template$k(this)}
451
- `}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.renderGroupsControlTimeExpired=!0},8e3)}disconnectedCallback(){super.disconnectedCallback()}async updated(te){var J;te.has("historyGroups")&&((J=this.historyGroups)!=null&&J.length)&&await this.prepareComponents(this.historyGroups)}async prepareComponents(te){for(const J of te){J.items=await Promise.all(J.items.map(async X=>({...X,component:await X.componentFactory({item:X})})));for(const X of J.subGroups)X.items=await Promise.all(X.items.map(async re=>({...re,component:await re.componentFactory({item:re})})))}this.requestUpdate()}highlightMatch(te,J){if(!this.searchString||this.searchString.length<2)return te;const X=new RegExp(`(${J})`,"gi");return te.replace(X,'<span class="highlight">$1</span>')}highlighted(te){return te?ae(this.highlightMatch(te,this.searchString)):null}_scrollIntoDate(te){let J=-1,X=Number.POSITIVE_INFINITY;(this.historyGroups??[]).forEach((re,ne)=>{var he,ue,pe,fe,ge,me;const oe=((ue=(he=re.items)==null?void 0:he[0])==null?void 0:ue.date)||((me=(ge=(fe=(pe=re.subGroups)==null?void 0:pe[0])==null?void 0:fe.items)==null?void 0:ge[0])==null?void 0:me.date);if(!oe)return;const de=new Date(oe).getTime(),ce=Math.abs(de-te);ce<X&&(X=ce,J=ne)}),J!==-1&&this._virtualizer&&this._virtualizer[virtualizerRef].element(J).scrollIntoView()}};ActivityHistoryTimeline.styles=i$w`
451
+ `}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.renderGroupsControlTimeExpired=!0},8e3)}disconnectedCallback(){super.disconnectedCallback()}async updated(te){var J;te.has("historyGroups")&&((J=this.historyGroups)!=null&&J.length)&&await this.prepareComponents(this.historyGroups)}async prepareComponents(te){for(const J of te){J.items=await Promise.all(J.items.map(async X=>({...X,component:await X.componentFactory({item:X})})));for(const X of J.subGroups)X.items=await Promise.all(X.items.map(async re=>({...re,component:await re.componentFactory({item:re})})))}this.requestUpdate()}highlightMatch(te,J){if(!this.searchString||this.searchString.length<2)return te;const X=new RegExp(`(${J})`,"gi");return te.replace(X,'<span class="highlight">$1</span>')}highlighted(te){return te?ae(this.highlightMatch(te,this.searchString)):null}_scrollIntoDate(te){let J=-1,X=Number.POSITIVE_INFINITY;(this.historyGroups??[]).forEach((re,ne)=>{var he,ue,pe,fe,ge,me;const oe=((ue=(he=re.items)==null?void 0:he[0])==null?void 0:ue.date)||((me=(ge=(fe=(pe=re.subGroups)==null?void 0:pe[0])==null?void 0:fe.items)==null?void 0:ge[0])==null?void 0:me.date);if(!oe)return;const de=new Date(oe).getTime(),ce=Math.abs(de-te);ce<X&&(X=ce,J=ne)}),J!==-1&&this._virtualizer&&this._virtualizer[virtualizerRef].element(J).scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}};ActivityHistoryTimeline.styles=i$w`
452
452
  ${r$F(styles$j)}
453
453
  `,__decorateClass$r([connectedProperty(activityHistoryGroupedItems)],ActivityHistoryTimeline.prototype,"historyGroups",2),__decorateClass$r([connectedProperty(isCollectionInitialState)],ActivityHistoryTimeline.prototype,"isCollectionInitialState",2),__decorateClass$r([connectedProperty(isSomeCollectionLoadedAndOtherLoading)],ActivityHistoryTimeline.prototype,"isSomeCollectionLoadedAndOtherLoading",2),__decorateClass$r([connectedProperty(activityHistorySearchStringSelector)],ActivityHistoryTimeline.prototype,"searchString",2),__decorateClass$r([e$O(".virtualizer")],ActivityHistoryTimeline.prototype,"_virtualizer",2),__decorateClass$r([r$C()],ActivityHistoryTimeline.prototype,"renderGroupsControlTimeExpired",2),ActivityHistoryTimeline=__decorateClass$r([t$k("activity-history-timeline")],ActivityHistoryTimeline);/**
454
454
  * @license
@@ -6874,7 +6874,7 @@ ${((J=te.searchString)==null?void 0:J.length)>1?ke$1`
6874
6874
  ${r$F(styles)}
6875
6875
  `;let PrimariaCharacterLimitBadge=sr;__decorateClass$1([n$z({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass$1([n$z({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass$1([n$z({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$k("primaria-content-switcher")(PrimariaContentSwitcher),t$k("primaria-nav-item")(PrimariaNavItem),t$k("primaria-rich-text-editor")(PrimariaRichTextEditor),t$k("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$k("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},template=te=>ke$1`
6876
6876
  <dss-action-menu-item @click=${te.callbackFn} notificationsstate="error" rightIcon=${te.icon} label=${te.label}></dss-action-menu-item>
6877
- `;var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp(J,X,ne),ne};let QuickActionItem=class extends h$m{constructor(te,J,X){super(),this.icon="",this.label="",this.callbackFn=()=>{},this.icon=te,this.label=J,this.callbackFn=X}render(){return ke$1`${template(this)}`}};__decorateClass([n$z({type:String})],QuickActionItem.prototype,"icon",2),__decorateClass([n$z({type:String})],QuickActionItem.prototype,"label",2),__decorateClass([n$z({attribute:!1})],QuickActionItem.prototype,"callbackFn",2),QuickActionItem=__decorateClass([t$k("quick-action-item")],QuickActionItem);const upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"Proces d'atenció - ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR")},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VALORACIO_SOCIAL")}]},{id:"unique-petition",icon:"playlist_add",label:"Peticionari",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC")},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES")},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET")}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>navigateToEcapWithoutClosingWithCip("GABINETS_PROVES")},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_ACTIVA")},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT")},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT")},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_SOCIAL")}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS")},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerCommunicationNavMenuItem=()=>{shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:"communication",sortHint:"0120",factory:()=>{const te=new CommunicationActionMenu("3p","Comunicació");return Promise.resolve(te)}})},registerCommunicationMenuActions=()=>{const te=[{id:"1",sortHint:"0010",icon:"open_in_new",label:"SMS",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"2",sortHint:"0020",icon:"open_in_new",label:"eConsulta",callbackFn:async()=>{const J=await getPatientCip(shellApi),X=await shellApi.broker.send(new GetVisitId);shellApi.ecapEventManager.publish("NAVEGACIO_ECAP_ECONSULTA","NO_TANCAR",{CIP:J||"",VisiID:X||""})}},{id:"3",icon:"open_in_new",label:"Mail",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("COMUNICACIO_MISSATGES_CREAR","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"4",sortHint:"0030",icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")}];for(const J of te)shellApi.regionManager.registerView(shellRegions.communicationSidenav,{id:J.id,sortHint:J.sortHint,factory:()=>{new PrimariaNavItem({icon:J.icon,label:J.label,callbackFn:J.callbackFn});const X=new QuickActionItem(J.icon,J.label,J.callbackFn);return Promise.resolve(X)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerCommunicationNavMenuItem(),registerUpperNavMenuViews(),registerCommunicationMenuActions()},useUI=()=>{p$g.registerAdapterFactory("primaria-content-switcher",d$w),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$L.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$s.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
6877
+ `;var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp(J,X,ne),ne};let QuickActionItem=class extends h$m{constructor(te,J,X){super(),this.icon="",this.label="",this.callbackFn=()=>{},this.icon=te,this.label=J,this.callbackFn=X}render(){return ke$1`${template(this)}`}};__decorateClass([n$z({type:String})],QuickActionItem.prototype,"icon",2),__decorateClass([n$z({type:String})],QuickActionItem.prototype,"label",2),__decorateClass([n$z({attribute:!1})],QuickActionItem.prototype,"callbackFn",2),QuickActionItem=__decorateClass([t$k("quick-action-item")],QuickActionItem);const upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"Proces d'atenció - ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR")},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VALORACIO_SOCIAL")}]},{id:"unique-petition",icon:"playlist_add",label:"Peticionari",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC")},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES")},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET")}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>navigateToEcapWithoutClosingWithCip("GABINETS_PROVES")},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_ACTIVA")},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT")},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT")},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_SOCIAL")}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS")},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerCommunicationNavMenuItem=()=>{shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:"communication",sortHint:"0120",factory:()=>{const te=new CommunicationActionMenu("3p","Comunicació");return Promise.resolve(te)}})},registerCommunicationMenuActions=()=>{const te=[{id:"1",sortHint:"0010",icon:"open_in_new",label:"SMS",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"2",sortHint:"0020",icon:"open_in_new",label:"eConsulta",callbackFn:async()=>{const J=await getPatientCip(shellApi),X=await shellApi.broker.send(new GetVisitId);shellApi.ecapEventManager.publish("NAVEGACIO_ECAP_ECONSULTA","NO_TANCAR",{CIP:J||"",VisiID:X||""})}},{id:"3",icon:"open_in_new",label:"Mail",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("COMUNICACIO_MISSATGES_CREAR","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"4",sortHint:"0030",icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")}];for(const J of te)shellApi.regionManager.registerView(shellRegions.communicationSidenav,{id:J.id,sortHint:J.sortHint,factory:()=>{new PrimariaNavItem({icon:J.icon,label:J.label,callbackFn:J.callbackFn});const X=new QuickActionItem(J.icon,J.label,J.callbackFn);return Promise.resolve(X)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerCommunicationNavMenuItem(),registerUpperNavMenuViews(),registerCommunicationMenuActions()},useUI=()=>{p$g.registerAdapterFactory("primaria-content-switcher",d$w),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%",J.style.height="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$L.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$s.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
6878
6878
  * @license
6879
6879
  * Copyright 2021 Google LLC
6880
6880
  * SPDX-License-Identifier: BSD-3-Clause