@qaecy/cue-ui 0.0.35 → 0.0.37
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/112.js +1 -1
- package/376.js +1 -1
- package/382.js +1 -0
- package/493.js +1 -1
- package/5.js +1 -1
- package/611.js +1 -1
- package/675.js +1 -0
- package/773.js +1 -1
- package/834.js +1 -0
- package/872.js +1 -0
- package/953.js +1 -0
- package/README.md +63 -2
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/368.js +0 -1
- package/446.js +0 -1
- package/499.js +0 -1
- package/919.js +0 -1
package/919.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[919],{3183(k,O,c){c.d(O,{A:()=>g});var v=c(7705),r=c(5802),_=c(9417),m=c(1359),b=c(8957),E=c(2245),y=c(5381),s=c(5547);const l=(h,u)=>u.value;function d(h,u){if(1&h){const n=s.RV6();s.j41(0,"cue-input",6),s.bIt("valueChange",function(t){r.eBV(n);const e=s.XpG();return e.searchText=t,r.Njj(e.onSearchChange())}),s.k0s()}if(2&h){const n=s.XpG();s.Y8G("value",n.searchText)}}function x(h,u){if(1&h){const n=s.RV6();s.j41(0,"cue-checkbox",7),s.bIt("checkedChange",function(t){const e=r.eBV(n).$implicit,o=s.XpG();return e.selected=t,r.Njj(o.onSelectionChange())}),s.k0s()}if(2&h){const n=u.$implicit;s.Y8G("label",n.value||"(blank)")("checked",n.selected)}}function T(h,u){1&h&&(s.j41(0,"cue-typography",5),s.EFF(1,"No results"),s.k0s())}let g=(()=>{class h{_cdr=(0,r.WQX)(v.gRc);_params;options=[];filteredOptions=[];searchText="";agInit(n){this._params=n}afterGuiAttached(n){this._refreshOptions(),this._cdr.markForCheck()}onNewRowsLoaded(){this._refreshOptions(),this._cdr.markForCheck()}isFilterActive(){return this.options.some(n=>!n.selected)}doesFilterPass(n){const a=new Set(this.options.filter(i=>i.selected).map(i=>i.value)),t=this._params.getValue(n.node),e=null==t?"":String(t);return"..."===e||"Loading..."===e||(""===e?a.has(""):e.split(", ").map(i=>i.trim()).some(i=>a.has(i)))}getModel(){return this.isFilterActive()?{selectedValues:this.options.filter(n=>n.selected).map(n=>n.value)}:null}setModel(n){if(n){const a=new Set(n.selectedValues);this.options.forEach(t=>t.selected=a.has(t.value))}else this.options.forEach(a=>a.selected=!0);this._applySearch(),this._cdr.markForCheck()}onSelectionChange(){this._params.filterChangedCallback(),this._cdr.markForCheck()}onSearchChange(){this._applySearch(),this._cdr.markForCheck()}get allSelected(){return this.options.length>0&&this.options.every(n=>n.selected)}toggleAll(n){this.options.forEach(a=>a.selected=n),this._applySearch(),this._params.filterChangedCallback(),this._cdr.markForCheck()}_refreshOptions(){const n=new Set;this._params.api.forEachNode(t=>{const e=this._params.getValue(t);if(null==e||""===e)n.add("");else{const o=String(e);if("..."===o||"Loading..."===o)return;const i=o.split(", ").map(f=>f.trim());for(const f of i)n.add(f)}});const a=new Map(this.options.map(t=>[t.value,t.selected]));this.options=Array.from(n).sort((t,e)=>t.localeCompare(e)).map(t=>({value:t,selected:a.get(t)??!0})),this._applySearch()}_applySearch(){const n=this.searchText.toLowerCase().trim();this.filteredOptions=n?this.options.filter(a=>a.value.toLowerCase().includes(n)):this.options}static \u0275fac=function(a){return new(a||h)};static \u0275cmp=s.VBU({type:h,selectors:[["cue-multi-select-filter"]],decls:7,vars:3,consts:[["direction","column","gap","s"],["placeholder","Search...","size","s",3,"value"],["size","s","label","Select all",3,"checkedChange","checked"],[1,"msf-list"],["size","s",3,"label","checked"],["size","s"],["placeholder","Search...","size","s",3,"valueChange","value"],["size","s",3,"checkedChange","label","checked"]],template:function(a,t){1&a&&(s.j41(0,"cue-flexcontainer",0),s.nVh(1,d,1,1,"cue-input",1),s.j41(2,"cue-checkbox",2),s.bIt("checkedChange",function(o){return t.toggleAll(o)}),s.k0s(),s.j41(3,"div",3),s.Z7z(4,x,1,2,"cue-checkbox",4,l),s.nVh(6,T,2,0,"cue-typography",5),s.k0s()()),2&a&&(s.R7$(),s.vxM(t.options.length>10?1:-1),s.R7$(),s.Y8G("checked",t.allSelected),s.R7$(2),s.Dyx(t.filteredOptions),s.R7$(2),s.vxM(0===t.filteredOptions.length?6:-1))},dependencies:[_.YN,m.S,b.p,E.Typography,y.n],styles:["[_nghost-%COMP%]{display:block;padding:var(--cue-card-padding-y) var(--cue-card-padding-x);min-width:200px;max-width:300px;box-sizing:border-box}.msf-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:200px;overflow-y:auto}"],changeDetection:0})}return h})()},5902(k,O,c){c.d(O,{U:()=>T});var v=c(7705),r=c(5802),_=c(2271),m=c(9352),b=c(8957),E=c(2444),y=c(2245),s=c(5381),l=c(5547);function d(g,h){if(1&g){const u=l.RV6();l.j41(0,"cue-input",4),l.bIt("valueChange",function(a){r.eBV(u);const t=l.XpG();return r.Njj(t.onValueChange(a))}),l.k0s()}if(2&g){const u=l.XpG();l.Y8G("value",u.filterText)}}function x(g,h){if(1&g){const u=l.RV6();l.j41(0,"cue-typography",5),l.bIt("click",function(){r.eBV(u);const a=l.XpG();return r.Njj(a.clear())}),l.EFF(1,"Clear"),l.k0s()}}let T=(()=>{class g{_cdr=(0,r.WQX)(v.gRc);_params;filterText="";filterType="contains";filterTypeOptions=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"];_labelContains=(0,m.Xx)("components.agGridColumnSelect.textFilterContains");_labelNotContains=(0,m.Xx)("components.agGridColumnSelect.textFilterNotContains");_labelEquals=(0,m.Xx)("components.agGridColumnSelect.textFilterEquals");_labelNotEqual=(0,m.Xx)("components.agGridColumnSelect.textFilterNotEqual");_labelStartsWith=(0,m.Xx)("components.agGridColumnSelect.textFilterStartsWith");_labelEndsWith=(0,m.Xx)("components.agGridColumnSelect.textFilterEndsWith");_labelBlank=(0,m.Xx)("components.agGridColumnSelect.textFilterBlank");_labelNotBlank=(0,m.Xx)("components.agGridColumnSelect.textFilterNotBlank");filterTypeLabelMap=(0,_.EW)(()=>({contains:this._labelContains(),notContains:this._labelNotContains(),equals:this._labelEquals(),notEqual:this._labelNotEqual(),startsWith:this._labelStartsWith(),endsWith:this._labelEndsWith(),blank:this._labelBlank(),notBlank:this._labelNotBlank()}));showTextInput=(0,_.EW)(()=>!["blank","notBlank"].includes(this.filterType));agInit(u){this._params=u}afterGuiAttached(u){this._cdr.markForCheck()}isFilterActive(){return!!["blank","notBlank"].includes(this.filterType)||this.filterText.trim().length>0}doesFilterPass(u){const n=this._params.getValue(u.node),a=null==n?"":String(n),t=this.filterText.toLowerCase().trim(),e=a.toLowerCase();switch(this.filterType){case"contains":default:return e.includes(t);case"notContains":return!e.includes(t);case"equals":return e===t;case"notEqual":return e!==t;case"startsWith":return e.startsWith(t);case"endsWith":return e.endsWith(t);case"blank":return""===a;case"notBlank":return""!==a}}getModel(){return this.isFilterActive()?{filterType:"text",type:this.filterType,filter:this.filterText}:null}setModel(u){this.filterText=u?.filter??"",this.filterType=u?.type??"contains",this._cdr.markForCheck()}onValueChange(u){this.filterText=u,this._params.filterChangedCallback(),this._cdr.markForCheck()}onFilterTypeChange(u){this.filterType=String(u||"contains"),["blank","notBlank"].includes(this.filterType)&&(this.filterText=""),this._params.filterChangedCallback(),this._cdr.markForCheck()}clear(){this.filterText="",this.filterType="contains",this._params.filterChangedCallback(),this._cdr.markForCheck()}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=l.VBU({type:g,selectors:[["cue-text-filter"]],decls:4,vars:5,consts:[["direction","column","gap","s"],["size","s",3,"valueChange","value","options","labelMap"],["placeholder","Filter...","size","s",3,"value"],["size","s",2,"cursor","pointer","text-align","right"],["placeholder","Filter...","size","s",3,"valueChange","value"],["size","s",2,"cursor","pointer","text-align","right",3,"click"]],template:function(n,a){1&n&&(l.j41(0,"cue-flexcontainer",0)(1,"cue-select",1),l.bIt("valueChange",function(e){return a.onFilterTypeChange(e)}),l.k0s(),l.nVh(2,d,1,1,"cue-input",2),l.nVh(3,x,2,0,"cue-typography",3),l.k0s()),2&n&&(l.R7$(),l.Y8G("value",a.filterType)("options",a.filterTypeOptions)("labelMap",a.filterTypeLabelMap()),l.R7$(),l.vxM(a.showTextInput()?2:-1),l.R7$(),l.vxM(a.filterText||"contains"!==a.filterType?3:-1))},dependencies:[b.p,E.l,y.Typography,s.n],styles:["[_nghost-%COMP%]{display:block;padding:var(--cue-card-padding-y) var(--cue-card-padding-x);min-width:180px;max-width:280px;box-sizing:border-box}"],changeDetection:0})}return g})()},2382(k,O,c){c.d(O,{CueDocumentList:()=>u});var v=c(467),r=c(7705),_=c(5802),m=c(2271),b=c(8611),E=c(2065),y=c(4372),s=c(5381),l=c(2245),d=c(5547);function x(n,a){if(1&n&&(d.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),d.EFF(2),d.k0s()()),2&n){const t=d.XpG();d.R7$(2),d.SpI(" ",t.errorMessage()," ")}}function T(n,a){if(1&n){const t=d.RV6();d.j41(0,"cue-doc-list",3),d.bIt("clickedDocument",function(o){_.eBV(t);const i=d.XpG();return _.Njj(i.clickedDocument.emit(o))})("clickedDownloadDocument",function(o){_.eBV(t);const i=d.XpG();return _.Njj(i.clickedDownloadDocument.emit(o))})("clickedOpenInDir",function(o){_.eBV(t);const i=d.XpG();return _.Njj(i.clickedOpenInDir.emit(o))})("clickedOpen",function(o){_.eBV(t);const i=d.XpG();return _.Njj(i.clickedOpen.emit(o))}),d.k0s()}if(2&n){const t=d.XpG();d.Y8G("documentRefs",t.documentRefs())("documentData",t.documentData())("handlers",t.handlers())("availableContentCategories",t.availableContentCategories())("detailedView",t.detailedView())("simple",t.simple())("pageSize",t.pageSize())("prefetchPages",t.prefetchPages())("showOpenInDocumentViewerAction",t.showOpenInDocumentViewerAction())("showOpenInFileManagerAction",t.showOpenInFileManagerAction())("customOverlayActions",t.customOverlayActions())("variant",t.variant())}}function g(n){return n.split("?")[0].trim()}let u=(()=>{class n{projectId=(0,r.hFB)(void 0);uuids=(0,r.hFB)([]);sdkState=(0,r.hFB)(void 0);detailedView=(0,r.hFB)(!1);simple=(0,r.hFB)(!1);pageSize=(0,r.hFB)(10);prefetchPages=(0,r.hFB)(3);showOpenInDocumentViewerAction=(0,r.hFB)(!1);showOpenInFileManagerAction=(0,r.hFB)(!1);customMenuItems=(0,r.hFB)([]);variant=(0,r.hFB)("none");clickedDocument=(0,r.CGW)();clickedDownloadDocument=(0,r.CGW)();clickedOpenInDir=(0,r.CGW)();clickedOpen=(0,r.CGW)();state=(0,_.vPA)("idle");errorMessage=(0,_.vPA)(null);documentData=(0,_.vPA)({});availableContentCategories=(0,_.vPA)(void 0);documentRefs=(0,m.EW)(()=>{const t=new Set;return(this.uuids()??[]).map(g).filter(e=>!!e).filter(e=>!t.has(e)&&(t.add(e),!0)).map(e=>({id:e}))});customOverlayActions=(0,m.EW)(()=>(this.customMenuItems()||[]).map(e=>({label:e.label,icon:e.icon,action:o=>{e.action(o.rowData,o)}})));handlers=(0,m.EW)(()=>{var t=this;const e=this._docs();if(e)return{requestData:(o=(0,v.A)(function*(i){const f=i.map(g).filter(p=>!!p),C=f.filter(p=>!t.documentData()[p]);if(console.debug("[CueDocumentListWC] requestData",{requestedCount:f.length,missingCount:C.length,missing:C}),C.length)try{const p=e,D=t.simple()&&p.fetchDocumentDataSimple?yield p.fetchDocumentDataSimple(C):yield e.fetchDocumentData(C);console.debug("[CueDocumentListWC] fetchDocumentData resolved",{fetchedCount:Object.keys(D).length,ids:Object.keys(D)});const w={};Object.values(D).forEach(M=>{w[M.id]=function h(n){return{id:n.id,path:n.path,suffix:n.suffix,size:n.size,contentIRI:n.contentIRI,providerId:n.providerId,tags:n.tags??[],summary:n.summary??"",categories:n.categories??[],subject:n.subject,relevance:0}}(M)}),Object.keys(w).length>0&&t.documentData.update(M=>({...M,...w}))}catch(p){console.error("[CueDocumentListWC] Failed to fetch document data:",p),t.errorMessage.set(p instanceof Error?p.message:String(p)),t.state.set("error")}}),function(f){return o.apply(this,arguments)}),requestDownload:function(){var o=(0,v.A)(function*(i){const f=t._cue(),C=t.projectId();if(f&&C)try{const p=yield f.storage.getDownloadUrl(C,i.id,i.suffix,"raw"),D=yield fetch(p);if(!D.ok)throw new Error(`Download failed: ${D.status} ${D.statusText}`);const w=yield D.blob(),M=(0,y.M)(i.path)||`${i.id}${i.suffix||""}`;(0,E.KE)(w,M)}catch(p){console.error("[CueDocumentListWC] Failed to download document:",p)}});return function(f){return o.apply(this,arguments)}}(),requestOpen:(o,i)=>{console.log("[CueDocumentListWC] requestOpen",{documentUUID:o,document:i})},requestOpenInDir:(o,i)=>{console.log("[CueDocumentListWC] requestOpenInDir",{documentUUID:o,document:i})}};var o});_cue=(0,_.vPA)(void 0);_docs=(0,_.vPA)(void 0);_ownedView;_unsubscribeCategories;_lastSetupSignature;constructor(){(0,_.QZP)(()=>{const t=this.projectId(),e=this.sdkState(),o=e?.language??"en";if(console.debug("[CueDocumentListWC] input state changed",{projectId:t,uuids:this.uuids().length,hasSdkState:!!e,hasCue:!!e?.cue,hasView:!!e?.view,hasDocuments:!!e?.documents}),!t||!e)return this._clearRuntimeState(),void this.state.set("idle");const i={projectId:t,cue:e.cue,view:e.view,documents:e.documents,language:o,simple:this.simple()};if(this._isSameSetupSignature(i))return this.state.set("ready"),void this.errorMessage.set(null);this._setupFromSdkState(t,e),this._lastSetupSignature=i,this.state.set("ready"),this.errorMessage.set(null)}),(0,_.QZP)(()=>{const t=new Set(this.documentRefs().map(e=>e.id));this.documentData.update(e=>Object.fromEntries(Object.entries(e).filter(([i])=>t.has(i))))})}ngOnDestroy(){this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0}_setupFromSdkState(t,e){const o=e.language??"en";if(this.documentData.set({}),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this.availableContentCategories.set(e.availableContentCategories?e.availableContentCategories:void 0),e.documents)return e.documents.setLanguage(o),this._docs.set(e.documents),void this._cue.set(e.cue);if(e.view)return e.view.setLanguage(o),this._docs.set(e.view.documents),this._cue.set(e.cue),void(this.simple()||this._bindCategoriesFromView(e.view));if(e.cue){if(this.simple())return this._docs.set(e.cue.createProjectDocuments(t)),this._cue.set(e.cue),void this.availableContentCategories.set(void 0);const i=e.cue.createProjectView(t,{language:o});return this._ownedView=i,this._docs.set(i.documents),this._cue.set(e.cue),void this._bindCategoriesFromView(i)}this._docs.set(void 0),this._cue.set(void 0),this.errorMessage.set("sdkState must include cue, view, or documents to load data."),this.state.set("error")}_bindCategoriesFromView(t){const e=()=>{this.availableContentCategories.set(t.availableContentCategories.get())};e(),this._unsubscribeCategories=t.availableContentCategories.subscribe(e)}_clearRuntimeState(){this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this._docs.set(void 0),this._cue.set(void 0),this.documentData.set({}),this.availableContentCategories.set(void 0),this.errorMessage.set(null),this._lastSetupSignature=void 0}_cleanupOwnedView(){this._ownedView&&(this._ownedView.destroy(),this._ownedView=void 0)}_isSameSetupSignature(t){const e=this._lastSetupSignature;return!!e&&e.projectId===t.projectId&&e.cue===t.cue&&e.view===t.view&&e.documents===t.documents&&e.language===t.language&&e.simple===t.simple}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=d.VBU({type:n,selectors:[["cue-document-list"]],inputs:{projectId:[1,"projectId"],uuids:[1,"uuids"],sdkState:[1,"sdkState"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],prefetchPages:[1,"prefetchPages"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customMenuItems:[1,"customMenuItems"],variant:[1,"variant"]},outputs:{clickedDocument:"clickedDocument",clickedDownloadDocument:"clickedDownloadDocument",clickedOpenInDir:"clickedOpenInDir",clickedOpen:"clickedOpen"},decls:2,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[3,"documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"],[2,"color","#c44","font-size","13px"],[3,"clickedDocument","clickedDownloadDocument","clickedOpenInDir","clickedOpen","documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"]],template:function(e,o){1&e&&d.nVh(0,x,3,1,"cue-flexcontainer",0)(1,T,1,12,"cue-doc-list",1),2&e&&d.vxM("error"===o.state()?0:1)},dependencies:[b.g,s.n,l.Typography],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return n})()}}]);
|