@qaecy/cue-ui 0.0.51 → 0.0.53
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/1051.js +1 -0
- package/1837.js +1 -0
- package/2021.js +1 -0
- package/2081.js +1 -0
- package/2317.js +1 -0
- package/2399.js +1 -1
- package/2516.js +1 -0
- package/2530.js +1 -0
- package/2775.js +1 -0
- package/3036.js +1 -1
- package/3288.js +1 -0
- package/329.js +1 -1
- package/3555.js +1 -0
- package/3577.js +1 -0
- package/3614.js +1 -0
- package/5071.js +1 -0
- package/5559.js +1 -1
- package/5649.js +1 -0
- package/5738.js +1 -0
- package/5872.js +1 -1
- package/6233.js +1 -0
- package/6419.js +1 -1
- package/650.js +1 -0
- package/6947.js +1 -0
- package/7441.js +1 -0
- package/804.js +1 -0
- package/8791.js +1 -1
- package/9396.js +1 -1
- package/README.md +48 -0
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/1573.js +0 -1
- package/1931.js +0 -1
- package/2312.js +0 -1
- package/2724.js +0 -1
- package/3910.js +0 -1
- package/4031.js +0 -1
- package/7427.js +0 -1
- package/836.js +0 -1
- package/9004.js +0 -1
- package/906.js +0 -1
package/650.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[650],{5794(j,M,s){s.d(M,{L:()=>U});var _=s(7705),l=s(5802),m=s(2271),b=s(4853),V=s(9495),o=s(467),v=s(9352),y=s(5745),f=s(5381),x=s(5971),h=s(2245),E=s(9421),D=s(8957),R=s(5448),C=s(63),r=s(617),p=s(9695),u=s(1985),g=s(3039),e=s(5547);const N=["*"],F=()=>[],G=()=>({});function I(t,d){if(1&t&&(e.j41(0,"cue-typography"),e.EFF(1),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.JRh(n.config().message)}}function k(t,d){if(1&t&&(e.nrm(0,"cue-key-val",4),e.nI1(1,"transloco")),2&t){const n=e.XpG(2);e.Y8G("key",e.mNQ(e.bMT(1,3,"components.modals.rdfEdit.labelExistingValue")))("val",n.existingValue())}}function B(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-input",15),e.nI1(1,"transloco"),e.mxI("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return e.DH7(c.newValue,i)||(c.newValue=i),l.Njj(i)}),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",n.newValue),e.Y8G("error",n.valueError())}}function P(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-input",16),e.nI1(1,"transloco"),e.mxI("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return e.DH7(c.newValue,i)||(c.newValue=i),l.Njj(i)}),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",n.newValue),e.Y8G("error",n.valueError())}}function w(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-input-date",17),e.nI1(1,"transloco"),e.mxI("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return e.DH7(c.newValue,i)||(c.newValue=i),l.Njj(i)}),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",n.newValue),e.Y8G("error",n.valueError())}}function O(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-flexcontainer",8)(1,"cue-typography"),e.EFF(2),e.nI1(3,"transloco"),e.k0s(),e.j41(4,"cue-input-switch",18),e.bIt("checkedChange",function(i){l.eBV(n);const c=e.XpG(2);return l.Njj(c.onBooleanChange(i))}),e.k0s()()}if(2&t){const n=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"components.modals.rdfEdit.labelSetNewValue")),e.R7$(2),e.Y8G("checked","true"===n.newValue())}}function X(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-select",19),e.nI1(1,"transloco"),e.mxI("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return e.DH7(c.newValue,i)||(c.newValue=i),l.Njj(i)}),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,7,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",n.newValue),e.Y8G("options",n.config().options||e.lJ4(9,F))("labelMap",n.config().optionLabelMap||e.lJ4(10,G))("showFilter",n.optionsCount()>5)("error",n.valueError())}}function Y(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-multi-select",19),e.nI1(1,"transloco"),e.mxI("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return e.DH7(c.newValue,i)||(c.newValue=i),l.Njj(i)}),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,7,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",n.newValue),e.Y8G("options",n.config().options||e.lJ4(9,F))("labelMap",n.config().optionLabelMap||e.lJ4(10,G))("showFilter",n.optionsCount()>5)("error",n.valueError())}}function $(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-input-multiline",20),e.nI1(1,"transloco"),e.mxI("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return e.DH7(c.comment,i)||(c.comment=i),l.Njj(i)}),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,3,"components.modals.rdfEdit.labelComment"))),e.R50("value",n.comment)}}function z(t,d){if(1&t&&(e.j41(0,"cue-typography",11),e.EFF(1),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.JRh(n.error())}}function K(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-modal",1),e.bIt("close",function(){l.eBV(n);const i=e.XpG();return l.Njj(i.onClose())}),e.j41(1,"cue-flexcontainer",2),e.SdG(2),e.nVh(3,I,2,1,"cue-typography"),e.j41(4,"cue-flexcontainer",3),e.nVh(5,k,2,5,"cue-key-val",4),e.nVh(6,B,2,6,"cue-input",5),e.nVh(7,P,2,6,"cue-input",6),e.nVh(8,w,2,6,"cue-input-date",7),e.nVh(9,O,5,4,"cue-flexcontainer",8),e.nVh(10,X,2,11,"cue-select",9),e.nVh(11,Y,2,11,"cue-multi-select",9),e.k0s(),e.nVh(12,$,2,5,"cue-input-multiline",10),e.nVh(13,z,2,1,"cue-typography",11),e.j41(14,"cue-flexcontainer",12)(15,"cue-button",13),e.bIt("click",function(){l.eBV(n);const i=e.XpG();return l.Njj(i.onClose())}),e.j41(16,"cue-button-label"),e.EFF(17),e.nI1(18,"transloco"),e.k0s()(),e.j41(19,"cue-button",14),e.bIt("click",function(){l.eBV(n);const i=e.XpG();return l.Njj(i.onSave())}),e.j41(20,"cue-button-label"),e.EFF(21),e.nI1(22,"transloco"),e.k0s()()()()()}if(2&t){const n=e.XpG();e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.vxM(n.config().message?3:-1),e.R7$(2),e.vxM("boolean"!==n.config().dataType?5:-1),e.R7$(),e.vxM("string"===n.config().dataType?6:-1),e.R7$(),e.vxM("number"===n.config().dataType?7:-1),e.R7$(),e.vxM("date"===n.config().dataType?8:-1),e.R7$(),e.vxM("boolean"===n.config().dataType?9:-1),e.R7$(),e.vxM("select"===n.config().dataType?10:-1),e.R7$(),e.vxM("multiselect"===n.config().dataType?11:-1),e.R7$(),e.vxM(n.identical()?-1:12),e.R7$(),e.vxM(n.error()?13:-1),e.R7$(2),e.Y8G("disabled",n.saving()),e.R7$(2),e.JRh(e.bMT(18,17,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",n.saving()||n.identical())("loading",n.saving()),e.R7$(2),e.JRh(e.bMT(22,19,"components.modals.rdfEdit.buttonSave"))}}let S=(()=>{class t{visible=(0,_.geq)(!0);config=_.hFB.required();close=(0,_.CGW)();existingValue=(0,m.EW)(()=>{let n="";return n=Array.isArray(this.config().existingValue)?this.config().existingValue.map(i=>this._getLabel(i)).join(", "):this._getLabel(this.config().existingValue),n});newValue=(0,m.uu)(()=>this.config().existingValue);comment=(0,l.vPA)("");errorID=(0,_.geq)("");error=(0,v.Xx)(this.errorID);saving=(0,l.vPA)(!1);pristine=(0,l.vPA)(!0);identical=(0,m.EW)(()=>!this.config().hasExternalChanges&&this.newValue()===this.config().existingValue);valueErrorID=(0,m.EW)(()=>this.pristine()?"":this.identical()?"components.modals.rdfEdit.errorIdenticalValue":"");valueError=(0,v.Xx)(this.valueErrorID);optionsCount=(0,m.EW)(()=>this.config().options?.length||0);constructor(){(0,l.QZP)(()=>{this.pristine()&&this.newValue()!==this.config().existingValue&&this.pristine.set(!1)})}onSave(){var n=this;return(0,o.A)(function*(){n.saving.set(!0),n.errorID.set("");try{const a=n.config();yield a.requestSave({newValue:n.newValue(),comment:n.comment(),previousValue:a.existingValue}),n.visible.set(!1),n.close.emit(n.newValue())}catch(a){console.error("Error saving RDF edit:",a),n.errorID.set("components.modals.rdfEdit.errorSaving")}n.saving.set(!1)})()}onClose(){this.visible.set(!1),this.close.emit(null)}onBooleanChange(n){this.newValue.set(n?"true":"false")}_getLabel(n){const a=this.config().optionLabelMap;return void 0!==a&&a[n]||n}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=e.VBU({type:t,selectors:[["cue-modal-rdf-edit"]],inputs:{visible:[1,"visible"],config:[1,"config"],errorID:[1,"errorID"]},outputs:{visible:"visibleChange",close:"close",errorID:"errorIDChange"},ngContentSelectors:N,decls:1,vars:1,consts:[[3,"displayCloseBtn","closeOnBackgroundClick"],[3,"close","displayCloseBtn","closeOnBackgroundClick"],["direction","column","align","center"],["direction","column","gap","m"],[3,"key","val"],["type","text",3,"label","value","error"],["type","number",3,"label","value","error"],[3,"label","value","error"],["direction","row","align","center","justify","space-between","gap","l"],[3,"value","options","labelMap","label","showFilter","error"],[2,"width","100%",3,"label","value"],[2,"color","var(--cue-error)"],["direction","row","justify","center",2,"width","100%"],[3,"click","disabled"],["variant","secondary",3,"click","disabled","loading"],["type","text",3,"valueChange","label","value","error"],["type","number",3,"valueChange","label","value","error"],[3,"valueChange","label","value","error"],[3,"checkedChange","checked"],[3,"valueChange","value","options","labelMap","label","showFilter","error"],[2,"width","100%",3,"valueChange","label","value"]],template:function(a,i){1&a&&(e.NAR(),e.nVh(0,K,23,21,"cue-modal",0)),2&a&&e.vxM(i.visible()?0:-1)},dependencies:[y.a,f.n,x.$,h.Typography,E.F,D.Input,R.L,C.Select,g.MultiSelect,r.InputDate,p.Switch,u.InputMultiline,v.Kj],styles:[".col[_ngcontent-%COMP%]{flex:1;min-width:0;height:100%}"]})}return t})();var T=s(7335);function A(t,d){1&t&&(e.j41(0,"span",7),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&t&&(e.R7$(),e.SpI("(",e.bMT(2,1,"components.keyVal.edited"),")"))}function W(t,d){if(1&t){const n=e.RV6();e.j41(0,"span",5),e.bIt("click",function(){l.eBV(n);const i=e.XpG();return l.Njj(i.onReadClick())}),e.j41(1,"span",6),e.EFF(2),e.k0s(),e.nVh(3,A,3,3,"span",7),e.k0s()}if(2&t){const n=e.XpG();e.AVh("interactive",!n.editDisabled()),e.Y8G("menuItems",n.hoverMenu()),e.R7$(2),e.Lme("",n.valueFormatted()," ",n.suffix()),e.R7$(),e.vxM(n.isDirty()?3:-1)}}function L(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-select",10),e.bIt("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return l.Njj(c.selectionChange(i))}),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("value",n.newValue())("options",n.options())}}function H(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-inline-input",11),e.bIt("valueChange",function(i){l.eBV(n);const c=e.XpG(2);return l.Njj(c.inputChange(i))}),e.k0s(),e.EFF(1)}if(2&t){const n=e.XpG(2);e.Y8G("value",n.valueFormatted()),e.R7$(),e.SpI(" ",n.suffix()," ")}}function J(t,d){if(1&t&&(e.j41(0,"cue-flexcontainer",3),e.nVh(1,L,1,2,"cue-select",8)(2,H,2,2),e.nrm(3,"cue-entity-menu",9),e.k0s()),2&t){const n=e.XpG();e.R7$(),e.vxM(void 0!==n.options()&&n.options().length?1:2),e.R7$(2),e.Y8G("items",n.saveCancelMenu())}}function Q(t,d){if(1&t){const n=e.RV6();e.j41(0,"cue-modal-rdf-edit",12),e.mxI("visibleChange",function(i){l.eBV(n);const c=e.XpG();return e.DH7(c.rdfModalVisible,i)||(c.rdfModalVisible=i),l.Njj(i)}),e.bIt("close",function(i){l.eBV(n);const c=e.XpG();return l.Njj(c.onRdfModalClose(i))}),e.k0s()}if(2&t){const n=e.XpG();e.Y8G("config",d),e.R50("visible",n.rdfModalVisible)}}let U=(()=>{class t{entityMenuDirective;size=(0,_.hFB)("m");key=_.hFB.required();val=_.geq.required();originalValue=(0,_.hFB)(void 0);options=(0,_.hFB)([]);suffix=(0,_.hFB)("");rdfConfig=(0,_.hFB)();editDisabled=(0,_.hFB)(!1);valueChange=(0,_.CGW)();editModeEnabled=(0,l.vPA)(!1);isDirty=(0,m.EW)(()=>{const n=this.originalValue();return void 0!==n&&this.val()!==n});valueChanged=(0,m.EW)(()=>this.val()!==this.newValue());newValue=(0,m.uu)(()=>this.val());rdfModalVisible=(0,l.vPA)(!1);valueFormatted=(0,m.EW)(()=>this._idToString(this.val()));hoverMenu=(0,m.EW)(()=>{if(this.editModeEnabled()||this.editDisabled())return[];const n=[{icon:"edit",label:"Edit",action:()=>this.onReadClick()}];return this.isDirty()&&n.push({icon:"close",label:"Revert to original",action:()=>this._revert()}),n});onReadClick(){this.editDisabled()||(this.rdfConfig()?this.rdfModalVisible.set(!0):this.editModeEnabled.set(!0),this.entityMenuDirective?.removeOverlayMenu())}labelSize=(0,m.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(n){this.editModeEnabled()&&("Escape"===n.key?(this._reset(),n.stopPropagation()):"Enter"===n.key&&this._emitChange())}saveCancelMenu=(0,m.EW)(()=>{const n=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&n.push({icon:"save",label:"Save",action:()=>this._emitChange()}),n});selectionChange(n){this.newValue.set(n?.toString()??"")}inputChange(n){this.newValue.set(n)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}_revert(){const n=this.originalValue();void 0!==n&&(this.val.set(n),this.newValue.set(n),this.valueChange.emit(n),this.entityMenuDirective?.removeOverlayMenu())}_idToString(n){const a=this.rdfConfig()?.optionLabelMap;return a?a[n]??n:n}onRdfModalClose(n){if(this.rdfModalVisible.set(!1),null===n)return;const a=Array.isArray(n)?n.join(", "):n;this.val.set(a)}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=e.VBU({type:t,selectors:[["cue-key-val-editable"]],viewQuery:function(a,i){if(1&a&&e.GBs(T.e,5),2&a){let c;e.mGM(c=e.lsd())&&(i.entityMenuDirective=c.first)}},hostBindings:function(a,i){1&a&&e.bIt("keydown",function(Z){return i.onKeyPress(Z)},e.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],originalValue:[1,"originalValue"],options:[1,"options"],suffix:[1,"suffix"],rdfConfig:[1,"rdfConfig"],editDisabled:[1,"editDisabled"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:9,vars:5,consts:[[1,"key-val-container"],[3,"size"],["cueEntityMenu","",1,"read-mode-container",3,"interactive","menuItems"],["direction","row","align","center"],[3,"config","visible"],["cueEntityMenu","",1,"read-mode-container",3,"click","menuItems"],[1,"value-content"],[1,"dirty-indicator"],[3,"value","options"],[3,"items"],[3,"valueChange","value","options"],[3,"valueChange","value"],[3,"visibleChange","close","config","visible"]],template:function(a,i){if(1&a&&(e.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),e.EFF(3),e.k0s()(),e.j41(4,"dd")(5,"cue-typography",1),e.nVh(6,W,4,6,"span",2)(7,J,4,2,"cue-flexcontainer",3),e.k0s()()(),e.nVh(8,Q,1,2,"cue-modal-rdf-edit",4)),2&a){let c;e.R7$(2),e.Y8G("size",i.labelSize()),e.R7$(),e.JRh(i.key()),e.R7$(2),e.Y8G("size",i.size()),e.R7$(),e.vxM(i.editModeEnabled()?i.rdfConfig()?-1:7:6),e.R7$(2),e.vxM((c=i.rdfConfig())?8:-1,c)}},dependencies:[h.Typography,T.e,C.Select,b.H,f.n,V.InlineInput,S,v.Kj],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return t})()},8547(j,M,s){s.d(M,{T:()=>C});var _=s(7705),l=s(29),m=s(6117),b=s(6279),V=s(356),o=s(5547),v=s(5802);const y=(r,p)=>p.label;function f(r,p){if(1&r&&o.nrm(0,"cue-svg-icon",4),2&r){const u=o.XpG(2).$implicit;o.Y8G("name",u.icon)}}function x(r,p){if(1&r&&o.nrm(0,"cue-menu-nested",6),2&r){const u=o.XpG(2).$implicit,g=o.XpG();o.Y8G("items",u.children)("size",g.size())}}function h(r,p){if(1&r&&(o.j41(0,"cue-menu",1)(1,"cue-menu-item",3),o.nVh(2,f,1,1,"cue-svg-icon",4),o.EFF(3),o.nrm(4,"cue-svg-icon",5),o.k0s(),o.nVh(5,x,1,2,"cue-menu-nested",6),o.k0s()),2&r){const u=o.XpG().$implicit,g=o.XpG();o.Y8G("size",g.size()),o.R7$(),o.Y8G("title",u.tooltip),o.R7$(),o.vxM(u.icon?2:-1),o.R7$(),o.SpI(" ",u.label," "),o.R7$(2),o.vxM(u.children?5:-1)}}function E(r,p){if(1&r&&o.nrm(0,"cue-svg-icon",4),2&r){const u=o.XpG(2).$implicit;o.Y8G("name",u.icon)}}function D(r,p){if(1&r){const u=o.RV6();o.j41(0,"cue-menu-item",7),o.bIt("click",function(){v.eBV(u);const e=o.XpG().$implicit;return v.Njj(null==e.action?null:e.action())}),o.nVh(1,E,1,1,"cue-svg-icon",4),o.EFF(2),o.k0s()}if(2&r){const u=o.XpG().$implicit;o.Y8G("title",u.tooltip),o.R7$(),o.vxM(u.icon?1:-1),o.R7$(),o.SpI(" ",u.label," ")}}function R(r,p){if(1&r&&o.nVh(0,h,6,5,"cue-menu",1)(1,D,3,3,"cue-menu-item",2),2&r){const u=p.$implicit;o.vxM(null!=u.children&&u.children.length?0:1)}}let C=(()=>{class r{items=_.hFB.required();size=(0,_.hFB)("m");static \u0275fac=function(g){return new(g||r)};static \u0275cmp=o.VBU({type:r,selectors:[["cue-menu-nested"]],inputs:{items:[1,"items"],size:[1,"size"]},decls:3,vars:1,consts:[[3,"size"],["trigger","hover",3,"size"],[3,"title"],["trigger","",3,"title"],["before","",3,"name"],["after","","name","paginator-next"],["menu","",3,"items","size"],[3,"click","title"]],template:function(g,e){1&g&&(o.j41(0,"cue-menu-wrap",0),o.Z7z(1,R,2,1,null,null,y),o.k0s()),2&g&&(o.Y8G("size",e.size()),o.R7$(),o.Dyx(e.items()))},dependencies:[r,m.W,b.D,V.M,l.A],encapsulation:2})}return r})()}}]);
|
package/6947.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[6947],{6947(E,p,r){r.d(p,{CueDocumentFilter:()=>b});var u=r(467),_=r(7705),g=r(2271),m=r(3555),f=r(9822),i=r(5547);let b=(()=>{class o{projectId=_.hFB.required();sdkState=_.hFB.required();filtersChange=(0,_.CGW)();_handlers=(0,g.EW)(()=>{var n=this;const t=this.sdkState(),e=this.projectId(),a=new m.NV(t.cue.api,e,t.graphType);let l=null;const C=()=>(l||(l=this._loadSchemaLabels(t,e)),l);return{requestAvailableFilters:(d=(0,u.A)(function*(s){const[c,h]=yield Promise.all([a.availableFilters(s),C()]);return n._withSchemaLabels(c,h)}),function(c){return d.apply(this,arguments)}),requestAvailableEntities:function(){var d=(0,u.A)(function*(s,c){return yield a.availableEntities(s,c)});return function(c,h){return d.apply(this,arguments)}}()};var d});_loadSchemaLabels(n,t){return(0,u.A)(function*(){try{const e=new m.Ug(n.cue.api,t,n.cue.api.language,n.graphType);return yield e.ready,{content:new Map(e.availableContentCategories.get().map(a=>[a.iri,a.label])),entity:new Map(e.availableEntityCategories.get().map(a=>[a.iri,a.label]))}}catch(e){return console.error("[document-filter] Failed to load schema labels",e),{content:new Map,entity:new Map}}})()}_withSchemaLabels(n,t){return{mimes:n.mimes.map(e=>({iri:e.iri,label:e.label.replace(/FileContent$/,"")})),contents:n.contents.map(e=>({iri:e.iri,label:t.content.get(e.iri)??e.label})),entityCategories:n.entityCategories.map(e=>({iri:e.iri,label:t.entity.get(e.iri)??e.label}))}}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=i.VBU({type:o,selectors:[["cue-document-filter"]],inputs:{projectId:[1,"projectId"],sdkState:[1,"sdkState"]},outputs:{filtersChange:"filtersChange"},decls:1,vars:1,consts:[[3,"filtersChange","handlers"]],template:function(t,e){1&t&&(i.j41(0,"cue-doc-filter",0),i.bIt("filtersChange",function(l){return e.filtersChange.emit(l)}),i.k0s()),2&t&&i.Y8G("handlers",e._handlers())},dependencies:[f.y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}return o})()}}]);
|
package/7441.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[7441],{3319(D,v,o){o.d(v,{a:()=>c});var r=o(7705),u=o(29),i=o(5547);let c=(()=>{class _{icon=(0,r.hFB)(void 0);slot=(0,r.hFB)("before");static \u0275fac=function(m){return new(m||_)};static \u0275cmp=i.VBU({type:_,selectors:[["cue-button-icon"]],inputs:{icon:[1,"icon"],slot:[1,"slot"]},decls:1,vars:2,consts:[[3,"slot","name"]],template:function(m,g){1&m&&i.nrm(0,"cue-svg-icon",0),2&m&&i.Y8G("slot",g.slot())("name",g.icon())},dependencies:[u.A],encapsulation:2})}return _})()},5448(D,v,o){o.d(v,{L:()=>_});var r=o(7705),u=o(2245),i=o(5547);const c=["*"];let _=(()=>{class a{fontSize=(0,r.hFB)("m");italic=(0,r.hFB)(!1);noWrap=(0,r.hFB)(!0);static \u0275fac=function(g){return new(g||a)};static \u0275cmp=i.VBU({type:a,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:c,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(g,p){1&g&&(i.NAR(),i.j41(0,"div")(1,"cue-typography",0),i.SdG(2),i.k0s()()),2&g&&(i.R7$(),i.Y8G("size",p.fontSize())("italic",p.italic())("noWrap",p.noWrap()))},dependencies:[u.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return a})()},2014(D,v,o){o.d(v,{z:()=>_});var r=o(7705),u=o(2271),i=o(5547);const c=["*"];let _=(()=>{class a{justify=(0,r.hFB)("start");size=(0,r.hFB)("l");widthStyle=(0,u.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(g){return new(g||a)};static \u0275cmp=i.VBU({type:a,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:c,decls:2,vars:4,template:function(g,p){1&g&&(i.NAR(),i.rj2(0,"div"),i.SdG(1),i.eux()),2&g&&i.xc7("justify-content",p.justify())("min-width",p.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return a})()},5971(D,v,o){o.d(v,{$:()=>g});var r=o(9769),u=o(7705),i=o(2271),c=o(7089),_=o(2403),a=o(5547);const b=["buttonElement"],m=["*"];let g=(()=>{class p{variant=(0,u.hFB)("primary");size=(0,u.hFB)("m");tooltip=(0,u.hFB)("");disabled=(0,u.hFB)(!1);selected=(0,u.geq)(!1);toggleButton=(0,u.hFB)(!1);loading=(0,u.hFB)(!1);fitParentWidth=(0,u.hFB)(!1);noWrap=(0,u.hFB)(!0);buttonElement=u.ebz.required("buttonElement");getStyles=(0,i.EW)(()=>[`\n padding: 0 var(--cue-button-${this.size()}-padding-x);\n\n --focus-color: var(--cue-button-${this.variant()}-focus-color);\n --cue-button-border-color: var(--cue-button-${this.variant()}-border-color);\n color: var(--cue-button-${this.variant()}-foreground);\n --background-color: var(--cue-button-${this.variant()}-background);\n\n --cue-icon-width: var(--cue-button-${this.size()}-icon-width);\n --button-height: var(--cue-button-${this.size()}-height);\n --cue-button-border-radius: var(--cue-button-border-radius, 9999px);\n --button-label-padding-x: var(--cue-button-${this.size()}-label-padding-x);\n `,this.disabled()?`\n color: var(--cue-button-${this.variant()}-disabled-foreground);\n --cue-button-border-color: var(--cue-button-${this.variant()}-disabled-border-color);\n --background-color: var(--cue-button-${this.variant()}-disabled-background);\n `:""].join(""));handleClick(C){C.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(C.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(h){return new(h||p)};static \u0275cmp=a.VBU({type:p,selectors:[["cue-button"]],viewQuery:function(h,e){1&h&&a.wEZ(e.buttonElement,b,5),2&h&&a.NyB()},inputs:{variant:[1,"variant"],size:[1,"size"],tooltip:[1,"tooltip"],disabled:[1,"disabled"],selected:[1,"selected"],toggleButton:[1,"toggleButton"],loading:[1,"loading"],fitParentWidth:[1,"fitParentWidth"],noWrap:[1,"noWrap"]},outputs:{selected:"selectedChange"},ngContentSelectors:m,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(h,e){1&h&&(a.NAR(),a.j41(0,"button",1,0),a.bIt("click",function(P){return e.handleClick(P)}),a.SdG(2),a.k0s()),2&h&&(a.Aen(e.getStyles()),a.xc7("white-space",e.noWrap()?"nowrap":"normal")("flex-basis",e.noWrap()?null:"auto")("min-width",e.noWrap()?null:"fit-content"),a.AVh("selected",e.selected())("ghost","ghost"===e.variant())("fit-parent-width",e.fitParentWidth()),a.Y8G("disabled",e.disabled())("cueTooltip",e.tooltip())("tooltipPlacement","top")("cuePulse",e.loading()))},dependencies:[r.MD,c.d,_.V],styles:['[_nghost-%COMP%]:has(.fit-parent-width){display:contents}@keyframes _ngcontent-%COMP%_pulse-border{0%{box-shadow:0 0 0 0 var(--focus-color)}50%{box-shadow:0 0 0 8px transparent}to{box-shadow:0 0 0 0 transparent}}button[_ngcontent-%COMP%]{min-width:0;pulse-border-radius:var(--cue-button-border-radius);appearance:none;padding:0;font:inherit;border:var(--cue-button-border-width) var(--cue-button-border-style) var(--cue-button-border-color);display:flex;justify-content:space-between;align-items:center;gap:var(--cue-button-gap);min-height:var(--button-height);height:auto;background-color:var(--background-color);border-radius:var(--cue-button-border-radius, 9999px);margin:3px;position:relative}button[style*="white-space: normal"][_ngcontent-%COMP%]{border-radius:30px!important;padding:10px!important}button.fit-parent-width[_ngcontent-%COMP%]{width:100%;min-width:0;margin-inline:0}button[_ngcontent-%COMP%]:not(.fit-parent-width){min-width:fit-content;width:auto}button[_ngcontent-%COMP%]:focus{outline:none}button[_ngcontent-%COMP%]:hover:not(:disabled), button[_ngcontent-%COMP%]:focus-within:not(:disabled){outline:1px solid var(--focus-color);outline-offset:2px;cursor:pointer}button.selected[_ngcontent-%COMP%]{outline:1px solid currentColor!important;outline-offset:2px;margin:3px}button.ghost[_ngcontent-%COMP%]:not(.selected){border:none}']})}return p})()},2339(D,v,o){o.d(v,{v:()=>p});var r=o(7705),u=o(5971),i=o(2014),c=o(5448),_=o(29),a=o(5547),b=o(5802);const m=["*"];function g(f,C){if(1&f){const h=a.RV6();a.j41(0,"span",2),a.bIt("click",function(y){b.eBV(h);const P=a.XpG();return b.Njj(P.onRemove(y))}),a.nrm(1,"cue-svg-icon",3),a.k0s()}if(2&f){const h=a.XpG();a.AVh("disabled",h.disabled()),a.BMQ("title",h.removeLabel())("aria-label",h.removeLabel())}}let p=(()=>{class f{size=(0,r.hFB)("s");selected=(0,r.geq)(!1);disabled=(0,r.geq)(!1);passive=(0,r.hFB)(!1);variant=(0,r.hFB)("primary");removable=(0,r.hFB)(!1);removeLabel=(0,r.hFB)("Remove");removed=(0,r.CGW)();toggleSelect(){this.passive()||this.selected.set(!this.selected())}onRemove(h){h.stopPropagation(),!this.disabled()&&this.removed.emit()}static \u0275fac=function(e){return new(e||f)};static \u0275cmp=a.VBU({type:f,selectors:[["cue-chip"]],inputs:{size:[1,"size"],selected:[1,"selected"],disabled:[1,"disabled"],passive:[1,"passive"],variant:[1,"variant"],removable:[1,"removable"],removeLabel:[1,"removeLabel"]},outputs:{selected:"selectedChange",disabled:"disabledChange",removed:"removed"},ngContentSelectors:m,decls:6,vars:4,consts:[[1,"is-chip",3,"click","size","disabled","variant"],[1,"chip-remove",3,"disabled"],[1,"chip-remove",3,"click"],["name","close"]],template:function(e,y){1&e&&(a.NAR(),a.j41(0,"cue-button",0),a.bIt("click",function(){return y.toggleSelect()}),a.nrm(1,"cue-button-padder"),a.j41(2,"cue-button-label"),a.SdG(3),a.k0s(),a.nrm(4,"cue-button-padder"),a.nVh(5,g,2,4,"span",1),a.k0s()),2&e&&(a.Y8G("size",y.size())("disabled",y.disabled())("variant",y.selected()?y.variant():"secondary"),a.R7$(5),a.vxM(y.removable()?5:-1))},dependencies:[u.$,i.z,c.L,_.A],styles:["cue-button.is-chip[_ngcontent-%COMP%]{--cue-button-s-padding-x: 8px;--cue-button-m-padding-x: 12px;--cue-button-l-padding-x: 16px}.chip-remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;--cue-icon-width: .9em;margin-inline-start:4px;margin-inline-end:-2px;border-radius:50%;cursor:pointer;opacity:.6;transition:opacity .1s ease,background-color .1s ease}.chip-remove[_ngcontent-%COMP%]:hover{opacity:1;background-color:color-mix(in srgb,currentColor 18%,transparent)}.chip-remove.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.3}"],changeDetection:0})}return f})()},9822(D,v,o){o.d(v,{y:()=>$});var r=o(467),u=o(7705),i=o(5802),c=o(2271),_=o(9352),a=o(2339),b=o(5971),m=o(5448),g=o(3319),p=o(2014),f=o(63),C=o(5381),h=o(2245),e=o(5547);function y(l,M){1&l&&(e.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),e.EFF(2),e.nI1(3,"transloco"),e.k0s()()),2&l&&(e.R7$(2),e.JRh(e.bMT(3,1,"components.documentFilter.loading")))}function P(l,M){if(1&l){const t=e.RV6();e.j41(0,"cue-chip",7),e.nI1(1,"transloco"),e.bIt("removed",function(){const s=i.eBV(t).$index,d=e.XpG(2);return i.Njj(d._remove(s))}),e.j41(2,"span",8),e.EFF(3),e.k0s(),e.EFF(4),e.k0s()}if(2&l){const t=M.$implicit,n=e.XpG(2);e.Y8G("selected",!0)("passive",!0)("removable",!0)("removeLabel",e.bMT(1,6,"components.documentFilter.removeFilter")),e.R7$(3),e.SpI("",n._chipDim(t),":"),e.R7$(),e.SpI("",t.label," ")}}function B(l,M){if(1&l){const t=e.RV6();e.j41(0,"div",9)(1,"cue-select",13),e.nI1(2,"transloco"),e.bIt("valueChange",function(s){i.eBV(t);const d=e.XpG(3);return i.Njj(d._onValueSelect("mime",s))}),e.k0s()()}if(2&l){const t=e.XpG(3);e.R7$(),e.Y8G("placeholder",e.bMT(2,5,"components.documentFilter.selectMimePlaceholder"))("underline",!1)("showFilter",t._mimeOptions().length>8)("options",t._mimeOptions())("labelMap",t._mimeLabels())}}function L(l,M){if(1&l){const t=e.RV6();e.j41(0,"div",9)(1,"cue-select",13),e.nI1(2,"transloco"),e.bIt("valueChange",function(s){i.eBV(t);const d=e.XpG(3);return i.Njj(d._onValueSelect("content",s))}),e.k0s()()}if(2&l){const t=e.XpG(3);e.R7$(),e.Y8G("placeholder",e.bMT(2,5,"components.documentFilter.selectContentPlaceholder"))("underline",!1)("showFilter",t._contentOptions().length>8)("options",t._contentOptions())("labelMap",t._contentLabels())}}function T(l,M){if(1&l){const t=e.RV6();e.j41(0,"div",15)(1,"cue-select",16),e.nI1(2,"transloco"),e.bIt("valueChange",function(s){i.eBV(t);const d=e.XpG(4);return i.Njj(d._onEntityValueSelect(s))}),e.k0s()()}if(2&l){const t=e.XpG(4);e.R7$(),e.Y8G("placeholder",e.bMT(2,6,"components.documentFilter.selectEntityPlaceholder"))("underline",!1)("loading",t._entityLoading())("showFilter",!0)("options",t._entityValueOptions())("labelMap",t._entityValueLabels())}}function I(l,M){if(1&l){const t=e.RV6();e.j41(0,"div",9)(1,"cue-select",14),e.nI1(2,"transloco"),e.bIt("valueChange",function(s){i.eBV(t);const d=e.XpG(3);return i.Njj(d._onEntityCatSelect(s))}),e.k0s()(),e.nVh(3,T,3,8,"div",15)}if(2&l){let t;const n=e.XpG(3);e.R7$(),e.Y8G("placeholder",e.bMT(2,7,"components.documentFilter.selectEntityTypePlaceholder"))("underline",!1)("showFilter",n._entityCatOptions().length>8)("options",n._entityCatOptions())("labelMap",n._entityCatLabels())("value",(null==(t=n._draftEntityCat())?null:t.iri)??""),e.R7$(2),e.vxM(n._draftEntityCat()?3:-1)}}function R(l,M){if(1&l){const t=e.RV6();e.j41(0,"div",4)(1,"div",9)(2,"cue-select",10),e.nI1(3,"transloco"),e.bIt("valueChange",function(s){i.eBV(t);const d=e.XpG(2);return i.Njj(d._onDimSelect(s))}),e.k0s()(),e.nVh(4,B,3,7,"div",9),e.nVh(5,L,3,7,"div",9),e.nVh(6,I,4,9),e.j41(7,"cue-button",11),e.bIt("click",function(){i.eBV(t);const s=e.XpG(2);return i.Njj(s._cancelAdd())}),e.j41(8,"cue-button-label",12),e.EFF(9),e.nI1(10,"transloco"),e.k0s()()()}if(2&l){const t=e.XpG(2);e.R7$(2),e.Y8G("placeholder",e.bMT(3,9,"components.documentFilter.filterByPlaceholder"))("underline",!1)("options",t._dimOptions())("labelMap",t._dimLabels())("value",t._draftDim()??""),e.R7$(2),e.vxM("mime"===t._draftDim()?4:-1),e.R7$(),e.vxM("content"===t._draftDim()?5:-1),e.R7$(),e.vxM("entity"===t._draftDim()?6:-1),e.R7$(3),e.JRh(e.bMT(10,11,"components.documentFilter.cancel"))}}function A(l,M){if(1&l){const t=e.RV6();e.j41(0,"cue-button",17),e.bIt("click",function(){i.eBV(t);const s=e.XpG(2);return i.Njj(s._startAdd())}),e.j41(1,"cue-button-padder"),e.nrm(2,"cue-button-icon",18),e.k0s(),e.j41(3,"cue-button-label",12),e.EFF(4),e.nI1(5,"transloco"),e.k0s()()}if(2&l){const t=e.XpG(2);e.Y8G("disabled",t._refreshing()||!t._hasAnyOption()),e.R7$(4),e.JRh(e.bMT(5,2,"components.documentFilter.addFilter"))}}function W(l,M){if(1&l){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){i.eBV(t);const s=e.XpG(2);return i.Njj(s._clearAll())}),e.j41(1,"cue-button-label",12),e.EFF(2),e.nI1(3,"transloco"),e.k0s()()}2&l&&(e.R7$(2),e.JRh(e.bMT(3,1,"components.documentFilter.clear")))}function N(l,M){1&l&&(e.j41(0,"cue-typography",2),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&l&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentFilter.updating")))}function V(l,M){if(1&l&&(e.j41(0,"cue-flexcontainer",1),e.Z7z(1,P,5,8,"cue-chip",3,e.Vm6),e.nVh(3,R,11,13,"div",4)(4,A,6,4,"cue-button",5),e.nVh(5,W,4,3,"cue-button",6),e.nVh(6,N,3,3,"cue-typography",2),e.k0s()),2&l){const t=e.XpG();e.R7$(),e.Dyx(t._committed()),e.R7$(2),e.vxM(t._adding()?3:4),e.R7$(2),e.vxM(t._committed().length>0&&!t._adding()?5:-1),e.R7$(),e.vxM(t._refreshing()?6:-1)}}const F={mimes:[],contents:[],entityCategories:[]},j={mimes:[],contents:[],entityCategories:[],entities:[]},x="__ANY__",E="components.documentFilter";let $=(()=>{class l{handlers=u.hFB.required();filtersChange=(0,u.CGW)();ANY=x;_dimMimeLabel=(0,_.Xx)(`${E}.dimMime`);_dimContentLabel=(0,_.Xx)(`${E}.dimContent`);_dimEntityLabel=(0,_.Xx)(`${E}.dimEntity`);_chipMimeLabel=(0,_.Xx)(`${E}.chipMime`);_chipContentLabel=(0,_.Xx)(`${E}.chipContent`);_anyLabel=(0,_.Xx)(`${E}.any`);_anyOfCategoryParams=(0,c.EW)(()=>({category:this._draftEntityCat()?.label??""}));_anyOfCategoryLabel=(0,_.Xx)(`${E}.anyOfCategory`,this._anyOfCategoryParams);_dimLabels=(0,c.EW)(()=>({mime:this._dimMimeLabel(),content:this._dimContentLabel(),entity:this._dimEntityLabel()}));_opts=(0,i.vPA)(F);_committed=(0,i.vPA)([]);_loading=(0,i.vPA)(!1);_refreshing=(0,i.vPA)(!1);_adding=(0,i.vPA)(!1);_draftDim=(0,i.vPA)(null);_draftEntityCat=(0,i.vPA)(null);_entityValues=(0,i.vPA)([]);_entityLoading=(0,i.vPA)(!1);_mimeChoices=(0,c.EW)(()=>this._available("mime",this._opts().mimes));_contentChoices=(0,c.EW)(()=>this._available("content",this._opts().contents));_entityCatChoices=(0,c.EW)(()=>this._opts().entityCategories);_hasAnyOption=(0,c.EW)(()=>this._mimeChoices().length>0||this._contentChoices().length>0||this._entityCatChoices().length>0);_dimOptions=(0,c.EW)(()=>{const t=[];return this._mimeChoices().length&&t.push("mime"),this._contentChoices().length&&t.push("content"),this._entityCatChoices().length&&t.push("entity"),t});_mimeOptions=(0,c.EW)(()=>this._mimeChoices().map(t=>t.iri));_mimeLabels=(0,c.EW)(()=>this._toLabelMap(this._mimeChoices()));_contentOptions=(0,c.EW)(()=>this._contentChoices().map(t=>t.iri));_contentLabels=(0,c.EW)(()=>this._toLabelMap(this._contentChoices()));_entityCatOptions=(0,c.EW)(()=>this._entityCatChoices().map(t=>t.iri));_entityCatLabels=(0,c.EW)(()=>this._toLabelMap(this._entityCatChoices()));_entityValueOptions=(0,c.EW)(()=>[x,...this._entityValues().map(t=>t.iri)]);_entityValueLabels=(0,c.EW)(()=>{const t=this._draftEntityCat(),n={[x]:t?this._anyOfCategoryLabel():this._anyLabel()};for(const s of this._entityValues())n[s.iri]=s.label;return n});constructor(){(0,i.QZP)(()=>{const t=this.handlers();this._reset(t)})}_startAdd(){this._resetDraft(),this._adding.set(!0)}_cancelAdd(){this._adding.set(!1),this._resetDraft()}_onDimSelect(t){this._draftEntityCat.set(null),this._entityValues.set([]),this._draftDim.set(t||null)}_onValueSelect(t,n){var s=this;return(0,r.A)(function*(){if(!n)return;const O=("mime"===t?s._opts().mimes:s._opts().contents).find(z=>z.iri===n)?.label??n;yield s._commit({dim:t,valueIri:n,label:O,isEntityInstance:!1})})()}_onEntityCatSelect(t){var n=this;return(0,r.A)(function*(){if(n._entityValues.set([]),!t)return void n._draftEntityCat.set(null);const s=n._opts().entityCategories.find(d=>d.iri===t)??{iri:t,label:t};n._draftEntityCat.set(s),n._entityLoading.set(!0);try{const d=yield n.handlers().requestAvailableEntities(t,n._applied());n._entityValues.set(d)}catch(d){console.error("[document-filter] Failed to load entities",d),n._entityValues.set([])}finally{n._entityLoading.set(!1)}})()}_onEntityValueSelect(t){var n=this;return(0,r.A)(function*(){if(!t)return;const s=n._draftEntityCat();if(s)if(t===x)yield n._commit({dim:"entity",valueIri:s.iri,label:n._anyLabel(),isEntityInstance:!1,categoryIri:s.iri,categoryLabel:s.label});else{const d=n._entityValues().find(O=>O.iri===t);yield n._commit({dim:"entity",valueIri:t,label:d?.label??t,isEntityInstance:!0,categoryIri:s.iri,categoryLabel:s.label})}})()}_remove(t){var n=this;return(0,r.A)(function*(){n._committed.update(s=>s.filter((d,O)=>O!==t)),yield n._refreshOptions(),n._emitFilters()})()}_clearAll(){var t=this;return(0,r.A)(function*(){t._committed.set([]),t._adding.set(!1),t._resetDraft(),yield t._refreshOptions(),t._emitFilters()})()}_chipDim(t){return"mime"===t.dim?this._chipMimeLabel():"content"===t.dim?this._chipContentLabel():t.categoryLabel??this._dimEntityLabel()}_commit(t){var n=this;return(0,r.A)(function*(){n._committed.update(s=>[...s,t]),n._adding.set(!1),n._resetDraft(),yield n._refreshOptions(),n._emitFilters()})()}_resetDraft(){this._draftDim.set(null),this._draftEntityCat.set(null),this._entityValues.set([]),this._entityLoading.set(!1)}_toLabelMap(t){const n={};for(const s of t)n[s.iri]=s.label;return n}_available(t,n){const s=new Set(this._committed().filter(d=>d.dim===t).map(d=>d.valueIri));return n.filter(d=>!s.has(d.iri))}_applied(){const t=this._committed();return{mimes:t.filter(n=>"mime"===n.dim).map(n=>n.valueIri),contents:t.filter(n=>"content"===n.dim).map(n=>n.valueIri),entityCategories:t.filter(n=>"entity"===n.dim&&!n.isEntityInstance).map(n=>n.valueIri),entities:t.filter(n=>"entity"===n.dim&&n.isEntityInstance).map(n=>n.valueIri)}}_reset(t){var n=this;return(0,r.A)(function*(){n._committed.set([]),n._opts.set(F),n._adding.set(!1),n._resetDraft(),n._loading.set(!0);try{n._opts.set(yield t.requestAvailableFilters(j))}catch(s){console.error("[document-filter] Failed to load available filters",s)}finally{n._loading.set(!1)}})()}_refreshOptions(){var t=this;return(0,r.A)(function*(){t._refreshing.set(!0);try{t._opts.set(yield t.handlers().requestAvailableFilters(t._applied()))}catch(n){console.error("[document-filter] Adaptive refresh failed",n)}finally{t._refreshing.set(!1)}})()}_emitFilters(){const t=this._committed().map(n=>({type:"mime"===n.dim?"mime":"content"===n.dim?"content":n.isEntityInstance?"entityInstance":"entity",included:[n.valueIri],excluded:[]}));this.filtersChange.emit(t)}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=e.VBU({type:l,selectors:[["cue-doc-filter"]],inputs:{handlers:[1,"handlers"]},outputs:{filtersChange:"filtersChange"},decls:2,vars:1,consts:[["align","center","gap","s"],["align","center","gap","s","wrap","wrap"],["size","s",1,"muted"],["size","xs","variant","primary",3,"selected","passive","removable","removeLabel"],[1,"draft"],["size","xs","variant","tertiary",3,"disabled"],["size","xs","variant","danger"],["size","xs","variant","primary",3,"removed","selected","passive","removable","removeLabel"],[1,"chip-dim"],[1,"filter-select"],["size","xs",3,"valueChange","placeholder","underline","options","labelMap","value"],["size","xs","variant","ghost",3,"click"],["fontSize","s"],["size","xs",3,"valueChange","placeholder","underline","showFilter","options","labelMap"],["size","xs",3,"valueChange","placeholder","underline","showFilter","options","labelMap","value"],[1,"filter-select","entity-value"],["size","xs",3,"valueChange","placeholder","underline","loading","showFilter","options","labelMap"],["size","xs","variant","tertiary",3,"click","disabled"],["icon","add"],["size","xs","variant","danger",3,"click"]],template:function(n,s){1&n&&e.nVh(0,y,4,3,"cue-flexcontainer",0)(1,V,7,3,"cue-flexcontainer",1),2&n&&e.vxM(s._loading()?0:1)},dependencies:[a.v,b.$,m.L,g.a,p.z,f.Select,C.n,h.Typography,_.Kj],styles:["[_nghost-%COMP%]{display:block}.filter-select[_ngcontent-%COMP%]{width:170px}.filter-select.entity-value[_ngcontent-%COMP%]{width:200px}.draft[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:2px 6px 2px 10px;border:1px dashed var(--cue-border-color);border-radius:10px}.chip-dim[_ngcontent-%COMP%]{font-weight:600;opacity:.72;margin-inline-end:4px}.muted[_ngcontent-%COMP%]{color:var(--cue-color-darkmidgray)}"],changeDetection:0})}return l})()},2403(D,v,o){o.d(v,{V:()=>c});var r=o(7705),u=o(5547),i=o(5802);let c=(()=>{class _{el=(0,i.WQX)(u.aKT);renderer=(0,i.WQX)(u.sFG);cuePulse=(0,r.hFB)(!1);cuePulseColor=(0,r.hFB)("");cuePulseMode=(0,r.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,i.QZP)(()=>{const b=this.cuePulse(),m=this.cuePulseColor(),g=this.cuePulseMode(),p=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(p,this.activeClass),this.activeClass=""),this.renderer.removeStyle(p,"--cue-pulse-color"),this.renderer.removeStyle(p,"border-radius"),b){const f="text"===g?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(p,f),this.activeClass=f,m&&this.renderer.setStyle(p,"--cue-pulse-color",m),"border"===g&&setTimeout(()=>{const C=p.firstElementChild;if(C){const h=getComputedStyle(C).borderRadius;h&&"0px"!==h&&this.renderer.setStyle(p,"border-radius",h)}})}});ngOnDestroy(){const b=this.el.nativeElement;this.activeClass&&this.renderer.removeClass(b,this.activeClass),this.renderer.removeStyle(b,"border-radius")}ensureGlobalStyles(){const b="cue-pulse-global-styles";if(document.getElementById(b))return;const m=document.createElement("style");m.id=b,m.textContent="\n @keyframes cue-pulse-border-anim {\n 0% {\n box-shadow: 0 0 0 0 var(--cue-pulse-color, currentColor);\n }\n 70% {\n box-shadow: 0 0 0 8px transparent;\n }\n 100% {\n box-shadow: 0 0 0 0 transparent;\n }\n }\n\n @keyframes cue-pulse-text-anim {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n }\n\n .cue-pulse-border {\n animation: cue-pulse-border-anim 1.5s infinite ease-in-out;\n }\n\n .cue-pulse-text {\n animation: cue-pulse-text-anim 1.5s infinite ease-in-out;\n }\n ",document.head.appendChild(m)}static \u0275fac=function(m){return new(m||_)};static \u0275dir=u.FsC({type:_,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return _})()}}]);
|
package/804.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[804],{5448(D,f,a){a.d(f,{L:()=>v});var l=a(7705),i=a(2245),s=a(5547);const C=["*"];let v=(()=>{class n{fontSize=(0,l.hFB)("m");italic=(0,l.hFB)(!1);noWrap=(0,l.hFB)(!0);static \u0275fac=function(_){return new(_||n)};static \u0275cmp=s.VBU({type:n,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:C,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(_,d){1&_&&(s.NAR(),s.j41(0,"div")(1,"cue-typography",0),s.SdG(2),s.k0s()()),2&_&&(s.R7$(),s.Y8G("size",d.fontSize())("italic",d.italic())("noWrap",d.noWrap()))},dependencies:[i.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return n})()},2014(D,f,a){a.d(f,{z:()=>v});var l=a(7705),i=a(2271),s=a(5547);const C=["*"];let v=(()=>{class n{justify=(0,l.hFB)("start");size=(0,l.hFB)("l");widthStyle=(0,i.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(_){return new(_||n)};static \u0275cmp=s.VBU({type:n,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:C,decls:2,vars:4,template:function(_,d){1&_&&(s.NAR(),s.rj2(0,"div"),s.SdG(1),s.eux()),2&_&&s.xc7("justify-content",d.justify())("min-width",d.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return n})()},5971(D,f,a){a.d(f,{$:()=>_});var l=a(9769),i=a(7705),s=a(2271),C=a(7089),v=a(2403),n=a(5547);const h=["buttonElement"],e=["*"];let _=(()=>{class d{variant=(0,i.hFB)("primary");size=(0,i.hFB)("m");tooltip=(0,i.hFB)("");disabled=(0,i.hFB)(!1);selected=(0,i.geq)(!1);toggleButton=(0,i.hFB)(!1);loading=(0,i.hFB)(!1);fitParentWidth=(0,i.hFB)(!1);noWrap=(0,i.hFB)(!0);buttonElement=i.ebz.required("buttonElement");getStyles=(0,s.EW)(()=>[`\n padding: 0 var(--cue-button-${this.size()}-padding-x);\n\n --focus-color: var(--cue-button-${this.variant()}-focus-color);\n --cue-button-border-color: var(--cue-button-${this.variant()}-border-color);\n color: var(--cue-button-${this.variant()}-foreground);\n --background-color: var(--cue-button-${this.variant()}-background);\n\n --cue-icon-width: var(--cue-button-${this.size()}-icon-width);\n --button-height: var(--cue-button-${this.size()}-height);\n --cue-button-border-radius: var(--cue-button-border-radius, 9999px);\n --button-label-padding-x: var(--cue-button-${this.size()}-label-padding-x);\n `,this.disabled()?`\n color: var(--cue-button-${this.variant()}-disabled-foreground);\n --cue-button-border-color: var(--cue-button-${this.variant()}-disabled-border-color);\n --background-color: var(--cue-button-${this.variant()}-disabled-background);\n `:""].join(""));handleClick(m){m.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(m.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(u){return new(u||d)};static \u0275cmp=n.VBU({type:d,selectors:[["cue-button"]],viewQuery:function(u,p){1&u&&n.wEZ(p.buttonElement,h,5),2&u&&n.NyB()},inputs:{variant:[1,"variant"],size:[1,"size"],tooltip:[1,"tooltip"],disabled:[1,"disabled"],selected:[1,"selected"],toggleButton:[1,"toggleButton"],loading:[1,"loading"],fitParentWidth:[1,"fitParentWidth"],noWrap:[1,"noWrap"]},outputs:{selected:"selectedChange"},ngContentSelectors:e,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(u,p){1&u&&(n.NAR(),n.j41(0,"button",1,0),n.bIt("click",function(E){return p.handleClick(E)}),n.SdG(2),n.k0s()),2&u&&(n.Aen(p.getStyles()),n.xc7("white-space",p.noWrap()?"nowrap":"normal")("flex-basis",p.noWrap()?null:"auto")("min-width",p.noWrap()?null:"fit-content"),n.AVh("selected",p.selected())("ghost","ghost"===p.variant())("fit-parent-width",p.fitParentWidth()),n.Y8G("disabled",p.disabled())("cueTooltip",p.tooltip())("tooltipPlacement","top")("cuePulse",p.loading()))},dependencies:[l.MD,C.d,v.V],styles:['[_nghost-%COMP%]:has(.fit-parent-width){display:contents}@keyframes _ngcontent-%COMP%_pulse-border{0%{box-shadow:0 0 0 0 var(--focus-color)}50%{box-shadow:0 0 0 8px transparent}to{box-shadow:0 0 0 0 transparent}}button[_ngcontent-%COMP%]{min-width:0;pulse-border-radius:var(--cue-button-border-radius);appearance:none;padding:0;font:inherit;border:var(--cue-button-border-width) var(--cue-button-border-style) var(--cue-button-border-color);display:flex;justify-content:space-between;align-items:center;gap:var(--cue-button-gap);min-height:var(--button-height);height:auto;background-color:var(--background-color);border-radius:var(--cue-button-border-radius, 9999px);margin:3px;position:relative}button[style*="white-space: normal"][_ngcontent-%COMP%]{border-radius:30px!important;padding:10px!important}button.fit-parent-width[_ngcontent-%COMP%]{width:100%;min-width:0;margin-inline:0}button[_ngcontent-%COMP%]:not(.fit-parent-width){min-width:fit-content;width:auto}button[_ngcontent-%COMP%]:focus{outline:none}button[_ngcontent-%COMP%]:hover:not(:disabled), button[_ngcontent-%COMP%]:focus-within:not(:disabled){outline:1px solid var(--focus-color);outline-offset:2px;cursor:pointer}button.selected[_ngcontent-%COMP%]{outline:1px solid currentColor!important;outline-offset:2px;margin:3px}button.ghost[_ngcontent-%COMP%]:not(.selected){border:none}']})}return d})()},2339(D,f,a){a.d(f,{v:()=>d});var l=a(7705),i=a(5971),s=a(2014),C=a(5448),v=a(29),n=a(5547),h=a(5802);const e=["*"];function _(b,m){if(1&b){const u=n.RV6();n.j41(0,"span",2),n.bIt("click",function(M){h.eBV(u);const E=n.XpG();return h.Njj(E.onRemove(M))}),n.nrm(1,"cue-svg-icon",3),n.k0s()}if(2&b){const u=n.XpG();n.AVh("disabled",u.disabled()),n.BMQ("title",u.removeLabel())("aria-label",u.removeLabel())}}let d=(()=>{class b{size=(0,l.hFB)("s");selected=(0,l.geq)(!1);disabled=(0,l.geq)(!1);passive=(0,l.hFB)(!1);variant=(0,l.hFB)("primary");removable=(0,l.hFB)(!1);removeLabel=(0,l.hFB)("Remove");removed=(0,l.CGW)();toggleSelect(){this.passive()||this.selected.set(!this.selected())}onRemove(u){u.stopPropagation(),!this.disabled()&&this.removed.emit()}static \u0275fac=function(p){return new(p||b)};static \u0275cmp=n.VBU({type:b,selectors:[["cue-chip"]],inputs:{size:[1,"size"],selected:[1,"selected"],disabled:[1,"disabled"],passive:[1,"passive"],variant:[1,"variant"],removable:[1,"removable"],removeLabel:[1,"removeLabel"]},outputs:{selected:"selectedChange",disabled:"disabledChange",removed:"removed"},ngContentSelectors:e,decls:6,vars:4,consts:[[1,"is-chip",3,"click","size","disabled","variant"],[1,"chip-remove",3,"disabled"],[1,"chip-remove",3,"click"],["name","close"]],template:function(p,M){1&p&&(n.NAR(),n.j41(0,"cue-button",0),n.bIt("click",function(){return M.toggleSelect()}),n.nrm(1,"cue-button-padder"),n.j41(2,"cue-button-label"),n.SdG(3),n.k0s(),n.nrm(4,"cue-button-padder"),n.nVh(5,_,2,4,"span",1),n.k0s()),2&p&&(n.Y8G("size",M.size())("disabled",M.disabled())("variant",M.selected()?M.variant():"secondary"),n.R7$(5),n.vxM(M.removable()?5:-1))},dependencies:[i.$,s.z,C.L,v.A],styles:["cue-button.is-chip[_ngcontent-%COMP%]{--cue-button-s-padding-x: 8px;--cue-button-m-padding-x: 12px;--cue-button-l-padding-x: 16px}.chip-remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;--cue-icon-width: .9em;margin-inline-start:4px;margin-inline-end:-2px;border-radius:50%;cursor:pointer;opacity:.6;transition:opacity .1s ease,background-color .1s ease}.chip-remove[_ngcontent-%COMP%]:hover{opacity:1;background-color:color-mix(in srgb,currentColor 18%,transparent)}.chip-remove.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.3}"],changeDetection:0})}return b})()},804(D,f,a){a.d(f,{ChipInput:()=>E});var l=a(7705),i=a(5802),s=a(9417),C=a(2245),v=a(5381),n=a(29),h=a(2339),e=a(5547);const _=["inputField"];function d(c,P){1&c&&e.EFF(0," * ")}function b(c,P){if(1&c&&(e.j41(0,"cue-typography",2),e.EFF(1),e.nVh(2,d,1,0),e.k0s()),2&c){const t=e.XpG();e.Y8G("size",t.size()),e.R7$(),e.SpI(" ",t.label()," "),e.R7$(),e.vxM(t.required()?2:-1)}}function m(c,P){if(1&c){const t=e.RV6();e.j41(0,"button",11),e.bIt("click",function(o){i.eBV(t);const g=e.XpG().$index;return e.XpG().removeChip(g),i.Njj(o.stopPropagation())}),e.nrm(1,"cue-svg-icon",12),e.k0s()}if(2&c){const t=e.XpG(2);e.Y8G("disabled",t.disabled)}}function u(c,P){if(1&c){const t=e.RV6();e.j41(0,"div",8),e.bIt("mouseenter",function(){const o=i.eBV(t).$index,g=e.XpG();return i.Njj(g.hoveredChip.set(o))})("mouseleave",function(){i.eBV(t);const o=e.XpG();return i.Njj(o.hoveredChip.set(null))}),e.j41(1,"cue-chip",9),e.bIt("click",function(){const o=i.eBV(t).$implicit,g=e.XpG();return i.Njj(g.clickedChip.emit(o))}),e.EFF(2),e.k0s(),e.nVh(3,m,2,1,"button",10),e.k0s()}if(2&c){const t=P.$implicit,r=P.$index,o=e.XpG();e.R7$(),e.Y8G("selected",!0)("disabled",o.disabled)("passive",!0)("variant",o.variant()),e.R7$(),e.SpI(" ",o.labelMap()[t]||t," "),e.R7$(),e.vxM(o.allowDelete()&&o.hoveredChip()===r?3:-1)}}function p(c,P){if(1&c){const t=e.RV6();e.j41(0,"input",13,0),e.bIt("keydown",function(o){i.eBV(t);const g=e.XpG();return i.Njj(g.onKeyDown(o))})("focus",function(){i.eBV(t);const o=e.XpG();return i.Njj(o.isFocused=!0)})("blur",function(){i.eBV(t);const o=e.XpG();return i.Njj(o.onBlur())})("input",function(){i.eBV(t);const o=e.XpG();return i.Njj(o.validationError.set(void 0))}),e.mxI("ngModelChange",function(o){i.eBV(t);const g=e.XpG();return e.DH7(g.inputValue,o)||(g.inputValue=o),i.Njj(o)}),e.k0s()}if(2&c){const t=e.XpG();e.Y8G("placeholder",t.placeholder()),e.R50("ngModel",t.inputValue)}}function M(c,P){if(1&c&&(e.j41(0,"cue-typography",7),e.EFF(1),e.k0s()),2&c){const t=e.XpG();e.R7$(),e.JRh(t.validationError()??t.error())}}let E=(()=>{class c{values=(0,l.geq)([]);labelMap=(0,l.hFB)({});label=(0,l.hFB)("");placeholder=(0,l.hFB)("Add item...");error=(0,l.hFB)(void 0);required=(0,l.hFB)(!1);size=(0,l.hFB)("m");variant=(0,l.hFB)("secondary");allowAdd=(0,l.hFB)(!0);allowDelete=(0,l.hFB)(!0);allowInternalAdd=(0,l.hFB)(!0);validator=(0,l.hFB)(void 0);validationErrorMessage=(0,l.hFB)(void 0);clickedChip=(0,l.CGW)();chipRemoved=(0,l.CGW)();chipAdded=(0,l.CGW)();isFocused=!1;disabled=!1;inputValue=(0,i.vPA)("");hoveredChip=(0,i.vPA)(null);validationError=(0,i.vPA)(void 0);inputField;onChange=t=>{};onTouched=()=>{};writeValue(t){this.values.set(t||[])}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}focusInput(){this.allowAdd()&&!this.disabled&&this.inputField?.nativeElement&&this.inputField.nativeElement.focus()}onKeyDown(t){const o=t.target.value.trim();"Enter"===t.key&&o?(this.addChip(o),t.preventDefault()):"Backspace"===t.key&&!o&&this.values().length>0&&(this.removeChip(this.values().length-1),t.preventDefault())}addChip(t){if(!t)return;const r=this.validator();if(!r||r.test(t)){if(this.validationError.set(void 0),this.chipAdded.emit(t),this.allowInternalAdd()&&!this.values().includes(t)){const o=[...this.values(),t];this.values.set(o),this.onChange(o)}this.inputValue.set("")}else this.validationError.set(this.validationErrorMessage()??`Invalid value: ${t}`)}removeChip(t){if(this.allowDelete()&&!this.disabled){const r=this.values()[t],o=this.values().filter((g,y)=>y!==t);this.values.set(o),this.onChange(o),void 0!==r&&this.chipRemoved.emit(r)}}onBlur(){this.isFocused=!1,this.onTouched();const t=this.inputValue().trim();t&&this.allowAdd()&&this.addChip(t)}static \u0275fac=function(r){return new(r||c)};static \u0275cmp=e.VBU({type:c,selectors:[["cue-chip-input"]],viewQuery:function(r,o){if(1&r&&e.GBs(_,5),2&r){let g;e.mGM(g=e.lsd())&&(o.inputField=g.first)}},inputs:{values:[1,"values"],labelMap:[1,"labelMap"],label:[1,"label"],placeholder:[1,"placeholder"],error:[1,"error"],required:[1,"required"],size:[1,"size"],variant:[1,"variant"],allowAdd:[1,"allowAdd"],allowDelete:[1,"allowDelete"],allowInternalAdd:[1,"allowInternalAdd"],validator:[1,"validator"],validationErrorMessage:[1,"validationErrorMessage"]},outputs:{values:"valuesChange",clickedChip:"clickedChip",chipRemoved:"chipRemoved",chipAdded:"chipAdded"},features:[e.Jv_([{provide:s.kq,useExisting:(0,i.Rfq)(()=>c),multi:!0}])],decls:8,vars:9,consts:[["inputField",""],[1,"form-field",3,"click"],[1,"label",3,"size"],[1,"chip-container"],["align","center","gap","s","wrap","wrap"],[1,"chip-wrapper"],["type","text",1,"input",3,"placeholder","ngModel"],["size","s",1,"error-text"],[1,"chip-wrapper",3,"mouseenter","mouseleave"],["size","s",3,"click","selected","disabled","passive","variant"],["type","button",1,"delete-button",3,"disabled"],["type","button",1,"delete-button",3,"click","disabled"],["name","close","size","xs"],["type","text",1,"input",3,"keydown","focus","blur","input","ngModelChange","placeholder","ngModel"]],template:function(r,o){1&r&&(e.j41(0,"div",1),e.bIt("click",function(){return o.focusInput()}),e.nVh(1,b,3,3,"cue-typography",2),e.j41(2,"div",3)(3,"cue-flexcontainer",4),e.Z7z(4,u,4,6,"div",5,e.fX1),e.nVh(6,p,2,2,"input",6),e.k0s()(),e.nVh(7,M,2,1,"cue-typography",7),e.k0s()),2&r&&(e.HbH("size-"+o.size()),e.AVh("focused",!0),e.R7$(),e.vxM(o.label()?1:-1),e.R7$(),e.xc7("padding-top",o.label()?o.allowDelete()?"18px":"22px":"0"),e.R7$(2),e.Dyx(o.values()),e.R7$(2),e.vxM(o.allowAdd()&&!o.disabled?6:-1),e.R7$(),e.vxM(o.validationError()??o.error()?7:-1))},dependencies:[C.Typography,v.n,n.A,h.v,s.YN,s.me,s.BC,s.vS],styles:[".form-field[_ngcontent-%COMP%]{position:relative;min-height:40px}.chip-container[_ngcontent-%COMP%]{width:100%;border-bottom:1px solid var(--cue-input-border-bottom-color);padding-bottom:4px}.chip-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;padding:2px}.delete-button[_ngcontent-%COMP%]{position:absolute;top:-4px;right:-4px;background:var(--cue-chip-delete-background-color);border:none;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--cue-chip-delete-icon-color);font-size:10px;z-index:1}.delete-button[_ngcontent-%COMP%]:hover{background:var(--cue-chip-delete-hover-background-color);transform:scale(1.1)}.delete-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.input[_ngcontent-%COMP%]{color:var(--cue-input-value-color);border:none;background:none;outline:none;font-family:var(--cue-font-family);min-width:120px;flex:1}.size-xs[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-xs-padding);font-size:var(--cue-input-xs-font-size)}.size-s[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-s-padding);font-size:var(--cue-input-s-font-size)}.size-m[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-m-padding);font-size:var(--cue-input-m-font-size)}.size-l[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-l-padding);font-size:var(--cue-input-l-font-size)}.input[_ngcontent-%COMP%]::placeholder{color:var(--cue-input-placeholder-color);font-family:var(--cue-font-family)}.input[_ngcontent-%COMP%]:-webkit-autofill, .input[_ngcontent-%COMP%]:-webkit-autofill:hover, .input[_ngcontent-%COMP%]:-webkit-autofill:focus{-webkit-box-shadow:0 0 0px 1000px transparent inset;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s;-webkit-text-fill-color:var(--cue-input-value-color)}.label[_ngcontent-%COMP%]{position:absolute;left:0;pointer-events:none;z-index:1;text-align:left;width:100%;color:var(--cue-input-value-color)}.size-xs[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-focused-top);font-size:var(--cue-input-xs-label-focused-font-size)}.size-s[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-focused-top);font-size:var(--cue-input-s-label-focused-font-size)}.size-m[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-focused-top);font-size:var(--cue-input-m-label-focused-font-size)}.size-l[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-focused-top);font-size:var(--cue-input-l-label-focused-font-size)}.error-text[_ngcontent-%COMP%]{color:var(--cue-error);margin-top:4px;min-height:18px}.form-field[_ngcontent-%COMP%]:focus-within .chip-container[_ngcontent-%COMP%]{border-bottom-color:var(--cue-primary, #007bff)}"],changeDetection:0})}return c})()},2403(D,f,a){a.d(f,{V:()=>C});var l=a(7705),i=a(5547),s=a(5802);let C=(()=>{class v{el=(0,s.WQX)(i.aKT);renderer=(0,s.WQX)(i.sFG);cuePulse=(0,l.hFB)(!1);cuePulseColor=(0,l.hFB)("");cuePulseMode=(0,l.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,s.QZP)(()=>{const h=this.cuePulse(),e=this.cuePulseColor(),_=this.cuePulseMode(),d=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(d,this.activeClass),this.activeClass=""),this.renderer.removeStyle(d,"--cue-pulse-color"),this.renderer.removeStyle(d,"border-radius"),h){const b="text"===_?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(d,b),this.activeClass=b,e&&this.renderer.setStyle(d,"--cue-pulse-color",e),"border"===_&&setTimeout(()=>{const m=d.firstElementChild;if(m){const u=getComputedStyle(m).borderRadius;u&&"0px"!==u&&this.renderer.setStyle(d,"border-radius",u)}})}});ngOnDestroy(){const h=this.el.nativeElement;this.activeClass&&this.renderer.removeClass(h,this.activeClass),this.renderer.removeStyle(h,"border-radius")}ensureGlobalStyles(){const h="cue-pulse-global-styles";if(document.getElementById(h))return;const e=document.createElement("style");e.id=h,e.textContent="\n @keyframes cue-pulse-border-anim {\n 0% {\n box-shadow: 0 0 0 0 var(--cue-pulse-color, currentColor);\n }\n 70% {\n box-shadow: 0 0 0 8px transparent;\n }\n 100% {\n box-shadow: 0 0 0 0 transparent;\n }\n }\n\n @keyframes cue-pulse-text-anim {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n }\n\n .cue-pulse-border {\n animation: cue-pulse-border-anim 1.5s infinite ease-in-out;\n }\n\n .cue-pulse-text {\n animation: cue-pulse-text-anim 1.5s infinite ease-in-out;\n }\n ",document.head.appendChild(e)}static \u0275fac=function(e){return new(e||v)};static \u0275dir=i.FsC({type:v,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return v})()}}]);
|
package/8791.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[8791],{8791(R,v,l){l.d(v,{CueDocumentList:()=>j});var h=l(467),o=l(7705),u=l(5802),p=l(2271),C=l(4879),w=l(2065),b=l(4372),M=l(5381),O=l(2245),I=l(7851),y=l(7293),i=l(5547);function E(c,D){if(1&c&&(i.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),i.EFF(2),i.k0s()()),2&c){const e=i.XpG();i.R7$(2),i.SpI(" ",e.errorMessage()," ")}}function L(c,D){if(1&c&&i.nrm(0,"cue-logo-link",4),2&c){const e=i.XpG(2);i.Y8G("projectId",e.projectId())}}function P(c,D){if(1&c){const e=i.RV6();i.j41(0,"div",1)(1,"cue-doc-list",3),i.bIt("clickedDocument",function(s){u.eBV(e);const n=i.XpG();return u.Njj(n.clickedDocument.emit(s))})("clickedDownloadDocument",function(s){u.eBV(e);const n=i.XpG();return u.Njj(n.clickedDownloadDocument.emit(s))})("clickedOpenInDir",function(s){u.eBV(e);const n=i.XpG();return u.Njj(n.clickedOpenInDir.emit(s))})("clickedOpen",function(s){u.eBV(e);const n=i.XpG();return u.Njj(n.clickedOpen.emit(s))}),i.k0s(),i.nVh(2,L,1,1,"cue-logo-link",4),i.k0s()}if(2&c){const e=i.XpG();i.Y8G("cueLogoLoader","loading"===e.state()),i.R7$(),i.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e.handlers())("availableContentCategories",e.availableContentCategories())("detailedView",e.detailedView())("simple",e.simple())("pageSize",e.pageSize())("size",e.size())("prefetchPages",e.prefetchPages())("showOpenInDocumentViewerAction",e.showOpenInDocumentViewerAction())("showOpenInFileManagerAction",e.showOpenInFileManagerAction())("customOverlayActions",e.customOverlayActions())("variant",e.variant()),i.R7$(),i.vxM(e.showLogo()?2:-1)}}function f(c){return c.split("?")[0].trim()}let j=(()=>{class c{projectId=(0,o.hFB)(void 0);uuids=(0,o.hFB)([]);suffixes=(0,o.hFB)(void 0);mimeTypes=(0,o.hFB)(void 0);contentCategories=(0,o.hFB)(void 0);sdkState=(0,o.hFB)(void 0);detailedView=(0,o.hFB)(!1,{transform:o.L39});simple=(0,o.hFB)(!1,{transform:o.L39});pageSize=(0,o.hFB)(10,{transform:o.Udg});size=(0,o.hFB)("m");prefetchPages=(0,o.hFB)(3,{transform:o.Udg});showOpenInDocumentViewerAction=(0,o.hFB)(!1,{transform:o.L39});showOpenInFileManagerAction=(0,o.hFB)(!1,{transform:o.L39});customMenuItems=(0,o.hFB)([]);showLogo=(0,o.hFB)(!1,{transform:o.L39});variant=(0,o.hFB)("none");clickedDocument=(0,o.CGW)();clickedDownloadDocument=(0,o.CGW)();clickedOpenInDir=(0,o.CGW)();clickedOpen=(0,o.CGW)();state=(0,u.vPA)("idle");errorMessage=(0,u.vPA)(null);documentData=(0,u.vPA)({});availableContentCategories=(0,u.vPA)(void 0);_filterResolvedUuids=(0,u.vPA)(void 0);documentRefs=(0,p.EW)(()=>{const e=new Set;return(void 0!==this._filterResolvedUuids()?this._filterResolvedUuids()??[]:this.uuids()??[]).map(f).filter(s=>!!s).filter(s=>!e.has(s)&&(e.add(s),!0)).map(s=>({id:s}))});customOverlayActions=(0,p.EW)(()=>{const e=this.projectId();return[...e?[{label:"Open in Cue",icon:"external-link",action:n=>{const a=n.rowData;window.open(`https://cue.qaecy.com/r/${encodeURIComponent(e)}/${encodeURIComponent(a.id)}`,"_blank","noopener,noreferrer")}}]:[],...(this.customMenuItems()||[]).map(n=>({label:n.label,icon:n.icon,action:a=>{n.action(a.rowData,a)}}))]});handlers=(0,p.EW)(()=>{var e=this;const t=this._docs();if(t)return{requestData:(s=(0,h.A)(function*(n){const a=n.map(f).filter(d=>!!d),r=a.filter(d=>!e.documentData()[d]);if(console.debug("[CueDocumentListWC] requestData",{requestedCount:a.length,missingCount:r.length,missing:r}),r.length)try{const d=t,m=e.simple()&&d.fetchDocumentDataSimple?yield d.fetchDocumentDataSimple(r):yield t.fetchDocumentData(r);console.debug("[CueDocumentListWC] fetchDocumentData resolved",{fetchedCount:Object.keys(m).length,ids:Object.keys(m)});const g={};Object.values(m).forEach(_=>{g[_.id]=function A(c){return{id:c.id,path:c.path,suffix:c.suffix,size:c.size,contentIRI:c.contentIRI,providerId:c.providerId,tags:c.tags??[],summary:c.summary??"",categories:c.categories??[],subject:c.subject,relevance:0}}(_)}),Object.keys(g).length>0&&e.documentData.update(_=>({..._,...g}))}catch(d){console.error("[CueDocumentListWC] Failed to fetch document data:",d),e.errorMessage.set(d instanceof Error?d.message:String(d)),e.state.set("error")}}),function(a){return s.apply(this,arguments)}),requestDownload:function(){var s=(0,h.A)(function*(n){const a=e._cue(),r=e.projectId();if(a&&r)try{const d=yield a.storage.getDownloadUrl(r,n.id,n.suffix,"raw"),m=yield fetch(d);if(!m.ok)throw new Error(`Download failed: ${m.status} ${m.statusText}`);const g=yield m.blob(),_=(0,b.M)(n.path)||`${n.id}${n.suffix||""}`;(0,w.KE)(g,_)}catch(d){console.error("[CueDocumentListWC] Failed to download document:",d)}});return function(a){return s.apply(this,arguments)}}(),requestOpen:(s,n)=>{console.log("[CueDocumentListWC] requestOpen",{documentUUID:s,document:n})},requestOpenInDir:(s,n)=>{console.log("[CueDocumentListWC] requestOpenInDir",{documentUUID:s,document:n})}};var s});_cue=(0,u.vPA)(void 0);_docs=(0,u.vPA)(void 0);_ownedView;_inputWarningTimer;_unsubscribeCategories;_lastSetupSignature;constructor(){this._inputWarningTimer=setTimeout(()=>{this.projectId()||console.warn('[cue-document-list] Required input "projectId" is not set. Pass the Cue project ID to load documents.'),this.sdkState()||console.warn('[cue-document-list] Required input "sdkState" is not set. Pass a { cue, view, or documents } object to enable document loading.')},3e3),(0,u.QZP)(()=>{const e=this.projectId(),t=this.sdkState(),s=t?.language??"en";if(console.debug("[CueDocumentListWC] input state changed",{projectId:e,uuids:this.uuids().length,hasSdkState:!!t,hasCue:!!t?.cue,hasView:!!t?.view,hasDocuments:!!t?.documents}),!e||!t)return this._clearRuntimeState(),void this.state.set("idle");const n={projectId:e,cue:t.cue,view:t.view,documents:t.documents,language:s,simple:this.simple()};if(this._isSameSetupSignature(n))return this.state.set("ready"),void this.errorMessage.set(null);this._setupFromSdkState(e,t),this._lastSetupSignature=n,this.state.set("ready"),this.errorMessage.set(null)}),(0,u.QZP)(()=>{const e=this.suffixes(),t=this.mimeTypes(),s=this.contentCategories(),n=this._docs();void 0!==e||void 0!==t||void 0!==s?this._fetchByFilter(e,t,s,n):this._filterResolvedUuids.set(void 0)}),(0,u.QZP)(()=>{const e=new Set(this.documentRefs().map(t=>t.id));this.documentData.update(t=>Object.fromEntries(Object.entries(t).filter(([n])=>e.has(n))))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0}_setupFromSdkState(e,t){const s=t.language??"en";if(this.documentData.set({}),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this.availableContentCategories.set(t.availableContentCategories?t.availableContentCategories:void 0),t.documents)return t.documents.setLanguage(s),this._docs.set(t.documents),void this._cue.set(t.cue);if(t.view)return t.view.setLanguage(s),this._docs.set(t.view.documents),this._cue.set(t.cue),void(this.simple()||this._bindCategoriesFromView(t.view));if(t.cue){if(this.simple())return this._docs.set(t.cue.createProjectDocuments(e)),this._cue.set(t.cue),void this.availableContentCategories.set(void 0);const n=t.cue.createProjectView(e,{language:s});return this._ownedView=n,this._docs.set(n.documents),this._cue.set(t.cue),void this._bindCategoriesFromView(n)}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(e){const t=()=>{this.availableContentCategories.set(e.availableContentCategories.get())};t(),this._unsubscribeCategories=e.availableContentCategories.subscribe(t)}_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)}_fetchByFilter(e,t,s,n){var a=this;return(0,h.A)(function*(){if(n){a.state.set("loading");try{let r;if(void 0!==e&&e.length>0)r=yield n.documentsBySuffix(e);else if(void 0!==t&&t.length>0)r=yield n.documentsByMime(t);else{if(!(void 0!==s&&s.length>0))return a._filterResolvedUuids.set([]),void a.state.set("ready");r=yield n.documentsByContentCategory(s)}a._filterResolvedUuids.set(r.map(d=>d.uuid)),a.state.set("ready")}catch(r){console.error("[CueDocumentListWC] Failed to fetch documents by filter",r),a.errorMessage.set(r instanceof Error?r.message:"Failed to load documents."),a.state.set("error")}}else a._filterResolvedUuids.set([])})()}_isSameSetupSignature(e){const t=this._lastSetupSignature;return!!t&&t.projectId===e.projectId&&t.cue===e.cue&&t.view===e.view&&t.documents===e.documents&&t.language===e.language&&t.simple===e.simple}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=i.VBU({type:c,selectors:[["cue-document-list"]],inputs:{projectId:[1,"projectId"],uuids:[1,"uuids"],suffixes:[1,"suffixes"],mimeTypes:[1,"mimeTypes"],contentCategories:[1,"contentCategories"],sdkState:[1,"sdkState"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],size:[1,"size"],prefetchPages:[1,"prefetchPages"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customMenuItems:[1,"customMenuItems"],showLogo:[1,"showLogo"],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"],[2,"position","relative","width","100%",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[3,"clickedDocument","clickedDownloadDocument","clickedOpenInDir","clickedOpen","documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","size","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"],[2,"position","absolute","top","8px","left","8px","z-index","5",3,"projectId"]],template:function(t,s){1&t&&i.nVh(0,E,3,1,"cue-flexcontainer",0)(1,P,3,15,"div",1),2&t&&i.vxM("error"===s.state()?0:1)},dependencies:[C.g,M.n,O.Typography,I.k,y.x],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return c})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[8791],{7293(j,M,a){a.d(M,{x:()=>w});var h=a(7705),i=a(5802),r=a(2271),v=a(4613),O=a(9352),I=a(7089),d=a(5547);function b(g,y){1&g&&d.nrm(0,"cue-logo",4)}let w=(()=>{class g{projectId=(0,h.hFB)(void 0);resourceId=(0,h.hFB)(void 0);_active=(0,i.vPA)(!0);onHover(){this._active.set(!1),requestAnimationFrame(()=>this._active.set(!0))}_title=(0,r.EW)(()=>this.projectId()&&this.resourceId()?"components.logoLink.showResourceInCue":this.projectId()?"components.logoLink.openProjectInCue":"components.logoLink.openCuePortal");_href=(0,r.EW)(()=>{const s=this.projectId(),m=this.resourceId();return s&&m?`https://cue.qaecy.com/r/${encodeURIComponent(s)}/${encodeURIComponent(m)}`:s?`https://cue.qaecy.com/home/projects?p=${encodeURIComponent(s)}`:"https://cue.qaecy.com/home/projects"});static \u0275fac=function(m){return new(m||g)};static \u0275cmp=d.VBU({type:g,selectors:[["cue-logo-link"]],inputs:{projectId:[1,"projectId"],resourceId:[1,"resourceId"]},decls:6,vars:5,consts:[["target","_blank","rel","noopener noreferrer",1,"link",3,"mouseenter","href"],[1,"logo-stack",3,"cueTooltip"],["size","xs",1,"logo-bg"],[1,"logo-fg"],["size","xs"]],template:function(m,f){1&m&&(d.j41(0,"a",0),d.bIt("mouseenter",function(){return f.onHover()}),d.j41(1,"div",1),d.nI1(2,"transloco"),d.nrm(3,"cue-logo",2),d.j41(4,"div",3),d.nVh(5,b,1,0,"cue-logo",4),d.k0s()()()),2&m&&(d.Y8G("href",f._href(),d.B4B),d.R7$(),d.Y8G("cueTooltip",d.bMT(2,3,f._title())),d.R7$(4),d.vxM(f._active()?5:-1))},dependencies:[v.Logo,I.d,O.Kj],styles:["[_nghost-%COMP%]{display:inline-block;line-height:0}.link[_ngcontent-%COMP%]{display:block;text-decoration:none;cursor:pointer}.logo-stack[_ngcontent-%COMP%]{position:relative;display:inline-block;line-height:0}.logo-bg[_ngcontent-%COMP%]{display:block;opacity:.3;transition:opacity .2s ease}.link[_ngcontent-%COMP%]:hover .logo-bg[_ngcontent-%COMP%]{opacity:.15}.logo-fg[_ngcontent-%COMP%]{position:absolute;inset:0;opacity:0;transition:opacity .15s ease}.link[_ngcontent-%COMP%]:hover .logo-fg[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}return g})()},8791(j,M,a){a.d(M,{CueDocumentList:()=>A});var h=a(467),i=a(7705),r=a(5802),v=a(2271),O=a(4879),I=a(2065),d=a(4372),b=a(5381),w=a(2245),g=a(7851),y=a(7293),s=a(5547);function m(c,L){if(1&c&&(s.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),s.EFF(2),s.k0s()()),2&c){const e=s.XpG();s.R7$(2),s.SpI(" ",e.errorMessage()," ")}}function f(c,L){if(1&c&&s.nrm(0,"cue-logo-link",4),2&c){const e=s.XpG(2);s.Y8G("projectId",e.projectId())}}function P(c,L){if(1&c){const e=s.RV6();s.j41(0,"div",1)(1,"cue-doc-list",3),s.bIt("clickedDocument",function(o){r.eBV(e);const n=s.XpG();return r.Njj(n.clickedDocument.emit(o))})("clickedDownloadDocument",function(o){r.eBV(e);const n=s.XpG();return r.Njj(n.clickedDownloadDocument.emit(o))})("clickedOpenInDir",function(o){r.eBV(e);const n=s.XpG();return r.Njj(n.clickedOpenInDir.emit(o))})("clickedOpen",function(o){r.eBV(e);const n=s.XpG();return r.Njj(n.clickedOpen.emit(o))}),s.k0s(),s.nVh(2,f,1,1,"cue-logo-link",4),s.k0s()}if(2&c){const e=s.XpG();s.Y8G("cueLogoLoader","loading"===e.state()),s.R7$(),s.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e.handlers())("availableContentCategories",e.availableContentCategories())("detailedView",e.detailedView())("simple",e.simple())("pageSize",e.pageSize())("size",e.size())("prefetchPages",e.prefetchPages())("showOpenInDocumentViewerAction",e.showOpenInDocumentViewerAction())("showOpenInFileManagerAction",e.showOpenInFileManagerAction())("customOverlayActions",e.customOverlayActions())("variant",e.variant()),s.R7$(),s.vxM(e.showLogo()?2:-1)}}function E(c){return c.split("?")[0].trim()}let A=(()=>{class c{projectId=(0,i.hFB)(void 0);uuids=(0,i.hFB)([]);suffixes=(0,i.hFB)(void 0);mimeTypes=(0,i.hFB)(void 0);contentCategories=(0,i.hFB)(void 0);sdkState=(0,i.hFB)(void 0);detailedView=(0,i.hFB)(!1,{transform:i.L39});simple=(0,i.hFB)(!1,{transform:i.L39});pageSize=(0,i.hFB)(10,{transform:i.Udg});size=(0,i.hFB)("m");prefetchPages=(0,i.hFB)(3,{transform:i.Udg});showOpenInDocumentViewerAction=(0,i.hFB)(!1,{transform:i.L39});showOpenInFileManagerAction=(0,i.hFB)(!1,{transform:i.L39});customMenuItems=(0,i.hFB)([]);showLogo=(0,i.hFB)(!1,{transform:i.L39});variant=(0,i.hFB)("none");clickedDocument=(0,i.CGW)();clickedDownloadDocument=(0,i.CGW)();clickedOpenInDir=(0,i.CGW)();clickedOpen=(0,i.CGW)();state=(0,r.vPA)("idle");errorMessage=(0,r.vPA)(null);documentData=(0,r.vPA)({});availableContentCategories=(0,r.vPA)(void 0);_filterResolvedUuids=(0,r.vPA)(void 0);documentRefs=(0,v.EW)(()=>{const e=new Set;return(void 0!==this._filterResolvedUuids()?this._filterResolvedUuids()??[]:this.uuids()??[]).map(E).filter(o=>!!o).filter(o=>!e.has(o)&&(e.add(o),!0)).map(o=>({id:o}))});customOverlayActions=(0,v.EW)(()=>{const e=this.projectId();return[...e?[{label:"Open in Cue",icon:"external-link",action:n=>{const u=n.rowData;window.open(`https://cue.qaecy.com/r/${encodeURIComponent(e)}/${encodeURIComponent(u.id)}`,"_blank","noopener,noreferrer")}}]:[],...(this.customMenuItems()||[]).map(n=>({label:n.label,icon:n.icon,action:u=>{n.action(u.rowData,u)}}))]});handlers=(0,v.EW)(()=>{var e=this;const t=this._docs();if(t)return{requestData:(o=(0,h.A)(function*(n){const u=n.map(E).filter(_=>!!_),l=u.filter(_=>!e.documentData()[_]);if(console.debug("[CueDocumentListWC] requestData",{requestedCount:u.length,missingCount:l.length,missing:l}),l.length)try{const _=t,p=e.simple()&&_.fetchDocumentDataSimple?yield _.fetchDocumentDataSimple(l):yield t.fetchDocumentData(l);console.debug("[CueDocumentListWC] fetchDocumentData resolved",{fetchedCount:Object.keys(p).length,ids:Object.keys(p)});const C={};Object.values(p).forEach(D=>{C[D.id]=function R(c){return{id:c.id,path:c.path,suffix:c.suffix,size:c.size,contentIRI:c.contentIRI,providerId:c.providerId,tags:c.tags??[],summary:c.summary??"",categories:c.categories??[],subject:c.subject,relevance:0}}(D)}),Object.keys(C).length>0&&e.documentData.update(D=>({...D,...C}))}catch(_){console.error("[CueDocumentListWC] Failed to fetch document data:",_),e.errorMessage.set(_ instanceof Error?_.message:String(_)),e.state.set("error")}}),function(u){return o.apply(this,arguments)}),requestDownload:function(){var o=(0,h.A)(function*(n){const u=e._cue(),l=e.projectId();if(u&&l)try{const _=yield u.storage.getDownloadUrl(l,n.id,n.suffix,"raw"),p=yield fetch(_);if(!p.ok)throw new Error(`Download failed: ${p.status} ${p.statusText}`);const C=yield p.blob(),D=(0,d.M)(n.path)||`${n.id}${n.suffix||""}`;(0,I.KE)(C,D)}catch(_){console.error("[CueDocumentListWC] Failed to download document:",_)}});return function(u){return o.apply(this,arguments)}}(),requestOpen:(o,n)=>{console.log("[CueDocumentListWC] requestOpen",{documentUUID:o,document:n})},requestOpenInDir:(o,n)=>{console.log("[CueDocumentListWC] requestOpenInDir",{documentUUID:o,document:n})}};var o});_cue=(0,r.vPA)(void 0);_docs=(0,r.vPA)(void 0);_ownedView;_inputWarningTimer;_unsubscribeCategories;_lastSetupSignature;constructor(){this._inputWarningTimer=setTimeout(()=>{this.projectId()||console.warn('[cue-document-list] Required input "projectId" is not set. Pass the Cue project ID to load documents.'),this.sdkState()||console.warn('[cue-document-list] Required input "sdkState" is not set. Pass a { cue, view, or documents } object to enable document loading.')},3e3),(0,r.QZP)(()=>{const e=this.projectId(),t=this.sdkState(),o=t?.language??"en";if(console.debug("[CueDocumentListWC] input state changed",{projectId:e,uuids:this.uuids().length,hasSdkState:!!t,hasCue:!!t?.cue,hasView:!!t?.view,hasDocuments:!!t?.documents}),!e||!t)return this._clearRuntimeState(),void this.state.set("idle");const n={projectId:e,cue:t.cue,view:t.view,documents:t.documents,language:o,simple:this.simple()};if(this._isSameSetupSignature(n))return this.state.set("ready"),void this.errorMessage.set(null);this._setupFromSdkState(e,t),this._lastSetupSignature=n,this.state.set("ready"),this.errorMessage.set(null)}),(0,r.QZP)(()=>{const e=this.suffixes(),t=this.mimeTypes(),o=this.contentCategories(),n=this._docs();void 0!==e||void 0!==t||void 0!==o?this._fetchByFilter(e,t,o,n):this._filterResolvedUuids.set(void 0)}),(0,r.QZP)(()=>{const e=new Set(this.documentRefs().map(t=>t.id));this.documentData.update(t=>Object.fromEntries(Object.entries(t).filter(([n])=>e.has(n))))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0}_setupFromSdkState(e,t){const o=t.language??"en";if(this.documentData.set({}),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this.availableContentCategories.set(t.availableContentCategories?t.availableContentCategories:void 0),t.documents)return t.documents.setLanguage(o),this._docs.set(t.documents),void this._cue.set(t.cue);if(t.view)return t.view.setLanguage(o),this._docs.set(t.view.documents),this._cue.set(t.cue),void(this.simple()||this._bindCategoriesFromView(t.view));if(t.cue){if(this.simple())return this._docs.set(t.cue.createProjectDocuments(e)),this._cue.set(t.cue),void this.availableContentCategories.set(void 0);const n=t.cue.createProjectView(e,{language:o});return this._ownedView=n,this._docs.set(n.documents),this._cue.set(t.cue),void this._bindCategoriesFromView(n)}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(e){const t=()=>{this.availableContentCategories.set(e.availableContentCategories.get())};t(),this._unsubscribeCategories=e.availableContentCategories.subscribe(t)}_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)}_fetchByFilter(e,t,o,n){var u=this;return(0,h.A)(function*(){if(n){u.state.set("loading");try{let l;if(void 0!==e&&e.length>0)l=yield n.documentsBySuffix(e);else if(void 0!==t&&t.length>0)l=yield n.documentsByMime(t);else{if(!(void 0!==o&&o.length>0))return u._filterResolvedUuids.set([]),void u.state.set("ready");l=yield n.documentsByContentCategory(o)}u._filterResolvedUuids.set(l.map(_=>_.uuid)),u.state.set("ready")}catch(l){console.error("[CueDocumentListWC] Failed to fetch documents by filter",l),u.errorMessage.set(l instanceof Error?l.message:"Failed to load documents."),u.state.set("error")}}else u._filterResolvedUuids.set([])})()}_isSameSetupSignature(e){const t=this._lastSetupSignature;return!!t&&t.projectId===e.projectId&&t.cue===e.cue&&t.view===e.view&&t.documents===e.documents&&t.language===e.language&&t.simple===e.simple}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=s.VBU({type:c,selectors:[["cue-document-list"]],inputs:{projectId:[1,"projectId"],uuids:[1,"uuids"],suffixes:[1,"suffixes"],mimeTypes:[1,"mimeTypes"],contentCategories:[1,"contentCategories"],sdkState:[1,"sdkState"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],size:[1,"size"],prefetchPages:[1,"prefetchPages"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customMenuItems:[1,"customMenuItems"],showLogo:[1,"showLogo"],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"],[2,"position","relative","width","100%",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[3,"clickedDocument","clickedDownloadDocument","clickedOpenInDir","clickedOpen","documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","size","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"],[2,"position","absolute","top","8px","left","8px","z-index","5",3,"projectId"]],template:function(t,o){1&t&&s.nVh(0,m,3,1,"cue-flexcontainer",0)(1,P,3,15,"div",1),2&t&&s.vxM("error"===o.state()?0:1)},dependencies:[O.g,b.n,w.Typography,g.k,y.x],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return c})()}}]);
|
package/9396.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[9396],{9396(P,D,s){s.d(D,{CueContextViewer:()=>W});var v=s(467),d=s(7705),c=s(5802),r=s(2271),g=s(
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[9396],{9396(P,D,s){s.d(D,{CueContextViewer:()=>W});var v=s(467),d=s(7705),c=s(5802),r=s(2271),g=s(3555),p=s(4879),x=s(2839),f=s(6455),y=s(8334),t=s(5547);function _(n,l){1&n&&(t.j41(0,"div",0),t.EFF(1,"Loading context\u2026"),t.k0s())}function C(n,l){1&n&&(t.j41(0,"div",0),t.EFF(1,"No context loaded."),t.k0s())}function I(n,l){if(1&n){const e=t.RV6();t.j41(0,"cue-tabs",1)(1,"cue-tab",4),t.nrm(2,"cue-doc-list",2),t.k0s(),t.j41(3,"cue-tab",5)(4,"cue-ent-list-inner",6),t.bIt("rowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.entityRowClicked.emit(a))}),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(2),t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant()),t.R7$(2),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function w(n,l){if(1&n&&t.nrm(0,"cue-doc-list",2),2&n){const e=t.XpG();t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())}}function b(n,l){if(1&n){const e=t.RV6();t.j41(0,"cue-ent-list-inner",7),t.bIt("rowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.entityRowClicked.emit(a))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function M(n,l){1&n&&(t.j41(0,"div",0),t.EFF(1,"No items in this context."),t.k0s())}let N=(()=>{class n{contextId=(0,d.hFB)(void 0);handlers=(0,d.hFB)(void 0);variant=(0,d.hFB)("none");contextDoc=(0,d.hFB)(void 0);documentData=(0,d.hFB)({});entityData=(0,d.hFB)({});entityRowClicked=(0,d.CGW)();loading=(0,r.EW)(()=>!!this.contextId()&&!this.contextDoc());_docItems=(0,r.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"document"===e.type));_entityItems=(0,r.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"entity"===e.type));hasDocuments=(0,r.EW)(()=>this._docItems().length>0);hasEntities=(0,r.EW)(()=>this._entityItems().length>0);hasBoth=(0,r.EW)(()=>this.hasDocuments()&&this.hasEntities());documentRefs=(0,r.EW)(()=>this._docItems().map(e=>({id:e.id,relevance:e.relevance})));entityIris=(0,r.EW)(()=>this._entityItems().map(e=>e.id));_docHandlers=(0,r.EW)(()=>({requestData:e=>this.handlers()?.requestDocumentData?.(e),requestDownload:e=>this.handlers()?.requestDownloadDocument?.(e),requestOpen:(e,o)=>this.handlers()?.requestOpenDocument?.(e,o),requestOpenInDir:(e,o)=>this.handlers()?.requestOpenDocumentInDir?.(e,o)}));_entityHandlers=(0,r.EW)(()=>({requestData:(e,o)=>this.handlers()?.requestEntityData?.(e,o),requestOpen:e=>this.handlers()?.requestOpenEntity?.(e)}));constructor(){(0,c.QZP)(()=>{const e=this.contextId();e&&this.handlers()?.requestContext?.(e)})}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-context-viewer-inner"]],inputs:{contextId:[1,"contextId"],handlers:[1,"handlers"],variant:[1,"variant"],contextDoc:[1,"contextDoc"],documentData:[1,"documentData"],entityData:[1,"entityData"]},outputs:{entityRowClicked:"entityRowClicked"},decls:6,vars:1,consts:[[1,"cv-status"],[2,"height","100%"],[3,"documentRefs","documentData","handlers","variant"],[2,"height","400px",3,"entities","entityData","handlers"],["label","Documents"],["label","Entities"],[2,"height","100%",3,"rowClicked","entities","entityData","handlers"],[2,"height","400px",3,"rowClicked","entities","entityData","handlers"]],template:function(o,a){1&o&&t.nVh(0,_,2,0,"div",0)(1,C,2,0,"div",0)(2,I,5,7,"cue-tabs",1)(3,w,1,4,"cue-doc-list",2)(4,b,1,3,"cue-ent-list-inner",3)(5,M,2,0,"div",0),2&o&&t.vxM(a.loading()?0:a.contextDoc()?a.hasBoth()?2:a.hasDocuments()?3:a.hasEntities()?4:5:1)},dependencies:[p.g,x.u,f.t,y.o],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.cv-status[_ngcontent-%COMP%]{padding:16px;color:var(--cue-color-midgray, #888);font-size:13px}"],changeDetection:0})}return n})();var E=s(5381),R=s(2245),k=s(7851),V=s(7293);function j(n,l){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),t.EFF(2),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function F(n,l){1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2," No project connected. "),t.k0s()())}function T(n,l){if(1&n&&t.nrm(0,"cue-logo-link",5),2&n){const e=t.XpG(2);t.Y8G("projectId",e.projectId())}}function B(n,l){if(1&n){const e=t.RV6();t.j41(0,"div",1)(1,"cue-context-viewer-inner",4),t.bIt("entityRowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.entityRowClicked.emit(a))}),t.k0s(),t.nVh(2,T,1,1,"cue-logo-link",5),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("cueLogoLoader","loading"===e.state()),t.R7$(),t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant()),t.R7$(),t.vxM(e.showLogo()?2:-1)}}function G(n){return{id:n.id,contentIRI:n.contentIRI??n.id,path:n.path??"",suffix:n.suffix??"",size:n.size??0,tags:n.tags??[],summary:n.summary??"",categories:n.categories??[],subject:n.subject,providerId:n.providerId,relevance:0}}let W=(()=>{class n{cue=(0,d.hFB)(void 0);projectId=(0,d.hFB)(void 0);contextId=(0,d.hFB)(void 0);variant=(0,d.hFB)("none");showLogo=(0,d.hFB)(!1,{transform:d.L39});entityRowClicked=(0,d.CGW)();state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);contextDoc=(0,c.vPA)(void 0);documentData=(0,c.vPA)({});entityData=(0,c.vPA)({});_documents=(0,c.vPA)(void 0);_entities=(0,c.vPA)(void 0);_unsubDocs;_unsubEntities;_inputWarningTimer;_handlers=(0,r.EW)(()=>({requestDocumentData:e=>this._documents()?.requestDocumentData(e),requestEntityData:(e,o)=>this._entities()?.requestEntityData(e,o)}));constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-context-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.projectId()||console.warn('[cue-context-viewer] Required input "projectId" is not set.'),this.contextId()||console.warn('[cue-context-viewer] Required input "contextId" is not set.')},3e3),(0,c.QZP)(()=>{this._load(this.cue(),this.projectId(),this.contextId())})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._teardown()}_load(e,o,a){var i=this;return(0,v.A)(function*(){if(i._teardown(),i.contextDoc.set(void 0),i.documentData.set({}),i.entityData.set({}),e&&o&&a){i.state.set("loading"),i.errorMessage.set(null);try{const u=yield e.api.contexts.getContext(o,a);i.contextDoc.set(u);const h=new g.f$(e.api,o),m=new g.g8(e.api,o);i._documents.set(h),i._entities.set(m),i._unsubDocs=h.documentInfoMap.subscribe(()=>i._syncDocumentData(h)),i._unsubEntities=m.entityInfoMap.subscribe(()=>i._syncEntityData(m)),i.state.set("ready")}catch(u){console.error("[cue-context-viewer] Failed to load context",u),i.errorMessage.set(u instanceof Error?u.message:"Failed to load context."),i.state.set("error")}}else i.state.set("idle")})()}_syncDocumentData(e){const o=e.documentInfoMap.get(),a={};for(const[i,u]of Object.entries(o))a[i]=G(u);this.documentData.set(a)}_syncEntityData(e){const o=e.entityInfoMap.get(),a={};for(const[i,u]of Object.entries(o))a[i]={value:u.value??i,categories:u.categories??[],mentionCount:u.mentionCount};this.entityData.set(a)}_teardown(){this._unsubDocs?.(),this._unsubEntities?.(),this._unsubDocs=void 0,this._unsubEntities=void 0,this._documents.set(void 0),this._entities.set(void 0)}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-context-viewer"]],inputs:{cue:[1,"cue"],projectId:[1,"projectId"],contextId:[1,"contextId"],variant:[1,"variant"],showLogo:[1,"showLogo"]},outputs:{entityRowClicked:"entityRowClicked"},decls:3,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","relative","height","100%","width","100%",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[2,"height","100%",3,"entityRowClicked","contextDoc","documentData","entityData","handlers","variant"],[2,"position","absolute","top","12px","left","12px","z-index","5",3,"projectId"]],template:function(o,a){1&o&&t.nVh(0,j,3,1,"cue-flexcontainer",0)(1,F,3,0,"cue-flexcontainer",0)(2,B,3,7,"div",1),2&o&&t.vxM("error"===a.state()?0:"idle"===a.state()?1:2)},dependencies:[N,E.n,R.Typography,k.k,V.x],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return n})()}}]);
|
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Drop them into any HTML page — no build step required.
|
|
|
16
16
|
| `<cue-project-list>` | Lists all projects the authenticated user is a member of, with an optional map |
|
|
17
17
|
| `<cue-document-charts>` | Interactive document-statistics charts (by file type and/or content category) |
|
|
18
18
|
| `<cue-document-search-bar>` | Search bar with an adaptive chip-based filter builder (mime, content, entity) |
|
|
19
|
+
| `<cue-document-filter>` | Adaptive chip-based document filter builder (mime, content, entity), SDK-connected |
|
|
19
20
|
| `<cue-sparql-table>` | Declarative, column-configurable SPARQL table with built-in Cue SDK integration |
|
|
20
21
|
| `<cue-base-*>` | Low-level primitives (card, form inputs) with no SDK dependency — see [Low-level components](#low-level-components) |
|
|
21
22
|
|
|
@@ -489,6 +490,53 @@ document.getElementById('search-host').appendChild(searchBar);
|
|
|
489
490
|
|
|
490
491
|
---
|
|
491
492
|
|
|
493
|
+
## `<cue-document-filter>`
|
|
494
|
+
|
|
495
|
+
The adaptive, chip-based **filter builder** on its own — the same component
|
|
496
|
+
embedded in `<cue-document-search-bar>`, exposed separately so you can place a
|
|
497
|
+
document filter independently of the search bar (e.g. in a sidebar). It owns all
|
|
498
|
+
SDK access — discovering the available mime / content / entity filter options and
|
|
499
|
+
their localized labels — so you only provide a `projectId` and an authenticated
|
|
500
|
+
`sdkState`.
|
|
501
|
+
|
|
502
|
+
Filtering is **adaptive**: after each change the available options are re-fetched
|
|
503
|
+
against the already-committed filters, so the next dropdown only offers values
|
|
504
|
+
that still yield results.
|
|
505
|
+
|
|
506
|
+
| Property | Type | Required | Description |
|
|
507
|
+
| ------------- | -------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
|
|
508
|
+
| `projectId` | `string` | ✅ | Cue project (space) ID to load filter options from. |
|
|
509
|
+
| `sdkState` | `{ cue: Cue; graphType? }` | ✅ | Authenticated Cue instance (+ optional `graphType`). **Set as a JS property**, not an attribute. |
|
|
510
|
+
|
|
511
|
+
The component emits one event:
|
|
512
|
+
|
|
513
|
+
| Event | Payload | Description |
|
|
514
|
+
| --------------- | ---------------- | --------------------------------------------- |
|
|
515
|
+
| `filtersChange` | `SearchFilter[]` | Fires whenever the active filter set changes. |
|
|
516
|
+
|
|
517
|
+
Each `SearchFilter` has the shape `{ type, included: string[], excluded: string[] }`, where `type` is one of `'mime'`, `'content'`, `'entity'` (an entity category), or `'entityInstance'` (a specific entity).
|
|
518
|
+
|
|
519
|
+
```js
|
|
520
|
+
await customElements.whenDefined('cue-document-filter');
|
|
521
|
+
|
|
522
|
+
const filter = document.createElement('cue-document-filter');
|
|
523
|
+
|
|
524
|
+
// Required: set as JS properties, not HTML attributes
|
|
525
|
+
filter.projectId = 'your-project-id';
|
|
526
|
+
filter.sdkState = { cue }; // optionally { cue, graphType: 'qlever' }
|
|
527
|
+
|
|
528
|
+
filter.addEventListener('filtersChange', (e) => {
|
|
529
|
+
console.log('Active filters:', e.detail); // SearchFilter[]
|
|
530
|
+
// run your search constrained by these filters
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
document.getElementById('filter-host').appendChild(filter);
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
> **Loader** — add `cue-document-filter` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
492
540
|
## `<cue-entity-viewer>`
|
|
493
541
|
|
|
494
542
|
Renders the full detail view for a single entity: an info panel (label + categories), a relationship graph, linked documents, and an optional location map.
|
package/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2076],{
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2076],{6019(l,u,e){e.d(u,{t:()=>s});var r=e(6593);function s(a){const n=new r.Parser({sparqlStar:!0});try{return n.parse(a)}catch(t){if(-1!=t.toString().indexOf("SPARQL*"))return{type:"query",queryType:"CONSTRUCT",sparqlStar:!0};throw"Couldn't get query details: "+t.toString()}}}}]);
|