@uxland/primary-shell 7.45.4 → 7.45.5

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 { E as s, d as e, z as t, B as r, P as n, b as o, v as l, Q as c, n as g, w as m, o as p, p as v, m as P, c as h, u as E, f as R, q as u, e as y, y as S, g as d, j as M, x as w, s as A, l as C, A as f } from "./index-B9r6-Xmj.js";
1
+ import { E as s, d as e, z as t, B as r, P as n, b as o, v as l, Q as c, n as g, w as m, o as p, p as v, m as P, c as h, u as E, f as R, q as u, e as y, y as S, g as d, j as M, x as w, s as A, l as C, A as f } from "./index-DCORE1l4.js";
2
2
  export {
3
3
  s as EcapEventManager,
4
4
  e as ExitShell,
@@ -721,7 +721,9 @@ ${J.searchString?.length>1?ke$1`
721
721
  </div>
722
722
  `,diagnosticHeaderTemplate=J=>J&&ke$1`
723
723
  ${J.diagnostics.filter(W=>W.descripcio!=null&&W.descripcio.trim()!=="").map(W=>ke$1`<dss-badge text=${W.descripcio?.toUpperCase()} state="info" size="sm" outlined hideIcon></dss-badge>`)}
724
- `;var __defProp$h=Object.defineProperty,__getOwnPropDesc$7=Object.getOwnPropertyDescriptor,__decorateClass$l=(J,W,X,te)=>{for(var re=te>1?void 0:te?__getOwnPropDesc$7(W,X):W,oe=J.length-1,ne;oe>=0;oe--)(ne=J[oe])&&(re=(te?ne(W,X,re):ne(re))||re);return te&&re&&__defProp$h(W,X,re),re};let ActivityHistoryImporter=class extends h$p{constructor(){super(...arguments),this.historyGroups=[],this.searchString="",this.rulesByCollectionId={},this.todayOnly=!1,this.selectedDiagnosticCodes=[],this.availableDiagnostics=[],this.filteredGroups=[],this.totalCount=0,this.selectedIds=[],this._virtualScrollerState=INITIAL_SCROLLER_STATE,this._scrollerController=new ScrollerController,this._searchTimeout=null,this._didInitialPreselect=!1,this._measureElement=J=>{J&&this._scrollerController.measureElement(J)}}render(){return ke$1`${template$f(this)}`}connectedCallback(){super.connectedCallback(),this.selectedIds=[],this._didInitialPreselect=!1;const J=this.api?.importDataManager?.getCurrentImportParams?.();this.availableDiagnostics=J?.diagnostics??[]}disconnectedCallback(){super.disconnectedCallback(),this._scrollerController.teardown(),this._clearSearchTimeout(),this.api.broker.send(new SearchActivityHistoryItems("")),this.selectedIds=[]}updated(J){super.updated(J),(J.has("historyGroups")||J.has("todayOnly")||J.has("selectedDiagnosticCodes"))&&this._recomputeFiltered(),!this._didInitialPreselect&&this.historyGroups?.length&&(this._didInitialPreselect=!0,this._preselectMatchingItems()),J.has("filteredGroups")&&this._syncVirtualScroller(),J.has("selectedIds")&&this._publishSelection()}_onSearchChange(J){typeof J.detail=="string"&&(this._clearSearchTimeout(),this._searchTimeout=window.setTimeout(()=>{this.api.broker.send(new SearchActivityHistoryItems(J.detail))},300))}_onToggleToday(J){this.todayOnly=J.target.checked}_onDiagnosticsChanged(J){const W=J.detail;this.selectedDiagnosticCodes=(W?.selectedItems||[]).map(X=>X.value)}_toggleItem(J){this.selectedIds=this.selectedIds.includes(J)?this.selectedIds.filter(W=>W!==J):[...this.selectedIds,J]}_toggleVisit(J,W){this._setSelection(flattenGroupItems([J]).map(X=>X.id),W)}_toggleSubGroup(J,W){this._setSelection(J.map(X=>X.id),W)}_toggleAll(J){this._setSelection(flattenGroupItems(this.filteredGroups).map(W=>W.id),J.target.checked)}isItemSelected(J){return this.selectedIds.includes(J)}visitState(J){return this._tristate(flattenGroupItems([J]).map(W=>W.id))}subGroupState(J){return this._tristate(J.map(W=>W.id))}allState(){return this._tristate(flattenGroupItems(this.filteredGroups).map(J=>J.id))}hasDiagnosticsFilter(){return this.availableDiagnostics.length>0}diagnosticsOptions(){return this.availableDiagnostics.map(J=>({label:J.description,value:J.code}))}get _visibleRows(){return this._virtualScrollerState.virtualItems.map(J=>({index:J.index,group:this.filteredGroups?.[J.index]})).filter(J=>!!J.group)}get _containerOffset(){return this._virtualScrollerState.virtualItems[0]?.start??0}get _totalHeight(){return this._virtualScrollerState.totalHeight}_clearSearchTimeout(){this._searchTimeout!==null&&(clearTimeout(this._searchTimeout),this._searchTimeout=null)}_setSelection(J,W){if(W){const X=J.filter(te=>!this.selectedIds.includes(te));X.length&&(this.selectedIds=[...this.selectedIds,...X])}else{const X=new Set(J);this.selectedIds=this.selectedIds.filter(te=>!X.has(te))}}_tristate(J){if(!J.length)return"none";const W=J.filter(X=>this.selectedIds.includes(X)).length;return W===0?"none":W===J.length?"all":"some"}async _recomputeFiltered(){const J={todayOnly:this.todayOnly,selectedDiagnosticCodes:this.selectedDiagnosticCodes},W=applyImporterFilters(this.historyGroups||[],J,this.rulesByCollectionId);this.filteredGroups=await prepareGroupComponents(W),this.totalCount=flattenGroupItems(this.filteredGroups).length}_syncVirtualScroller(){this._virtualScrollerState=this._scrollerController.sync({viewport:this._viewport,items:this.filteredGroups,estimateItemHeight:()=>200,onStateChange:J=>{this._virtualScrollerState=J,this.requestUpdate()}})}_preselectMatchingItems(){const J={diagnostics:this.availableDiagnostics},W=[],X=te=>{for(const re of te){const oe=re.type?this.rulesByCollectionId[re.type]:void 0;oe?.shouldPreselect&&oe.shouldPreselect(re,J)&&W.push(re.id)}};for(const te of this.historyGroups||[]){X(te.items||[]);for(const re of te.subGroups||[])X(re.items)}W.length&&(this.selectedIds=[...new Set([...this.selectedIds,...W])])}_publishSelection(){const J=new Set(this.selectedIds),W=(this.historyGroups||[]).map(X=>({...X,items:(X.items||[]).filter(te=>J.has(te.id)),subGroups:(X.subGroups||[]).map(te=>({...te,items:te.items.filter(re=>J.has(re.id))})).filter(te=>te.items.length>0)})).filter(X=>X.items.length>0||X.subGroups.length>0);this.api.importDataManager.selectItems({pluginId:pluginName,data:W,text:{raw:"",html:""}})}};ActivityHistoryImporter.styles=i$T`
724
+ `;var __defProp$h=Object.defineProperty,__getOwnPropDesc$7=Object.getOwnPropertyDescriptor,__decorateClass$l=(J,W,X,te)=>{for(var re=te>1?void 0:te?__getOwnPropDesc$7(W,X):W,oe=J.length-1,ne;oe>=0;oe--)(ne=J[oe])&&(re=(te?ne(W,X,re):ne(re))||re);return te&&re&&__defProp$h(W,X,re),re};const escapeHtml=J=>{const W=document.createElement("div");return W.textContent=J,W.innerHTML},buildSelectionText=J=>{const W=[],X=[];for(const te of J){const re=te.content?.plainText?.trim(),oe=te.content?.html?.trim();re&&W.push(re),oe?X.push(oe):re&&X.push(`<p>${escapeHtml(re)}</p>`)}return{raw:W.join(`
725
+
726
+ `),html:X.join("")}};let ActivityHistoryImporter=class extends h$p{constructor(){super(...arguments),this.historyGroups=[],this.searchString="",this.rulesByCollectionId={},this.todayOnly=!1,this.selectedDiagnosticCodes=[],this.availableDiagnostics=[],this.filteredGroups=[],this.totalCount=0,this.selectedIds=[],this._virtualScrollerState=INITIAL_SCROLLER_STATE,this._scrollerController=new ScrollerController,this._searchTimeout=null,this._didInitialPreselect=!1,this._measureElement=J=>{J&&this._scrollerController.measureElement(J)}}render(){return ke$1`${template$f(this)}`}connectedCallback(){super.connectedCallback(),this.selectedIds=[],this._didInitialPreselect=!1;const J=this.api?.importDataManager?.getCurrentImportParams?.();this.availableDiagnostics=J?.diagnostics??[]}disconnectedCallback(){super.disconnectedCallback(),this._scrollerController.teardown(),this._clearSearchTimeout(),this.api.broker.send(new SearchActivityHistoryItems("")),this.selectedIds=[]}updated(J){super.updated(J),(J.has("historyGroups")||J.has("todayOnly")||J.has("selectedDiagnosticCodes"))&&this._recomputeFiltered(),!this._didInitialPreselect&&this.historyGroups?.length&&(this._didInitialPreselect=!0,this._preselectMatchingItems()),J.has("filteredGroups")&&this._syncVirtualScroller(),J.has("selectedIds")&&this._publishSelection()}_onSearchChange(J){typeof J.detail=="string"&&(this._clearSearchTimeout(),this._searchTimeout=window.setTimeout(()=>{this.api.broker.send(new SearchActivityHistoryItems(J.detail))},300))}_onToggleToday(J){this.todayOnly=J.target.checked}_onDiagnosticsChanged(J){const W=J.detail;this.selectedDiagnosticCodes=(W?.selectedItems||[]).map(X=>X.value)}_toggleItem(J){this.selectedIds=this.selectedIds.includes(J)?this.selectedIds.filter(W=>W!==J):[...this.selectedIds,J]}_toggleVisit(J,W){this._setSelection(flattenGroupItems([J]).map(X=>X.id),W)}_toggleSubGroup(J,W){this._setSelection(J.map(X=>X.id),W)}_toggleAll(J){this._setSelection(flattenGroupItems(this.filteredGroups).map(W=>W.id),J.target.checked)}isItemSelected(J){return this.selectedIds.includes(J)}visitState(J){return this._tristate(flattenGroupItems([J]).map(W=>W.id))}subGroupState(J){return this._tristate(J.map(W=>W.id))}allState(){return this._tristate(flattenGroupItems(this.filteredGroups).map(J=>J.id))}hasDiagnosticsFilter(){return this.availableDiagnostics.length>0}diagnosticsOptions(){return this.availableDiagnostics.map(J=>({label:J.description,value:J.code}))}get _visibleRows(){return this._virtualScrollerState.virtualItems.map(J=>({index:J.index,group:this.filteredGroups?.[J.index]})).filter(J=>!!J.group)}get _containerOffset(){return this._virtualScrollerState.virtualItems[0]?.start??0}get _totalHeight(){return this._virtualScrollerState.totalHeight}_clearSearchTimeout(){this._searchTimeout!==null&&(clearTimeout(this._searchTimeout),this._searchTimeout=null)}_setSelection(J,W){if(W){const X=J.filter(te=>!this.selectedIds.includes(te));X.length&&(this.selectedIds=[...this.selectedIds,...X])}else{const X=new Set(J);this.selectedIds=this.selectedIds.filter(te=>!X.has(te))}}_tristate(J){if(!J.length)return"none";const W=J.filter(X=>this.selectedIds.includes(X)).length;return W===0?"none":W===J.length?"all":"some"}async _recomputeFiltered(){const J={todayOnly:this.todayOnly,selectedDiagnosticCodes:this.selectedDiagnosticCodes},W=applyImporterFilters(this.historyGroups||[],J,this.rulesByCollectionId);this.filteredGroups=await prepareGroupComponents(W),this.totalCount=flattenGroupItems(this.filteredGroups).length}_syncVirtualScroller(){this._virtualScrollerState=this._scrollerController.sync({viewport:this._viewport,items:this.filteredGroups,estimateItemHeight:()=>200,onStateChange:J=>{this._virtualScrollerState=J,this.requestUpdate()}})}_preselectMatchingItems(){const J={diagnostics:this.availableDiagnostics},W=[],X=te=>{for(const re of te){const oe=re.type?this.rulesByCollectionId[re.type]:void 0;oe?.shouldPreselect&&oe.shouldPreselect(re,J)&&W.push(re.id)}};for(const te of this.historyGroups||[]){X(te.items||[]);for(const re of te.subGroups||[])X(re.items)}W.length&&(this.selectedIds=[...new Set([...this.selectedIds,...W])])}_publishSelection(){const J=new Set(this.selectedIds),W=(this.historyGroups||[]).map(X=>({...X,items:(X.items||[]).filter(te=>J.has(te.id)),subGroups:(X.subGroups||[]).map(te=>({...te,items:te.items.filter(re=>J.has(re.id))})).filter(te=>te.items.length>0)})).filter(X=>X.items.length>0||X.subGroups.length>0);this.api.importDataManager.selectItems({pluginId:pluginName,data:W,text:buildSelectionText(flattenGroupItems(W))})}};ActivityHistoryImporter.styles=i$T`
725
727
  ${r$L(styles$e)}
726
728
  `,__decorateClass$l([lazyInject(TYPES.primaryApi)],ActivityHistoryImporter.prototype,"api",2),__decorateClass$l([connectedProperty(activityHistoryGroupedItems)],ActivityHistoryImporter.prototype,"historyGroups",2),__decorateClass$l([connectedProperty(activityHistorySearchStringSelector)],ActivityHistoryImporter.prototype,"searchString",2),__decorateClass$l([connectedProperty(historyDataImporterRulesByCollectionIdSelector)],ActivityHistoryImporter.prototype,"rulesByCollectionId",2),__decorateClass$l([r$I()],ActivityHistoryImporter.prototype,"todayOnly",2),__decorateClass$l([r$I()],ActivityHistoryImporter.prototype,"selectedDiagnosticCodes",2),__decorateClass$l([r$I()],ActivityHistoryImporter.prototype,"availableDiagnostics",2),__decorateClass$l([r$I()],ActivityHistoryImporter.prototype,"filteredGroups",2),__decorateClass$l([r$I()],ActivityHistoryImporter.prototype,"totalCount",2),__decorateClass$l([r$I()],ActivityHistoryImporter.prototype,"selectedIds",2),__decorateClass$l([e$S(".virtual-viewport")],ActivityHistoryImporter.prototype,"_viewport",2),__decorateClass$l([r$I()],ActivityHistoryImporter.prototype,"_virtualScrollerState",2),ActivityHistoryImporter=__decorateClass$l([t$y("activity-history-importer")],ActivityHistoryImporter);const styles$d=":host{display:flex;min-height:1px;height:100%;width:100%}.container{display:flex;flex-direction:column;width:100%;border:1px solid rgb(189,189,189);border-radius:var(--dss-radius-sm)}.container[maximized]{position:absolute;background:#fff;top:0;left:0;bottom:0;border:none}.container[maximized] .header-maximized-container{display:flex;flex-direction:column}.container[maximized] .header-maximized-container .header__maximized{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:24px;padding-top:12px;padding-bottom:12px;padding-inline:40px}.container[maximized] .header-maximized-container .header__maximized .header__maximized__search{flex:1;border-radius:8px;border:1px solid rgb(189,189,189);padding:8px;width:300px}.container[maximized] .header-maximized-container .header__maximized .title{color:var(--color-neutral-900);font-weight:700;font-size:20px;line-height:30px;white-space:nowrap}.container[maximized] .header-maximized-container .header__maximized .options{display:flex;align-items:center;color:var(--color-primary-400);font-weight:600;font-size:14px;line-height:24px;cursor:pointer}.container[maximized] .header-maximized-container .header__maximized .header__maximized__left{display:flex;flex-direction:row;gap:24px;align-items:center;width:100%}.container[maximized] .header-maximized-container .header__maximized .header__maximized__right{display:flex;flex-direction:row;gap:16px;align-items:center}.container[maximized] .wrapper{height:calc(100vh - 175px);border:1px solid rgb(189,189,189);border-radius:var(--dss-radius-sm);margin-bottom:24px;margin-inline:40px;width:calc(100% - 80px)}.container .header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid rgb(189,189,189);gap:16px}.container .header .header__left{display:flex;flex-direction:row;align-items:center;flex:1;gap:16px}.container .header .header__left .title{color:var(--color-neutral-800);font-weight:700;font-size:16px;line-height:24px;white-space:nowrap}.container .header .header__right{display:flex;flex-direction:row;align-items:center;gap:8px}.container .header .header__right .action-icons{display:flex;align-items:center}.container .wrapper{display:flex;flex-direction:row;min-height:1px;width:100%;height:100%}.container .wrapper[maximized] .content{width:100%;background:var(--color-neutral-50);border-top-right-radius:var(--dss-radius-sm);display:flex;flex-direction:column}.container .wrapper .content{width:100%;background:var(--color-neutral-50);border-bottom-right-radius:var(--dss-radius-sm);overflow:hidden;display:flex;flex-direction:column}",template$e=J=>ke$1`<div class="container" ?maximized=${J.maximized}>
727
729
  ${J.maximized?ke$1`${headerMaximizedTemplate(J)}`:ke$1`<div class="header">