@uxland/primary-shell 7.45.13 → 7.45.14

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-DrVXqD1i.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-DR063Ch1.js";
2
2
  export {
3
3
  s as EcapEventManager,
4
4
  e as ExitShell,
@@ -722,7 +722,7 @@ ${X.searchString?.length>1?ke$1`
722
722
  </div>
723
723
  `,diagnosticHeaderTemplate=X=>X&&ke$1`
724
724
  ${X.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>`)}
725
- `;var __defProp$h=Object.defineProperty,__getOwnPropDesc$7=Object.getOwnPropertyDescriptor,__decorateClass$l=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$7(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=(re?de(W,te,oe):de(oe))||oe);return re&&oe&&__defProp$h(W,te,oe),oe};const escapeHtml=X=>{const W=document.createElement("div");return W.textContent=X,W.innerHTML},buildSelectionText=X=>{const W=[],te=[];for(const re of X){const oe=re.content?.plainText?.trim(),ne=re.content?.html?.trim();oe&&W.push(oe),ne?te.push(ne):oe&&te.push(`<p>${escapeHtml(oe)}</p>`)}return{raw:W.join(`
725
+ `;var __defProp$h=Object.defineProperty,__getOwnPropDesc$7=Object.getOwnPropertyDescriptor,__decorateClass$l=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$7(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=(re?de(W,te,oe):de(oe))||oe);return re&&oe&&__defProp$h(W,te,oe),oe};const escapeHtml=X=>{const W=document.createElement("div");return W.textContent=X,W.innerHTML},ALLOWED_HTML_TAGS=["p","br","span","div","strong","em","u","s","sub","sup","b","i","a","code","pre","blockquote","h1","h2","h3","h4","h5","h6","ul","ol","li"],strayLessThan=new RegExp(`<(?!/?(?:${ALLOWED_HTML_TAGS.join("|")})\\b)`,"gi"),escapeUnknownTags=X=>X.replace(strayLessThan,"&lt;"),buildSelectionText=X=>{const W=[],te=[];for(const re of X){const oe=re.content?.plainText?.trim(),ne=re.content?.html?.trim();oe&&W.push(oe),ne?te.push(escapeUnknownTags(ne)):oe&&te.push(`<p>${escapeHtml(oe)}</p>`)}return{raw:W.join(`
726
726
 
727
727
  `),html:te.join("")}};let ActivityHistoryImporter=class extends h$n{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=X=>{X&&this._scrollerController.measureElement(X)}}render(){return ke$1`${template$f(this)}`}connectedCallback(){super.connectedCallback(),this.selectedIds=[],this._didInitialPreselect=!1;const X=this.api?.importDataManager?.getCurrentImportParams?.();this.availableDiagnostics=X?.diagnostics??[]}disconnectedCallback(){super.disconnectedCallback(),this._scrollerController.teardown(),this._clearSearchTimeout(),this.api.broker.send(new SearchActivityHistoryItems(""))}updated(X){super.updated(X),(X.has("historyGroups")||X.has("todayOnly")||X.has("selectedDiagnosticCodes"))&&this._recomputeFiltered(),!this._didInitialPreselect&&this.historyGroups?.length&&(this._didInitialPreselect=!0,this._preselectMatchingItems()),X.has("filteredGroups")&&this._syncVirtualScroller(),X.has("selectedIds")&&this._publishSelection()}_onSearchChange(X){typeof X.detail=="string"&&(this._clearSearchTimeout(),this._searchTimeout=window.setTimeout(()=>{this.api.broker.send(new SearchActivityHistoryItems(X.detail))},300))}_onToggleToday(X){this.todayOnly=X.target.checked}_onDiagnosticsChanged(X){const W=X.detail;this.selectedDiagnosticCodes=(W?.selectedItems||[]).map(te=>te.value)}_toggleItem(X){this.selectedIds=this.selectedIds.includes(X)?this.selectedIds.filter(W=>W!==X):[...this.selectedIds,X]}_toggleVisit(X,W){this._setSelection(flattenGroupItems([X]).map(te=>te.id),W)}_toggleSubGroup(X,W){this._setSelection(X.map(te=>te.id),W)}_toggleAll(X){this._setSelection(flattenGroupItems(this.filteredGroups).map(W=>W.id),X.target.checked)}isItemSelected(X){return this.selectedIds.includes(X)}visitState(X){return this._tristate(flattenGroupItems([X]).map(W=>W.id))}subGroupState(X){return this._tristate(X.map(W=>W.id))}allState(){return this._tristate(flattenGroupItems(this.filteredGroups).map(X=>X.id))}hasDiagnosticsFilter(){return this.availableDiagnostics.length>0}diagnosticsOptions(){return this.availableDiagnostics.map(X=>({label:X.description,value:X.code}))}get _visibleRows(){return this._virtualScrollerState.virtualItems.map(X=>({index:X.index,group:this.filteredGroups?.[X.index]})).filter(X=>!!X.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(X,W){if(W){const te=X.filter(re=>!this.selectedIds.includes(re));te.length&&(this.selectedIds=[...this.selectedIds,...te])}else{const te=new Set(X);this.selectedIds=this.selectedIds.filter(re=>!te.has(re))}}_tristate(X){if(!X.length)return"none";const W=X.filter(te=>this.selectedIds.includes(te)).length;return W===0?"none":W===X.length?"all":"some"}async _recomputeFiltered(){const X={todayOnly:this.todayOnly,selectedDiagnosticCodes:this.selectedDiagnosticCodes},W=applyImporterFilters(this.historyGroups||[],X,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:X=>{this._virtualScrollerState=X,this.requestUpdate()}})}_preselectMatchingItems(){const X={diagnostics:this.availableDiagnostics},W=[],te=re=>{for(const oe of re){const ne=oe.type?this.rulesByCollectionId[oe.type]:void 0;ne?.shouldPreselect&&ne.shouldPreselect(oe,X)&&W.push(oe.id)}};for(const re of this.historyGroups||[]){te(re.items||[]);for(const oe of re.subGroups||[])te(oe.items)}W.length&&(this.selectedIds=[...new Set([...this.selectedIds,...W])])}_publishSelection(){const X=new Set(this.selectedIds),W=(this.historyGroups||[]).map(te=>({...te,items:(te.items||[]).filter(re=>X.has(re.id)),subGroups:(te.subGroups||[]).map(re=>({...re,items:re.items.filter(oe=>X.has(oe.id))})).filter(re=>re.items.length>0)})).filter(te=>te.items.length>0||te.subGroups.length>0);this.api.importDataManager.selectItems({pluginId:pluginName,data:W,text:buildSelectionText(flattenGroupItems(W))})}};ActivityHistoryImporter.styles=i$R`
728
728
  ${r$K(styles$e)}