135 lines
64 KiB
JavaScript
135 lines
64 KiB
JavaScript
|
/*!
|
||
|
SearchPanes 2.0.0
|
||
|
2019-2022 SpryMedia Ltd - datatables.net/license
|
||
|
*/
|
||
|
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.getGlobal=function(l){l=["object"==typeof globalThis&&globalThis,l,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var n=0;n<l.length;++n){var k=l[n];if(k&&k.Math==Math)return k}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||
|
$jscomp.checkEs6ConformanceViaProxy=function(){try{var l={},n=Object.create(new $jscomp.global.Proxy(l,{get:function(k,r,v){return k==l&&"q"==r&&v==n}}));return!0===n.q}catch(k){return!1}};$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();$jscomp.arrayIteratorImpl=function(l){var n=0;return function(){return n<l.length?{done:!1,value:l[n++]}:{done:!0}}};$jscomp.arrayIterator=function(l){return{next:$jscomp.arrayIteratorImpl(l)}};
|
||
|
$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(l,n,k){if(l==Array.prototype||l==Object.prototype)return l;l[n]=k.value;return l};$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;
|
||
|
$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(l,n){var k=$jscomp.propertyToPolyfillSymbol[n];if(null==k)return l[n];k=l[k];return void 0!==k?k:l[n]};$jscomp.polyfill=function(l,n,k,r){n&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(l,n,k,r):$jscomp.polyfillUnisolated(l,n,k,r))};
|
||
|
$jscomp.polyfillUnisolated=function(l,n,k,r){k=$jscomp.global;l=l.split(".");for(r=0;r<l.length-1;r++){var v=l[r];if(!(v in k))return;k=k[v]}l=l[l.length-1];r=k[l];n=n(r);n!=r&&null!=n&&$jscomp.defineProperty(k,l,{configurable:!0,writable:!0,value:n})};
|
||
|
$jscomp.polyfillIsolated=function(l,n,k,r){var v=l.split(".");l=1===v.length;r=v[0];r=!l&&r in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var A=0;A<v.length-1;A++){var C=v[A];if(!(C in r))return;r=r[C]}v=v[v.length-1];k=$jscomp.IS_SYMBOL_NATIVE&&"es6"===k?r[v]:null;n=n(k);null!=n&&(l?$jscomp.defineProperty($jscomp.polyfills,v,{configurable:!0,writable:!0,value:n}):n!==k&&($jscomp.propertyToPolyfillSymbol[v]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(v):$jscomp.POLYFILL_PREFIX+v,v=
|
||
|
$jscomp.propertyToPolyfillSymbol[v],$jscomp.defineProperty(r,v,{configurable:!0,writable:!0,value:n})))};$jscomp.initSymbol=function(){};
|
||
|
$jscomp.polyfill("Symbol",function(l){if(l)return l;var n=function(v,A){this.$jscomp$symbol$id_=v;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:A})};n.prototype.toString=function(){return this.$jscomp$symbol$id_};var k=0,r=function(v){if(this instanceof r)throw new TypeError("Symbol is not a constructor");return new n("jscomp_symbol_"+(v||"")+"_"+k++,v)};return r},"es6","es3");$jscomp.initSymbolIterator=function(){};
|
||
|
$jscomp.polyfill("Symbol.iterator",function(l){if(l)return l;l=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),k=0;k<n.length;k++){var r=$jscomp.global[n[k]];"function"===typeof r&&"function"!=typeof r.prototype[l]&&$jscomp.defineProperty(r.prototype,l,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return l},"es6",
|
||
|
"es3");$jscomp.initSymbolAsyncIterator=function(){};$jscomp.iteratorPrototype=function(l){l={next:l};l[Symbol.iterator]=function(){return this};return l};$jscomp.makeIterator=function(l){var n="undefined"!=typeof Symbol&&Symbol.iterator&&l[Symbol.iterator];return n?n.call(l):$jscomp.arrayIterator(l)};$jscomp.owns=function(l,n){return Object.prototype.hasOwnProperty.call(l,n)};
|
||
|
$jscomp.polyfill("WeakMap",function(l){function n(){if(!l||!Object.seal)return!1;try{var p=Object.seal({}),u=Object.seal({}),x=new l([[p,2],[u,3]]);if(2!=x.get(p)||3!=x.get(u))return!1;x.delete(p);x.set(u,4);return!x.has(p)&&4==x.get(u)}catch(F){return!1}}function k(){}function r(p){var u=typeof p;return"object"===u&&null!==p||"function"===u}function v(p){if(!$jscomp.owns(p,C)){var u=new k;$jscomp.defineProperty(p,C,{value:u})}}function A(p){if(!$jscomp.ISOLATE_POLYFILLS){var u=Object[p];u&&(Object[p]=
|
||
|
function(x){if(x instanceof k)return x;Object.isExtensible(x)&&v(x);return u(x)})}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(l&&$jscomp.ES6_CONFORMANCE)return l}else if(n())return l;var C="$jscomp_hidden_"+Math.random();A("freeze");A("preventExtensions");A("seal");var I=0,t=function(p){this.id_=(I+=Math.random()+1).toString();if(p){p=$jscomp.makeIterator(p);for(var u;!(u=p.next()).done;)u=u.value,this.set(u[0],u[1])}};t.prototype.set=function(p,u){if(!r(p))throw Error("Invalid WeakMap key");
|
||
|
v(p);if(!$jscomp.owns(p,C))throw Error("WeakMap key fail: "+p);p[C][this.id_]=u;return this};t.prototype.get=function(p){return r(p)&&$jscomp.owns(p,C)?p[C][this.id_]:void 0};t.prototype.has=function(p){return r(p)&&$jscomp.owns(p,C)&&$jscomp.owns(p[C],this.id_)};t.prototype.delete=function(p){return r(p)&&$jscomp.owns(p,C)&&$jscomp.owns(p[C],this.id_)?delete p[C][this.id_]:!1};return t},"es6","es3");$jscomp.MapEntry=function(){};
|
||
|
$jscomp.polyfill("Map",function(l){function n(){if($jscomp.ASSUME_NO_NATIVE_MAP||!l||"function"!=typeof l||!l.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),p=new l($jscomp.makeIterator([[t,"s"]]));if("s"!=p.get(t)||1!=p.size||p.get({x:4})||p.set({x:4},"t")!=p||2!=p.size)return!1;var u=p.entries(),x=u.next();if(x.done||x.value[0]!=t||"s"!=x.value[1])return!1;x=u.next();return x.done||4!=x.value[0].x||"t"!=x.value[1]||!u.next().done?!1:!0}catch(F){return!1}}
|
||
|
if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(l&&$jscomp.ES6_CONFORMANCE)return l}else if(n())return l;var k=new WeakMap,r=function(t){this.data_={};this.head_=C();this.size=0;if(t){t=$jscomp.makeIterator(t);for(var p;!(p=t.next()).done;)p=p.value,this.set(p[0],p[1])}};r.prototype.set=function(t,p){t=0===t?0:t;var u=v(this,t);u.list||(u.list=this.data_[u.id]=[]);u.entry?u.entry.value=p:(u.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:t,value:p},u.list.push(u.entry),
|
||
|
this.head_.previous.next=u.entry,this.head_.previous=u.entry,this.size++);return this};r.prototype.delete=function(t){t=v(this,t);return t.entry&&t.list?(t.list.splice(t.index,1),t.list.length||delete this.data_[t.id],t.entry.previous.next=t.entry.next,t.entry.next.previous=t.entry.previous,t.entry.head=null,this.size--,!0):!1};r.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=C();this.size=0};r.prototype.has=function(t){return!!v(this,t).entry};r.prototype.get=function(t){return(t=
|
||
|
v(this,t).entry)&&t.value};r.prototype.entries=function(){return A(this,function(t){return[t.key,t.value]})};r.prototype.keys=function(){return A(this,function(t){return t.key})};r.prototype.values=function(){return A(this,function(t){return t.value})};r.prototype.forEach=function(t,p){for(var u=this.entries(),x;!(x=u.next()).done;)x=x.value,t.call(p,x[1],x[0],this)};r.prototype[Symbol.iterator]=r.prototype.entries;var v=function(t,p){var u=p&&typeof p;"object"==u||"function"==u?k.has(p)?u=k.get(p):
|
||
|
(u=""+ ++I,k.set(p,u)):u="p_"+p;var x=t.data_[u];if(x&&$jscomp.owns(t.data_,u))for(t=0;t<x.length;t++){var F=x[t];if(p!==p&&F.key!==F.key||p===F.key)return{id:u,list:x,index:t,entry:F}}return{id:u,list:x,index:-1,entry:void 0}},A=function(t,p){var u=t.head_;return $jscomp.iteratorPrototype(function(){if(u){for(;u.head!=t.head_;)u=u.previous;for(;u.next!=u.head;)return u=u.next,{done:!1,value:p(u)};u=null}return{done:!0,value:void 0}})},C=function(){var t={};return t.previous=t.next=t.head=t},I=0;
|
||
|
return r},"es6","es3");$jscomp.findInternal=function(l,n,k){l instanceof String&&(l=String(l));for(var r=l.length,v=0;v<r;v++){var A=l[v];if(n.call(k,A,v,l))return{i:v,v:A}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(l){return l?l:function(n,k){return $jscomp.findInternal(this,n,k).v}},"es6","es3");
|
||
|
$jscomp.iteratorFromArray=function(l,n){l instanceof String&&(l+="");var k=0,r={next:function(){if(k<l.length){var v=k++;return{value:n(v,l[v]),done:!1}}r.next=function(){return{done:!0,value:void 0}};return r.next()}};r[Symbol.iterator]=function(){return r};return r};$jscomp.polyfill("Array.prototype.keys",function(l){return l?l:function(){return $jscomp.iteratorFromArray(this,function(n){return n})}},"es6","es3");
|
||
|
$jscomp.polyfill("Object.is",function(l){return l?l:function(n,k){return n===k?0!==n||1/n===1/k:n!==n&&k!==k}},"es6","es3");$jscomp.polyfill("Array.prototype.includes",function(l){return l?l:function(n,k){var r=this;r instanceof String&&(r=String(r));var v=r.length;k=k||0;for(0>k&&(k=Math.max(k+v,0));k<v;k++){var A=r[k];if(A===n||Object.is(A,n))return!0}return!1}},"es7","es3");
|
||
|
$jscomp.checkStringArgs=function(l,n,k){if(null==l)throw new TypeError("The 'this' value for String.prototype."+k+" must not be null or undefined");if(n instanceof RegExp)throw new TypeError("First argument to String.prototype."+k+" must not be a regular expression");return l+""};$jscomp.polyfill("String.prototype.includes",function(l){return l?l:function(n,k){return-1!==$jscomp.checkStringArgs(this,n,"includes").indexOf(n,k||0)}},"es6","es3");
|
||
|
$jscomp.underscoreProtoCanBeSet=function(){var l={a:!0},n={};try{return n.__proto__=l,n.a}catch(k){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(l,n){l.__proto__=n;if(l.__proto__!==n)throw new TypeError(l+" is not extensible");return l}:null;$jscomp.polyfill("Object.setPrototypeOf",function(l){return l||$jscomp.setPrototypeOf},"es6","es5");
|
||
|
(function(){function l(h){k=h;r=h.fn.dataTable}function n(h){D=h;H=h.fn.dataTable}var k,r,v=function(){function h(a,b,c,d,e){var f=this;void 0===e&&(e=null);if(!r||!r.versionCheck||!r.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");if(!r.select)throw Error("SearchPane requires Select");a=new r.Api(a);this.classes=k.extend(!0,{},h.classes);this.c=k.extend(!0,{},h.defaults,b);b&&b.hideCount&&void 0===b.viewCount&&(this.c.viewCount=!this.c.hideCount);b=a.columns().eq(0).toArray().length;
|
||
|
this.s={colExists:c<b,colOpts:void 0,customPaneSettings:e,displayed:!1,dt:a,dtPane:void 0,firstSet:!0,index:c,indexes:[],listSet:!1,name:void 0,rowData:{arrayFilter:[],arrayOriginal:[],bins:{},binsOriginal:{},filterMap:new Map,totalOptions:0},scrollTop:0,searchFunction:void 0,selections:[],serverSelect:[],serverSelecting:!1,tableLength:null,updating:!1};this.s.colOpts=this.s.colExists?this._getOptions():this._getBonusOptions();this.dom={buttonGroup:k("<div/>").addClass(this.classes.buttonGroup),clear:k('<button type="button">×</button>').attr("disabled",
|
||
|
"true").addClass(this.classes.disabledButton).addClass(this.classes.paneButton).addClass(this.classes.clearButton).html(this.s.dt.i18n("searchPanes.clearPane",this.c.i18n.clearPane)),collapseButton:k('<button type="button"><span class="'+this.classes.caret+'">^</span></button>').addClass(this.classes.paneButton).addClass(this.classes.collapseButton),container:k("<div/>").addClass(this.classes.container).addClass(this.s.colOpts.className).addClass(this.classes.layout+(10>parseInt(this.c.layout.split("-")[1],
|
||
|
10)?this.c.layout:this.c.layout.split("-")[0]+"-9")).addClass(this.s.customPaneSettings&&this.s.customPaneSettings.className?this.s.customPaneSettings.className:""),countButton:k('<button type="button"></button>').addClass(this.classes.paneButton).addClass(this.classes.countButton),dtP:k("<table><thead><tr><th>"+(this.s.colExists?k(this.s.dt.column(this.s.index).header()).text():this.s.customPaneSettings.header||"Custom Pane")+"</th><th/></tr></thead></table>"),lower:k("<div/>").addClass(this.classes.subRow2).addClass(this.classes.narrowButton),
|
||
|
nameButton:k('<button type="button"></button>').addClass(this.classes.paneButton).addClass(this.classes.nameButton),panesContainer:d,searchBox:k("<input/>").addClass(this.classes.paneInputButton).addClass(this.classes.search),searchButton:k('<button type = "button"/>').addClass(this.classes.searchIcon).addClass(this.classes.paneButton),searchCont:k("<div/>").addClass(this.classes.searchCont),searchLabelCont:k("<div/>").addClass(this.classes.searchLabelCont),topRow:k("<div/>").addClass(this.classes.topRow),
|
||
|
upper:k("<div/>").addClass(this.classes.subRow1).addClass(this.classes.narrowSearch)};this.s.name=this.s.colOpts.name?this.s.colOpts.name:this.s.customPaneSettings&&this.s.customPaneSettings.name?this.s.customPaneSettings.name:this.s.colExists?k(this.s.dt.column(this.s.index).header()).text():this.s.customPaneSettings.header||"Custom Pane";var g=this.s.dt.table(0).node();this.s.searchFunction=function(m,q,w){if(0===f.s.selections.length||m.nTable!==g)return!0;m=null;f.s.colExists&&(m=q[f.s.index],
|
||
|
"filter"!==f.s.colOpts.orthogonal.filter&&(m=f.s.rowData.filterMap.get(w),m instanceof k.fn.dataTable.Api&&(m=m.toArray())));return f._search(m,w)};k.fn.dataTable.ext.search.push(this.s.searchFunction);if(this.c.clear)this.dom.clear.on("click.dtsp",function(){f.dom.container.find("."+f.classes.search.replace(/\s+/g,".")).each(function(){k(this).val("").trigger("input")});f.clearPane()});this.s.dt.on("draw.dtsp",function(){return f.adjustTopRow()});this.s.dt.on("buttons-action.dtsp",function(){return f.adjustTopRow()});
|
||
|
this.s.dt.on("column-reorder.dtsp",function(m,q,w){f.s.index=w.mapping[f.s.index]});return this}h.prototype.addRow=function(a,b,c,d,e,f,g){f||(f=this.s.rowData.bins[b]?this.s.rowData.bins[b]:0);g||(g=this._getShown(b));for(var m,q=0,w=this.s.indexes;q<w.length;q++){var y=w[q];y.filter===b&&(m=y.index)}void 0===m&&(m=this.s.indexes.length,this.s.indexes.push({filter:b,index:m}));return this.s.dtPane.row.add({className:e,display:""!==a?a:this.emptyMessage(),filter:b,index:m,shown:g,sort:c,total:f,type:d})};
|
||
|
h.prototype.adjustTopRow=function(){var a=this.dom.container.find("."+this.classes.subRowsContainer.replace(/\s+/g,".")),b=this.dom.container.find("."+this.classes.subRow1.replace(/\s+/g,".")),c=this.dom.container.find("."+this.classes.subRow2.replace(/\s+/g,".")),d=this.dom.container.find("."+this.classes.topRow.replace(/\s+/g,"."));(252>k(a[0]).width()||252>k(d[0]).width())&&0!==k(a[0]).width()?(k(a[0]).addClass(this.classes.narrow),k(b[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowSearch),
|
||
|
k(c[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowButton)):(k(a[0]).removeClass(this.classes.narrow),k(b[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowSearch),k(c[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowButton))};h.prototype.clearData=function(){this.s.rowData={arrayFilter:[],arrayOriginal:[],bins:{},binsOriginal:{},filterMap:new Map,totalOptions:0}};h.prototype.clearPane=function(){this.s.dtPane.rows({selected:!0}).deselect();
|
||
|
this.updateTable();return this};h.prototype.collapse=function(){var a=this;this.s.displayed&&(this.c.collapse||!0===this.s.colOpts.collapse)&&!1!==this.s.colOpts.collapse&&(k(this.s.dtPane.table().container()).addClass(this.classes.hidden),this.dom.topRow.addClass(this.classes.bordered),this.dom.nameButton.addClass(this.classes.disabledButton),this.dom.countButton.addClass(this.classes.disabledButton),this.dom.searchButton.addClass(this.classes.disabledButton),this.dom.collapseButton.addClass(this.classes.rotated),
|
||
|
this.dom.topRow.one("click.dtsp",function(){return a.show()}))};h.prototype.destroy=function(){this.s.dtPane&&this.s.dtPane.off(".dtsp");this.s.dt.off(".dtsp");this.dom.clear.off(".dtsp");this.dom.nameButton.off(".dtsp");this.dom.countButton.off(".dtsp");this.dom.searchButton.off(".dtsp");this.dom.collapseButton.off(".dtsp");k(this.s.dt.table().node()).off(".dtsp");this.dom.container.detach();for(var a=k.fn.dataTable.ext.search.indexOf(this.s.searchFunction);-1!==a;)k.fn.dataTable.ext.search.splice(a,
|
||
|
1),a=k.fn.dataTable.ext.search.indexOf(this.s.searchFunction);this.s.dtPane&&this.s.dtPane.destroy();this.s.listSet=!1};h.prototype.emptyMessage=function(){var a=this.c.i18n.emptyMessage;this.c.emptyMessage&&(a=this.c.emptyMessage);!1!==this.s.colOpts.emptyMessage&&null!==this.s.colOpts.emptyMessage&&(a=this.s.colOpts.emptyMessage);return this.s.dt.i18n("searchPanes.emptyMessage",a)};h.prototype.getPaneCount=function(){return this.s.dtPane?this.s.dtPane.rows({selected:!0}).data().toArray().length:
|
||
|
0};h.prototype.rebuildPane=function(a,b){void 0===a&&(a=null);void 0===b&&(b=!1);this.clearData();var c=[];this.s.serverSelect=[];var d=null;this.s.dtPane&&(b&&(this.s.dt.page.info().serverSide?this.s.serverSelect=this.s.dtPane.rows({selected:!0}).data().toArray():c=this.s.dtPane.rows({selected:!0}).data().toArray()),this.s.dtPane.clear().destroy(),d=this.dom.container.prev(),this.destroy(),this.s.dtPane=void 0,k.fn.dataTable.ext.search.push(this.s.searchFunction));this.dom.container.removeClass(this.classes.hidden);
|
||
|
this.s.displayed=!1;this._buildPane(this.s.dt.page.info().serverSide?this.s.serverSelect:c,a,d);return this};h.prototype.resize=function(a){this.c.layout=a;this.dom.container.removeClass().addClass(this.classes.show).addClass(this.classes.container).addClass(this.s.colOpts.className).addClass(this.classes.layout+(10>parseInt(a.split("-")[1],10)?a:a.split("-")[0]+"-9")).addClass(null!==this.s.customPaneSettings&&this.s.customPaneSettings.className?this.s.customPaneSettings.className:"");this.adjustTopRow()};
|
||
|
h.prototype.setListeners=function(){var a=this;if(this.s.dtPane){this.s.dtPane.select.style("os");var b;this.s.dtPane.off("select.dtsp").on("select.dtsp",function(){clearTimeout(b);a._updateSelection(!a.s.updating);a.dom.clear.removeClass(a.classes.disabledButton).removeAttr("disabled")});this.s.dtPane.off("deselect.dtsp").on("deselect.dtsp",function(){b=setTimeout(function(){a._updateSelection(!0);0===a.s.dtPane.rows({selected:!0}).data().toArray().length&&a.dom.clear.addClass(a.classes.disabledButton).attr("disabled",
|
||
|
"true")},50)});this.s.firstSet&&(this.s.firstSet=!1,this.s.dt.on("stateSaveParams.dtsp",function(c,d,e){if(k.isEmptyObject(e))a.s.dtPane.state.clear();else{c=[];if(a.s.dtPane){c=a.s.dtPane.rows({selected:!0}).data().map(function(y){return y.filter.toString()}).toArray();var f=a.dom.searchBox.val();var g=a.s.dtPane.order();var m=a.s.rowData.binsOriginal;var q=a.s.rowData.arrayOriginal;var w=a.dom.collapseButton.hasClass(a.classes.rotated)}void 0===e.searchPanes&&(e.searchPanes={});void 0===e.searchPanes.panes&&
|
||
|
(e.searchPanes.panes=[]);for(d=0;d<e.searchPanes.panes.length;d++)e.searchPanes.panes[d].id===a.s.index&&(e.searchPanes.panes.splice(d,1),d--);e.searchPanes.panes.push({arrayFilter:q,bins:m,collapsed:w,id:a.s.index,order:g,searchTerm:f,selected:c})}}));this.s.dtPane.off("user-select.dtsp").on("user-select.dtsp",function(c,d,e,f,g){g.stopPropagation()});this.s.dtPane.off("draw.dtsp").on("draw.dtsp",function(){return a.adjustTopRow()});this.dom.nameButton.off("click.dtsp").on("click.dtsp",function(){var c=
|
||
|
a.s.dtPane.order()[0][1];a.s.dtPane.order([0,"asc"===c?"desc":"asc"]).draw();a.s.dt.state.save()});this.dom.countButton.off("click.dtsp").on("click.dtsp",function(){var c=a.s.dtPane.order()[0][1];a.s.dtPane.order([1,"asc"===c?"desc":"asc"]).draw();a.s.dt.state.save()});this.dom.collapseButton.off("click.dtsp").on("click.dtsp",function(c){c.stopPropagation();c=k(a.s.dtPane.table().container());c.toggleClass(a.classes.hidden);a.dom.topRow.toggleClass(a.classes.bordered);a.dom.nameButton.toggleClass(a.classes.disabledButton);
|
||
|
a.dom.countButton.toggleClass(a.classes.disabledButton);a.dom.searchButton.toggleClass(a.classes.disabledButton);a.dom.collapseButton.toggleClass(a.classes.rotated);if(c.hasClass(a.classes.hidden))a.dom.topRow.on("click.dtsp",function(){return a.dom.collapseButton.click()});else a.dom.topRow.off("click.dtsp");a.s.dt.state.save()});this.dom.clear.off("click.dtsp").on("click.dtsp",function(){a.dom.container.find("."+a.classes.search.replace(/ /g,".")).each(function(){k(this).val("").trigger("input")});
|
||
|
a.clearPane()});this.dom.searchButton.off("click.dtsp").on("click.dtsp",function(){return a.dom.searchBox.focus()});this.dom.searchBox.off("click.dtsp").on("input.dtsp",function(){var c=a.dom.searchBox.val();a.s.dtPane.search(c).draw();"string"===typeof c&&(0<c.length||0===c.length&&0<a.s.dtPane.rows({selected:!0}).data().toArray().length)?a.dom.clear.removeClass(a.classes.disabledButton).removeAttr("disabled"):a.dom.clear.addClass(a.classes.disabledButton).attr("disabled","true");a.s.dt.state.save()});
|
||
|
this.s.dtPane.select.style("os")}};h.prototype._serverPopulate=function(a){if(a.tableLength)this.s.tableLength=a.tableLength,this.s.rowData.totalOptions=this.s.tableLength;else if(null===this.s.tableLength||this.s.dt.rows()[0].length>this.s.tableLength)this.s.tableLength=this.s.dt.rows()[0].length,this.s.rowData.totalOptions=this.s.tableLength;var b=this.s.dt.column(this.s.index).dataSrc();if(a.searchPanes.options[b]){var c=0;for(a=a.searchPanes.options[b];c<a.length;c++)b=a[c],this.s.rowData.arrayFilter.push({display:b.label,
|
||
|
filter:b.value,sort:b.label,type:b.label}),this.s.rowData.bins[b.value]=b.total}c=Object.keys(this.s.rowData.bins).length;a=this._uniqueRatio(c,this.s.tableLength);!1===this.s.displayed&&((void 0===this.s.colOpts.show&&null===this.s.colOpts.threshold?a>this.c.threshold:a>this.s.colOpts.threshold)||!0!==this.s.colOpts.show&&1>=c)?(this.dom.container.addClass(this.classes.hidden),this.s.displayed=!1):(this.s.rowData.arrayOriginal=this.s.rowData.arrayFilter,this.s.rowData.binsOriginal=this.s.rowData.bins,
|
||
|
this.s.displayed=!0)};h.prototype.show=function(){this.s.displayed&&(this.dom.topRow.removeClass(this.classes.bordered),this.dom.nameButton.removeClass(this.classes.disabledButton),this.dom.countButton.removeClass(this.classes.disabledButton),this.dom.searchButton.removeClass(this.classes.disabledButton),this.dom.collapseButton.removeClass(this.classes.rotated),k(this.s.dtPane.table().container()).removeClass(this.classes.hidden))};h.prototype._uniqueRatio=function(a,b){return 0<b&&(0<this.s.rowData.totalOptions&&
|
||
|
!this.s.dt.page.info().serverSide||this.s.dt.page.info().serverSide&&0<this.s.tableLength)?a/this.s.rowData.totalOptions:1};h.prototype.updateTable=function(){var a=this.s.dtPane.rows({selected:!0}).data().toArray().map(function(b){return b.filter});this.s.selections=a;this._searchExtras()};h.prototype._getComparisonRows=function(){var a=this.s.colOpts.options?this.s.colOpts.options:this.s.customPaneSettings&&this.s.customPaneSettings.options?this.s.customPaneSettings.options:void 0;if(void 0!==a){var b=
|
||
|
this.s.dt.rows(),c=b.data().toArray(),d=[];this.s.dtPane.clear();this.s.indexes=[];for(var e=0;e<a.length;e++){var f=a[e],g=""!==f.label?f.label:this.emptyMessage(),m=f.className,q=g,w="function"===typeof f.value?f.value:[],y=g,z=0;if("function"===typeof f.value){for(var E=0;E<c.length;E++)f.value.call(this.s.dt,c[E],b[0][E])&&z++;"function"!==typeof w&&w.push(f.filter)}d.push(this.addRow(q,w,y,g,m,z))}return d}};h.prototype._getMessage=function(a){return this.s.dt.i18n("searchPanes.count",this.c.i18n.count).replace(/{total}/g,
|
||
|
a.total)};h.prototype._getShown=function(a){};h.prototype._getPaneConfig=function(){var a=this,b=r.Scroller,c=this.s.dt.settings()[0].oLanguage;c.url=void 0;c.sUrl=void 0;return{columnDefs:[{className:"dtsp-nameColumn",data:"display",render:function(d,e,f){if("sort"===e)return f.sort;if("type"===e)return f.type;f=a._getMessage(f);f='<span class="'+a.classes.pill+'">'+f+"</span>";a.c.viewCount&&a.s.colOpts.viewCount||(f="");return"filter"===e?"string"===typeof d&&null!==d.match(/<[^>]*>/)?d.replace(/<[^>]*>/g,
|
||
|
""):d:'<div class="'+a.classes.nameCont+'"><span title="'+("string"===typeof d&&null!==d.match(/<[^>]*>/)?d.replace(/<[^>]*>/g,""):d)+'" class="'+a.classes.name+'">'+d+"</span>"+f+"</div>"},targets:0,type:this.s.dt.settings()[0].aoColumns[this.s.index]?this.s.dt.settings()[0].aoColumns[this.s.index]._sManualType:null},{className:"dtsp-countColumn "+this.classes.badgePill,data:"total",searchable:!1,targets:1,visible:!1}],deferRender:!0,dom:"t",info:!1,language:c,paging:b?!0:!1,scrollX:!1,scrollY:"200px",
|
||
|
scroller:b?!0:!1,select:!0,stateSave:this.s.dt.settings()[0].oFeatures.bStateSave?!0:!1}};h.prototype._makeSelection=function(){this.updateTable();this.s.updating=!0;this.s.dt.draw();this.s.updating=!1};h.prototype._populatePaneArray=function(a,b,c,d){void 0===d&&(d=this.s.rowData.bins);if("string"===typeof this.s.colOpts.orthogonal)c=c.oApi._fnGetCellData(c,a,this.s.index,this.s.colOpts.orthogonal),this.s.rowData.filterMap.set(a,c),this._addOption(c,c,c,c,b,d);else{var e=c.oApi._fnGetCellData(c,
|
||
|
a,this.s.index,this.s.colOpts.orthogonal.search);null===e&&(e="");"string"===typeof e&&(e=e.replace(/<[^>]*>/g,""));this.s.rowData.filterMap.set(a,e);d[e]?d[e]++:(d[e]=1,this._addOption(e,c.oApi._fnGetCellData(c,a,this.s.index,this.s.colOpts.orthogonal.display),c.oApi._fnGetCellData(c,a,this.s.index,this.s.colOpts.orthogonal.sort),c.oApi._fnGetCellData(c,a,this.s.index,this.s.colOpts.orthogonal.type),b,d))}this.s.rowData.totalOptions++};h.prototype._reloadSelect=function(a){if(void 0!==a){for(var b,
|
||
|
c=0;c<a.searchPanes.panes.length;c++)if(a.searchPanes.panes[c].id===this.s.index){b=c;break}if(b){c=this.s.dtPane;var d=c.rows({order:"index"}).data().map(function(g){return null!==g.filter?g.filter.toString():null}).toArray(),e=0;for(a=a.searchPanes.panes[b].selected;e<a.length;e++){b=a[e];var f=-1;null!==b&&(f=d.indexOf(b.toString()));-1<f&&(this.s.serverSelecting=!0,c.row(f).select(),this.s.serverSelecting=!1)}}}};h.prototype._updateSelection=function(a){this.s.scrollTop=k(this.s.dtPane.table().node()).parent()[0].scrollTop;
|
||
|
this.s.dt.page.info().serverSide&&!this.s.updating?this.s.serverSelecting||(this.s.serverSelect=this.s.dtPane.rows({selected:!0}).data().toArray(),this.s.dt.draw(!1)):a&&this._makeSelection()};h.prototype._addOption=function(a,b,c,d,e,f){if(Array.isArray(a)||a instanceof r.Api)if(a instanceof r.Api&&(a=a.toArray(),b=b.toArray()),a.length===b.length)for(var g=0;g<a.length;g++)f[a[g]]?f[a[g]]++:(f[a[g]]=1,e.push({display:b[g],filter:a[g],sort:c[g],type:d[g]})),this.s.rowData.totalOptions++;else throw Error("display and filter not the same length");
|
||
|
else"string"===typeof this.s.colOpts.orthogonal?(f[a]?f[a]++:(f[a]=1,e.push({display:b,filter:a,sort:c,type:d})),this.s.rowData.totalOptions++):e.push({display:b,filter:a,sort:c,type:d})};h.prototype._buildPane=function(a,b,c){var d=this;void 0===a&&(a=[]);void 0===b&&(b=null);void 0===c&&(c=null);this.s.selections=[];var e=this.s.dt.state.loaded();this.s.listSet&&(e=this.s.dt.state());if(this.s.colExists){var f=-1;if(e&&e.searchPanes&&e.searchPanes.panes)for(var g=0;g<e.searchPanes.panes.length;g++)if(e.searchPanes.panes[g].id===
|
||
|
this.s.index){f=g;break}if((!1===this.s.colOpts.show||void 0!==this.s.colOpts.show&&!0!==this.s.colOpts.show)&&-1===f)return this.dom.container.addClass(this.classes.hidden),this.s.displayed=!1;if(!0===this.s.colOpts.show||-1!==f)this.s.displayed=!0;if(this.s.dt.page.info().serverSide||b&&b.searchPanes&&b.searchPanes.options)b&&b.searchPanes&&b.searchPanes.options&&this._serverPopulate(b);else{0===this.s.rowData.arrayFilter.length&&(this.s.rowData.totalOptions=0,this._populatePane(),this.s.rowData.arrayOriginal=
|
||
|
this.s.rowData.arrayFilter,this.s.rowData.binsOriginal=this.s.rowData.bins);g=Object.keys(this.s.rowData.binsOriginal).length;f=this._uniqueRatio(g,this.s.dt.rows()[0].length);if(!1===this.s.displayed&&((void 0===this.s.colOpts.show&&null===this.s.colOpts.threshold?f>this.c.threshold:f>this.s.colOpts.threshold)||!0!==this.s.colOpts.show&&1>=g)){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}this.dom.container.addClass(this.classes.show);this.s.displayed=!0}}else this.s.displayed=
|
||
|
!0;this._displayPane();if(!this.s.listSet)this.dom.dtP.on("stateLoadParams.dtsp",function(w,y,z){k.isEmptyObject(d.s.dt.state.loaded())&&k.each(z,function(E){delete z[E]})});null!==c&&0<this.dom.panesContainer.has(c).length?this.dom.container.insertAfter(c):this.dom.panesContainer.prepend(this.dom.container);c=k.fn.dataTable.ext.errMode;k.fn.dataTable.ext.errMode="none";this.s.dtPane=this.dom.dtP.DataTable(k.extend(!0,this._getPaneConfig(),this.c.dtOpts,this.s.colOpts?this.s.colOpts.dtOpts:{},this.s.colOpts.options||
|
||
|
!this.s.colExists?{createdRow:function(w,y){k(w).addClass(y.className)}}:void 0,null!==this.s.customPaneSettings&&this.s.customPaneSettings.dtOpts?this.s.customPaneSettings.dtOpts:{},k.fn.dataTable.versionCheck("2")?{layout:{bottomLeft:null,bottomRight:null,topLeft:null,topRight:null}}:{}));this.dom.dtP.addClass(this.classes.table);g="Custom Pane";this.s.customPaneSettings&&this.s.customPaneSettings.header?g=this.s.customPaneSettings.header:this.s.colOpts.header?g=this.s.colOpts.header:this.s.colExists&&
|
||
|
(g=k.fn.dataTable.versionCheck("2")?this.s.dt.column(this.s.index).title():this.s.dt.settings()[0].aoColumns[this.s.index].sTitle);g=this._escapeHTML(g);this.dom.searchBox.attr("placeholder",g);k.fn.dataTable.select.init(this.s.dtPane);k.fn.dataTable.ext.errMode=c;if(this.s.colExists)for(g=0,f=this.s.rowData.arrayFilter.length;g<f;g++)if(this.s.dt.page.info().serverSide){c=this.addRow(this.s.rowData.arrayFilter[g].display,this.s.rowData.arrayFilter[g].filter,this.s.rowData.arrayFilter[g].sort,this.s.rowData.arrayFilter[g].type);
|
||
|
for(var m=0,q=this.s.serverSelect;m<q.length;m++)q[m].filter===this.s.rowData.arrayFilter[g].filter&&(this.s.serverSelecting=!0,c.select(),this.s.serverSelecting=!1)}else!this.s.dt.page.info().serverSide&&this.s.rowData.arrayFilter[g]?this.addRow(this.s.rowData.arrayFilter[g].display,this.s.rowData.arrayFilter[g].filter,this.s.rowData.arrayFilter[g].sort,this.s.rowData.arrayFilter[g].type):this.s.dt.page.info().serverSide||this.addRow("","","","");r.select.init(this.s.dtPane);(this.s.colOpts.options||
|
||
|
this.s.customPaneSettings&&this.s.customPaneSettings.options)&&this._getComparisonRows();this.s.dtPane.draw();this.s.dtPane.table().node().parentNode.scrollTop=this.s.scrollTop;this.adjustTopRow();this.setListeners();this.s.listSet=!0;for(g=0;g<a.length;g++)if(f=a[g])for(m=0,q=this.s.dtPane.rows().indexes().toArray();m<q.length;m++)c=q[m],this.s.dtPane.row(c).data()&&f.filter===this.s.dtPane.row(c).data().filter&&(this.s.dt.page.info().serverSide?(this.s.serverSelecting=!0,this.s.dtPane.row(c).select(),
|
||
|
this.s.serverSelecting=!1):this.s.dtPane.row(c).select());this.s.dt.page.info().serverSide&&this.s.dtPane.search(this.dom.searchBox.val()).draw();if((this.c.initCollapsed&&!1!==this.s.colOpts.initCollapsed||this.s.colOpts.initCollapsed)&&(this.c.collapse&&!1!==this.s.colOpts.collapse||this.s.colOpts.collapse))if(this.s.dtPane.settings()[0]._bInitComplete)this.collapse();else this.s.dtPane.one("init",function(){return d.collapse()});if(e&&e.searchPanes&&e.searchPanes.panes&&(!b||1===b.draw))for(this._reloadSelect(e),
|
||
|
b=0,e=e.searchPanes.panes;b<e.length;b++)a=e[b],a.id===this.s.index&&(a.searchTerm&&0<a.searchTerm.length&&this.dom.searchBox.val(a.searchTerm).trigger("input"),a.order&&this.s.dtPane.order(a.order).draw(),a.collapsed?this.collapse():this.show());return!0};h.prototype._displayPane=function(){this.dom.dtP.empty();this.dom.topRow.empty().addClass(this.classes.topRow);3<parseInt(this.c.layout.split("-")[1],10)&&this.dom.container.addClass(this.classes.smallGap);this.dom.topRow.addClass(this.classes.subRowsContainer).append(this.dom.upper.append(this.dom.searchCont)).append(this.dom.lower.append(this.dom.buttonGroup));
|
||
|
(!1===this.c.dtOpts.searching||this.s.colOpts.dtOpts&&!1===this.s.colOpts.dtOpts.searching||!this.c.controls||!this.s.colOpts.controls||this.s.customPaneSettings&&this.s.customPaneSettings.dtOpts&&void 0!==this.s.customPaneSettings.dtOpts.searching&&!this.s.customPaneSettings.dtOpts.searching)&&this.dom.searchBox.removeClass(this.classes.paneInputButton).addClass(this.classes.disabledButton).attr("disabled","true");this.dom.searchBox.appendTo(this.dom.searchCont);this._searchContSetup();this.c.clear&&
|
||
|
this.c.controls&&this.s.colOpts.controls&&this.dom.clear.appendTo(this.dom.buttonGroup);this.c.orderable&&this.s.colOpts.orderable&&this.c.controls&&this.s.colOpts.controls&&this.dom.nameButton.appendTo(this.dom.buttonGroup);this.c.viewCount&&this.s.colOpts.viewCount&&this.c.orderable&&this.s.colOpts.orderable&&this.c.controls&&this.s.colOpts.controls&&this.dom.countButton.appendTo(this.dom.buttonGroup);(this.c.collapse&&!1!==this.s.colOpts.collapse||this.s.colOpts.collapse)&&this.c.controls&&this.s.colOpts.controls&&
|
||
|
this.dom.collapseButton.appendTo(this.dom.buttonGroup);this.dom.container.prepend(this.dom.topRow).append(this.dom.dtP).show()};h.prototype._escapeHTML=function(a){return a.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};h.prototype._getBonusOptions=function(){return k.extend(!0,{},h.defaults,{threshold:null},this.c?this.c:{})};h.prototype._getOptions=function(){var a=this.s.dt.settings()[0].aoColumns[this.s.index].searchPanes,b=k.extend(!0,{},h.defaults,
|
||
|
{collapse:null,emptyMessage:!1,initCollapsed:null,threshold:null},a);a&&a.hideCount&&void 0===a.viewCount&&(b.viewCount=!a.hideCount);return b};h.prototype._populatePane=function(){this.s.rowData.arrayFilter=[];this.s.rowData.bins={};var a=this.s.dt.settings()[0];if(!this.s.dt.page.info().serverSide)for(var b=0,c=this.s.dt.rows().indexes().toArray();b<c.length;b++)this._populatePaneArray(c[b],this.s.rowData.arrayFilter,a)};h.prototype._search=function(a,b){for(var c=this.s.colOpts,d=this.s.dt,e=0,
|
||
|
f=this.s.selections;e<f.length;e++){var g=f[e];"string"===typeof g&&"string"===typeof a&&(g=this._escapeHTML(g));if(Array.isArray(a))if("and"===c.combiner){if(!a.includes(g))return!1}else{if(a.includes(g))return!0}else if("function"===typeof g)if(g.call(d,d.row(b).data(),b)){if("or"===c.combiner)return!0}else{if("and"===c.combiner)return!1}else if(a===g||("string"!==typeof a||0!==a.length)&&a==g||null===g&&"string"===typeof a&&""===a)return!0}return"and"===c.combiner?!0:!1};h.prototype._searchContSetup=
|
||
|
function(){this.c.controls&&this.s.colOpts.controls&&this.dom.searchButton.appendTo(this.dom.searchLabelCont);!1===this.c.dtOpts.searching||!1===this.s.colOpts.dtOpts.searching||this.s.customPaneSettings&&this.s.customPaneSettings.dtOpts&&void 0!==this.s.customPaneSettings.dtOpts.searching&&!this.s.customPaneSettings.dtOpts.searching||this.dom.searchLabelCont.appendTo(this.dom.searchCont)};h.prototype._searchExtras=function(){var a=this.s.updating;this.s.updating=!0;var b=this.s.dtPane.rows({selected:!0}).data().pluck("filter").toArray(),
|
||
|
c=b.indexOf(this.emptyMessage()),d=k(this.s.dtPane.table().container());-1<c&&(b[c]="");0<b.length?d.addClass(this.classes.selected):0===b.length&&d.removeClass(this.classes.selected);this.s.updating=a};h.version="2.0.0-dev";h.classes={bordered:"dtsp-bordered",buttonGroup:"dtsp-buttonGroup",buttonSub:"dtsp-buttonSub",caret:"dtsp-caret",clear:"dtsp-clear",clearAll:"dtsp-clearAll",clearButton:"clearButton",collapseAll:"dtsp-collapseAll",collapseButton:"dtsp-collapseButton",container:"dtsp-searchPane",
|
||
|
countButton:"dtsp-countButton",disabledButton:"dtsp-disabledButton",hidden:"dtsp-hidden",hide:"dtsp-hide",layout:"dtsp-",name:"dtsp-name",nameButton:"dtsp-nameButton",nameCont:"dtsp-nameCont",narrow:"dtsp-narrow",paneButton:"dtsp-paneButton",paneInputButton:"dtsp-paneInputButton",pill:"dtsp-pill",rotated:"dtsp-rotated",search:"dtsp-search",searchCont:"dtsp-searchCont",searchIcon:"dtsp-searchIcon",searchLabelCont:"dtsp-searchButtonCont",selected:"dtsp-selected",smallGap:"dtsp-smallGap",subRow1:"dtsp-subRow1",
|
||
|
subRow2:"dtsp-subRow2",subRowsContainer:"dtsp-subRowsContainer",title:"dtsp-title",topRow:"dtsp-topRow"};h.defaults={clear:!0,collapse:!0,combiner:"or",container:function(a){return a.table().container()},controls:!0,dtOpts:{},emptyMessage:null,hideCount:!1,i18n:{clearPane:"×",count:"{total}",emptyMessage:"<em>No data</em>"},initCollapsed:!1,layout:"auto",name:void 0,orderable:!0,orthogonal:{display:"display",filter:"filter",hideCount:!1,search:"filter",show:void 0,sort:"sort",threshold:.6,type:"type",
|
||
|
viewCount:!0},preSelect:[],threshold:.6,viewCount:!0};return h}(),A=window&&window.__extends||function(){var h=function(a,b){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var e in d)d.hasOwnProperty(e)&&(c[e]=d[e])};return h(a,b)};return function(a,b){function c(){this.constructor=a}h(a,b);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)}}(),C=function(h){function a(b,c,d,e,f){return h.call(this,b,c,d,e,f)||this}A(a,h);
|
||
|
a.prototype._serverPopulate=function(b){this.s.rowData.binsShown={};this.s.rowData.arrayFilter=[];if(void 0!==b.tableLength)this.s.tableLength=b.tableLength,this.s.rowData.totalOptions=this.s.tableLength;else if(null===this.s.tableLength||this.s.dt.rows()[0].length>this.s.tableLength)this.s.tableLength=this.s.dt.rows()[0].length,this.s.rowData.totalOptions=this.s.tableLength;var c=this.s.dt.column(this.s.index).dataSrc();if(void 0!==b.searchPanes.options[c]){var d=0;for(b=b.searchPanes.options[c];d<
|
||
|
b.length;d++)c=b[d],this.s.rowData.arrayFilter.push({display:c.label,filter:c.value,shown:+c.count,sort:c.label,total:+c.total,type:c.label}),this.s.rowData.binsShown[c.value]=+c.count,this.s.rowData.bins[c.value]=+c.total}d=Object.keys(this.s.rowData.bins).length;b=this._uniqueRatio(d,this.s.tableLength);if(!this.s.colOpts.show&&!1===this.s.displayed&&((void 0===this.s.colOpts.show&&null===this.s.colOpts.threshold?b>this.c.threshold:b>this.s.colOpts.threshold)||!0!==this.s.colOpts.show&&1>=d))this.dom.container.addClass(this.classes.hidden),
|
||
|
this.s.displayed=!1;else if(this.s.rowData.arrayOriginal=this.s.rowData.arrayFilter,this.s.rowData.binsOriginal=this.s.rowData.bins,this.s.displayed=!0,this.s.dtPane){d=this.s.serverSelect;this.s.dtPane.rows().remove();for(var e=0,f=this.s.rowData.arrayFilter;e<f.length;e++)if(b=f[e],this._shouldAddRow(b)){c=this.addRow(b.display,b.filter,b.sort,b.type);for(var g=0;g<d.length;g++){var m=d[g];if(m.filter===b.filter){this.s.serverSelecting=!0;c.select();this.s.serverSelecting=!1;d.splice(g,1);this.s.selections.push(b.filter);
|
||
|
break}}}for(e=0;e<d.length;e++)for(m=d[e],f=0,g=this.s.rowData.arrayOriginal;f<g.length;f++)b=g[f],b.filter===m.filter&&(c=this.addRow(b.display,b.filter,b.sort,b.type),this.s.serverSelecting=!0,c.select(),this.s.serverSelecting=!1,this.s.selections.push(b.filter));this.s.serverSelect=this.s.dtPane.rows({selected:!0}).data().toArray();this.s.dtPane.draw()}};a.prototype.updateRows=function(){if(!this.s.dt.page.info().serverSide){this.s.rowData.binsShown={};for(var b=0,c=this.s.dt.rows({search:"applied"}).indexes().toArray();b<
|
||
|
c.length;b++)this._updateShown(c[b],this.s.dt.settings()[0],this.s.rowData.binsShown)}b=0;for(c=this.s.dtPane.rows().data().toArray();b<c.length;b++){var d=c[b];d.shown="number"===typeof this.s.rowData.binsShown[d.filter]?this.s.rowData.binsShown[d.filter]:0;this.s.dtPane.row(d.index).data(d)}this.s.dtPane.draw();this.s.dtPane.table().node().parentNode.scrollTop=this.s.scrollTop};a.prototype._makeSelection=function(){};a.prototype._reloadSelect=function(){};a.prototype._shouldAddRow=function(b){return!0};
|
||
|
a.prototype._updateSelection=function(){!this.s.dt.page.info().serverSide||this.s.updating||this.s.serverSelecting||(this.s.serverSelect=this.s.dtPane.rows({selected:!0}).data().toArray())};a.prototype._updateShown=function(b,c,d){void 0===d&&(d=this.s.rowData.binsShown);b=c.oApi._fnGetCellData(c,b,this.s.index,this.s.colOpts.orthogonal.search);d[b]?d[b]++:d[b]=1};return a}(v),I=window&&window.__extends||function(){var h=function(a,b){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,
|
||
|
d){c.__proto__=d}||function(c,d){for(var e in d)d.hasOwnProperty(e)&&(c[e]=d[e])};return h(a,b)};return function(a,b){function c(){this.constructor=a}h(a,b);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)}}(),t,p=function(h){function a(b,c,d,e,f){return h.call(this,b,t.extend({i18n:{countFiltered:"{shown} ({total})"}},c),d,e,f)||this}I(a,h);a.prototype._getMessage=function(b){var c=this.s.dt.i18n("searchPanes.count",this.c.i18n.count),d=this.s.dt.i18n("searchPanes.countFiltered",
|
||
|
this.c.i18n.countFiltered);return(this.s.filteringActive?d:c).replace(/{total}/g,b.total).replace(/{shown}/g,b.shown)};a.prototype._getShown=function(b){return this.s.rowData.binsShown&&this.s.rowData.binsShown[b]?this.s.rowData.binsShown[b]:0};return a}(C),u=window&&window.__extends||function(){var h=function(a,b){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var e in d)d.hasOwnProperty(e)&&(c[e]=d[e])};return h(a,b)};return function(a,b){function c(){this.constructor=
|
||
|
a}h(a,b);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)}}(),x,F=function(h){function a(b,c,d,e,f){return h.call(this,b,x.extend({i18n:{count:"{shown}"}},c),d,e,f)||this}u(a,h);a.prototype.updateRows=function(){var b=this.s.dtPane.rows({selected:!0}).data().toArray();if(this.s.colOpts.options||this.s.customPaneSettings&&this.s.customPaneSettings.options){this._getComparisonRows();for(var c=this.s.dtPane.rows().toArray()[0],d=0;d<c.length;d++){var e=this.s.dtPane.row(c[d]),f=
|
||
|
e.data();if(void 0!==f)if(0===f.shown)e.remove(),c=this.s.dtPane.rows(),d--;else for(var g=0,m=b;g<m.length;g++){var q=m[g];if(f.filter===q.filter){e.select();b.splice(d,1);this.s.selections.push(f.filter);break}}}}else{if(!this.s.dt.page.info().serverSide)for(this._activePopulatePane(),this.s.rowData.binsShown={},e=0,q=this.s.dt.rows({search:"applied"}).indexes().toArray();e<q.length;e++)this._updateShown(q[e],this.s.dt.settings()[0],this.s.rowData.binsShown);this.s.dtPane.rows().remove();f=0;for(g=
|
||
|
this.s.rowData.arrayFilter;f<g.length;f++)if(c=g[f],0!==c.shown)for(e=this.addRow(c.display,c.filter,c.sort,c.type,void 0),d=0;d<b.length;d++)if(q=b[d],q.filter===c.filter){e.select();b.splice(d,1);this.s.selections.push(c.filter);break}for(d=0;d<b.length;d++)for(q=b[d],f=0,g=this.s.rowData.arrayOriginal;f<g.length;f++)c=g[f],c.filter===q.filter&&(e=this.addRow(c.display,c.filter,c.sort,c.type,void 0),e.select(),this.s.selections.push(c.filter))}this.s.dtPane.draw();this.s.dtPane.table().node().parentNode.scrollTop=
|
||
|
this.s.scrollTop;this.s.dt.page.info().serverSide||this.s.dt.draw()};a.prototype._activePopulatePane=function(){this.s.rowData.arrayFilter=[];this.s.rowData.bins={};var b=this.s.dt.settings()[0];if(!this.s.dt.page.info().serverSide)for(var c=0,d=this.s.dt.rows({search:"applied"}).indexes().toArray();c<d.length;c++)this._populatePaneArray(d[c],this.s.rowData.arrayFilter,b)};a.prototype._getComparisonRows=function(){var b=this.s.colOpts.options?this.s.colOpts.options:this.s.customPaneSettings&&this.s.customPaneSettings.options?
|
||
|
this.s.customPaneSettings.options:void 0;if(void 0!==b){var c=this.s.dt.rows(),d=this.s.dt.rows({search:"applied"}),e=c.data().toArray(),f=d.data().toArray(),g=[];this.s.dtPane.clear();this.s.indexes=[];for(var m=0;m<b.length;m++){var q=b[m],w=""!==q.label?q.label:this.emptyMessage(),y=q.className,z=w,E="function"===typeof q.value?q.value:[],B=0,O=w,M=0;if("function"===typeof q.value){for(var G=0;G<e.length;G++)q.value.call(this.s.dt,e[G],c[0][G])&&M++;for(G=0;G<f.length;G++)q.value.call(this.s.dt,
|
||
|
f[G],d[0][G])&&B++;"function"!==typeof E&&E.push(q.filter)}g.push(this.addRow(z,E,O,w,y,M,B))}return g}};a.prototype._getMessage=function(b){return this.s.dt.i18n("searchPanes.count",this.c.i18n.count).replace(/{total}/g,b.total).replace(/{shown}/g,b.shown)};a.prototype._getShown=function(b){return this.s.rowData.binsShown&&this.s.rowData.binsShown[b]?this.s.rowData.binsShown[b]:0};a.prototype._shouldAddRow=function(b){return 0<b.shown};return a}(C),P=window&&window.__extends||function(){var h=function(a,
|
||
|
b){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var e in d)d.hasOwnProperty(e)&&(c[e]=d[e])};return h(a,b)};return function(a,b){function c(){this.constructor=a}h(a,b);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)}}(),N,K=function(h){function a(b,c,d,e,f){return h.call(this,b,N.extend({i18n:{count:"{total}",countFiltered:"{shown} ({total})"}},c),d,e,f)||this}P(a,h);a.prototype._activePopulatePane=function(){this.s.rowData.arrayFilter=
|
||
|
[];this.s.rowData.binsShown={};var b=this.s.dt.settings()[0];if(!this.s.dt.page.info().serverSide)for(var c=0,d=this.s.dt.rows({search:"applied"}).indexes().toArray();c<d.length;c++)this._populatePaneArray(d[c],this.s.rowData.arrayFilter,b,this.s.rowData.binsShown)};a.prototype._getMessage=function(b){var c=this.s.dt.i18n("searchPanes.count",this.c.i18n.count),d=this.s.dt.i18n("searchPanes.countFiltered",this.c.i18n.countFiltered);return(this.s.filteringActive?d:c).replace(/{total}/g,b.total).replace(/{shown}/g,
|
||
|
b.shown)};return a}(F),D,H,J=function(){function h(a,b,c,d){var e=this;void 0===c&&(c=!1);void 0===d&&(d=v);if(!H||!H.versionCheck||!H.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");if(!H.select)throw Error("SearchPane requires Select");var f=new H.Api(a);this.classes=D.extend(!0,{},h.classes);this.c=D.extend(!0,{},h.defaults,b);this.dom={clearAll:D('<button type="button"/>').addClass(this.classes.clearAll).html(f.i18n("searchPanes.clearMessage",this.c.i18n.clearMessage)),
|
||
|
collapseAll:D('<button type="button"/>').addClass(this.classes.collapseAll).html(f.i18n("searchPanes.collapseMessage",this.c.i18n.collapseMessage)),container:D("<div/>").addClass(this.classes.panes).html(f.i18n("searchPanes.loadMessage",this.c.i18n.loadMessage)),emptyMessage:D("<div/>").addClass(this.classes.emptyMessage),panes:D("<div/>").addClass(this.classes.container),showAll:D('<button type="button"/>').addClass(this.classes.showAll).addClass(this.classes.disabledButton).attr("disabled","true").html(f.i18n("searchPanes.showMessage",
|
||
|
this.c.i18n.showMessage)),title:D("<div/>").addClass(this.classes.title),titleRow:D("<div/>").addClass(this.classes.titleRow)};this.s={colOpts:[],dt:f,filterCount:0,minPaneWidth:260,page:0,paging:!1,paneClass:d,panes:[],selectionList:[],serverData:{},stateRead:!1,updating:!1};if(!f.settings()[0]._searchPanes){this._getState();if(this.s.dt.page.info().serverSide)this.s.dt.on("preXhr.dtsps",function(g,m,q){void 0===q.searchPanes&&(q.searchPanes={});void 0===q.searchPanes_null&&(q.searchPanes_null={});
|
||
|
g=0;for(m=e.s.selectionList;g<m.length;g++){var w=m[g];var y=e.s.dt.column(w.column).dataSrc();void 0===q.searchPanes[y]&&(q.searchPanes[y]={});void 0===q.searchPanes_null[y]&&(q.searchPanes_null[y]={});for(var z=0;z<w.rows.length;z++)q.searchPanes[y][z]=w.rows[z],null===q.searchPanes[y][z]&&(q.searchPanes_null[y][z]=!0)}0<e.s.selectionList.length&&(q.searchPanesLast=y)});this._setXHR();f.settings()[0]._searchPanes=this;if(this.s.dt.settings()[0]._bInitComplete||c)this._paneDeclare(f,a,b);else f.one("preInit.dtsps",
|
||
|
function(){e._paneDeclare(f,a,b)});return this}}h.prototype.clearSelections=function(){for(var a=0,b=this.s.panes;a<b.length;a++){var c=b[a];c.s.dtPane&&(c.s.scrollTop=c.s.dtPane.table().node().parentNode.scrollTop)}this.dom.container.find("."+this.classes.search.replace(/\s+/g,".")).each(function(){D(this).val("").trigger("input")});this.s.selectionList=[];a=[];b=0;for(var d=this.s.panes;b<d.length;b++)c=d[b],c.s.dtPane&&a.push(c.clearPane());return a};h.prototype.getNode=function(){return this.dom.container};
|
||
|
h.prototype.rebuild=function(a,b){void 0===a&&(a=!1);void 0===b&&(b=!1);this.dom.emptyMessage.detach();!1===a&&this.dom.panes.empty();for(var c=[],d=0,e=this.s.panes;d<e.length;d++){var f=e[d];if(!1===a||f.s.index===a)f.clearData(),f.rebuildPane(this.s.dt.page.info().serverSide?this.s.serverData:void 0,b),this.dom.panes.append(f.dom.container),c.push(f)}this._updateSelection();this._updateFilterCount();this._attachPaneContainer();this._initSelectionListeners(!1);this.s.dt.draw(!b);this.resizePanes();
|
||
|
return 1===c.length?c[0]:c};h.prototype.resizePanes=function(){if("auto"===this.c.layout){var a=D(this.s.dt.searchPanes.container()).width(),b=Math.floor(a/this.s.minPaneWidth),c=1,d=0;a=[];for(var e=0,f=this.s.panes;e<f.length;e++){var g=f[e];g.s.displayed&&a.push(g.s.index)}g=a.length;if(b===g)c=b;else for(;1<b;b--)if(e=g%b,0===e){c=b;d=0;break}else e>d&&(c=b,d=e);var m=0!==d?a.slice(a.length-d,a.length):[];this.s.panes.forEach(function(q){q.s.displayed&&q.resize("columns-"+(m.includes(q.s.index)?
|
||
|
d:c))})}else for(a=0,b=this.s.panes;a<b.length;a++)g=b[a],g.adjustTopRow();return this};h.prototype._initSelectionListeners=function(a){};h.prototype._serverTotals=function(){};h.prototype._setXHR=function(){var a=this;this.s.dt.on("xhr.dtsps",function(b,c,d){d&&d.searchPanes&&d.searchPanes.options&&(a.s.serverData=d,a.s.serverData.tableLength=d.recordsTotal,a._serverTotals())})};h.prototype._stateLoadListener=function(){var a=this;this.s.dt.on("stateLoadParams.dtsps",function(b,c,d){if(void 0!==
|
||
|
d.searchPanes){a.clearSelections();a.s.selectionList=d.searchPanes.selectionList?d.searchPanes.selectionList:[];if(d.searchPanes.panes)for(b=0,d=d.searchPanes.panes;b<d.length;b++){c=d[b];for(var e=0,f=a.s.panes;e<f.length;e++){var g=f[e];c.id===g.s.index&&(g.dom.searchBox.val(c.searchTerm),g.s.dtPane.order(c.order))}}a._makeSelections(a.s.selectionList)}})};h.prototype._updateSelection=function(){this.s.selectionList=[];for(var a=0,b=this.s.panes;a<b.length;a++){var c=b[a];if(c.s.dtPane){var d=c.s.dtPane.rows({selected:!0}).data().toArray().map(function(e){return e.filter});
|
||
|
d.length&&this.s.selectionList.push({column:c.s.index,rows:d})}}};h.prototype._attach=function(){var a=this;this.dom.titleRow.removeClass(this.classes.hide).detach().append(this.dom.title);if(this.c.clear)this.dom.clearAll.appendTo(this.dom.titleRow).on("click.dtsps",function(){return a.clearSelections()});this.c.collapse&&(this.dom.showAll.appendTo(this.dom.titleRow),this.dom.collapseAll.appendTo(this.dom.titleRow),this._setCollapseListener());for(var b=0,c=this.s.panes;b<c.length;b++)this.dom.panes.append(c[b].dom.container);
|
||
|
this.dom.container.text("").removeClass(this.classes.hide).append(this.dom.titleRow).append(this.dom.panes);this.s.panes.forEach(function(d){return d.setListeners()});0===D("div."+this.classes.container).length&&this.dom.container.prependTo(this.s.dt)};h.prototype._attachMessage=function(){try{var a=this.s.dt.i18n("searchPanes.emptyPanes",this.c.i18n.emptyPanes)}catch(b){a=null}null===a?(this.dom.container.addClass(this.classes.hide),this.dom.titleRow.removeClass(this.classes.hide)):(this.dom.container.removeClass(this.classes.hide),
|
||
|
this.dom.titleRow.addClass(this.classes.hide),this.dom.emptyMessage.html(a).appendTo(this.dom.container))};h.prototype._attachPaneContainer=function(){for(var a=0,b=this.s.panes;a<b.length;a++)if(!0===b[a].s.displayed){this._attach();return}this._attachMessage()};h.prototype._checkCollapse=function(){for(var a=!0,b=!0,c=0,d=this.s.panes;c<d.length;c++){var e=d[c];e.s.displayed&&(e.dom.collapseButton.hasClass(e.classes.rotated)?(this.dom.showAll.removeClass(this.classes.disabledButton).removeAttr("disabled"),
|
||
|
b=!1):(this.dom.collapseAll.removeClass(this.classes.disabledButton).removeAttr("disabled"),a=!1))}a&&this.dom.collapseAll.addClass(this.classes.disabledButton).attr("disabled","true");b&&this.dom.showAll.addClass(this.classes.disabledButton).attr("disabled","true")};h.prototype._checkMessage=function(){for(var a=0,b=this.s.panes;a<b.length;a++)if(!0===b[a].s.displayed){this.dom.emptyMessage.detach();this.dom.titleRow.removeClass(this.classes.hide);return}this._attachMessage()};h.prototype._collapseAll=
|
||
|
function(){for(var a=0,b=this.s.panes;a<b.length;a++)b[a].collapse()};h.prototype._findPane=function(a){for(var b=0,c=this.s.panes;b<c.length;b++){var d=c[b];if(a===d.s.name)return d}};h.prototype._getState=function(){var a=this.s.dt.state.loaded();a&&a.searchPanes&&a.searchPanes.selectionList&&(this.s.selectionList=a.searchPanes.selectionList)};h.prototype._makeSelections=function(a){for(var b=0;b<a.length;b++){for(var c=a[b],d=void 0,e=0,f=this.s.panes;e<f.length;e++){var g=f[e];if(g.s.index===
|
||
|
c.column){d=g;break}}if(d&&d.s.dtPane){for(e=0;e<d.s.dtPane.rows().data().toArray().length;e++)c.rows.includes("function"===typeof d.s.dtPane.row(e).data().filter?d.s.dtPane.cell(e,0).data():d.s.dtPane.row(e).data().filter)&&d.s.dtPane.row(e).select();d.updateTable()}}};h.prototype._paneDeclare=function(a,b,c){var d=this;a.columns(0<this.c.columns.length?this.c.columns:void 0).eq(0).each(function(g){d.s.panes.push(new d.s.paneClass(b,c,g,d.dom.panes))});for(var e=a.columns().eq(0).toArray().length,
|
||
|
f=0;f<this.c.panes.length;f++)this.s.panes.push(new this.s.paneClass(b,c,e+f,this.dom.panes,this.c.panes[f]));0<this.c.order.length&&(this.s.panes=this.c.order.map(function(g){return d._findPane(g)}));this.s.dt.settings()[0]._bInitComplete?this._startup(a):this.s.dt.settings()[0].aoInitComplete.push({fn:function(){return d._startup(a)}})};h.prototype._setCollapseListener=function(){var a=this;this.dom.collapseAll.on("click.dtsps",function(){a._collapseAll();a.dom.collapseAll.addClass(a.classes.disabledButton).attr("disabled",
|
||
|
"true");a.dom.showAll.removeClass(a.classes.disabledButton).removeAttr("disabled");a.s.dt.state.save()});this.dom.showAll.on("click.dtsps",function(){a._showAll();a.dom.showAll.addClass(a.classes.disabledButton).attr("disabled","true");a.dom.collapseAll.removeClass(a.classes.disabledButton).removeAttr("disabled");a.s.dt.state.save()});for(var b=0,c=this.s.panes;b<c.length;b++)c[b].dom.collapseButton.on("click.dtsps",function(){return a._checkCollapse()});this._checkCollapse()};h.prototype._showAll=
|
||
|
function(){for(var a=0,b=this.s.panes;a<b.length;a++)b[a].show()};h.prototype._startup=function(a){var b=this;this._attach();this.dom.panes.empty();for(var c=0,d=this.s.panes;c<d.length;c++){var e=d[c];e.rebuildPane(0<Object.keys(this.s.serverData).length?this.s.serverData:void 0);this.dom.panes.append(e.dom.container)}"auto"===this.c.layout&&this.resizePanes();c=this.s.dt.state.loaded();!this.s.stateRead&&c&&this.s.dt.page(c.start/this.s.dt.page.len()).draw("page");this.s.stateRead=!0;this._checkMessage();
|
||
|
a.on("preDraw.dtsps",function(){b.s.updating||b.s.paging||(b._updateFilterCount(),b._updateSelection());b.s.paging=!1});D(window).on("resize.dtsps",H.util.throttle(function(){return b.resizePanes()}));this.s.dt.on("stateSaveParams.dtsps",function(f,g,m){void 0===m.searchPanes&&(m.searchPanes={});m.searchPanes.selectionList=b.s.selectionList});this._stateLoadListener();a.off("page.dtsps").on("page.dtsps",function(){b.s.paging=!0;b.s.page=b.s.dt.page()});if(this.s.dt.page.info().serverSide)a.off("preXhr.dtsps").on("preXhr.dtsps",
|
||
|
function(f,g,m){m.searchPanes||(m.searchPanes={});m.searchPanes_null||(m.searchPanes_null={});g=f=0;for(var q=b.s.panes;g<q.length;g++){var w=q[g],y=b.s.dt.column(w.s.index).dataSrc();m.searchPanes[y]||(m.searchPanes[y]={});m.searchPanes_null[y]||(m.searchPanes_null[y]={});if(w.s.dtPane){w=w.s.dtPane.rows({selected:!0}).data().toArray();for(var z=0;z<w.length;z++)m.searchPanes[y][z]=w[z].filter,m.searchPanes[y][z]||(m.searchPanes_null[y][z]=!0),f++}}0<f&&(f!==b.s.filterCount?(m.start=0,b.s.page=0):
|
||
|
m.start=b.s.page*b.s.dt.page.len(),b.s.dt.page(b.s.page),b.s.filterCount=f);0<b.s.selectionList.length&&(m.searchPanesLast=b.s.dt.column(b.s.selectionList[b.s.selectionList.length-1].column).dataSrc())});else a.on("preXhr.dtsps",function(){return b.s.panes.forEach(function(f){return f.clearData()})});this.s.dt.on("xhr.dtsps",function(f,g){if(g.nTable===b.s.dt.table().node()&&!b.s.dt.page.info().serverSide){var m=!1;b.s.dt.one("preDraw.dtsps",function(){if(!m){var q=b.s.dt.page();m=!0;b.s.updating=
|
||
|
!0;b.dom.panes.empty();for(var w=0,y=b.s.panes;w<y.length;w++){var z=y[w];z.clearData();z.rebuildPane(void 0,!0);b.dom.panes.append(z.dom.container)}b.s.dt.page.info().serverSide||b.s.dt.draw();b.s.updating=!1;b._updateSelection();b._checkMessage();b.s.dt.one("draw.dtsps",function(){b.s.updating=!0;b.s.dt.page(q).draw(!1);b.s.updating=!1})}})}});d=this.c.preSelect;c&&c.searchPanes&&c.searchPanes.selectionList&&(d=c.searchPanes.selectionList);this._makeSelections(d);this._updateFilterCount();a.on("destroy.dtsps",
|
||
|
function(){for(var f=0,g=b.s.panes;f<g.length;f++)g[f].destroy();a.off(".dtsps");b.dom.showAll.off(".dtsps");b.dom.clearAll.off(".dtsps");b.dom.collapseAll.off(".dtsps");D(a.table().node()).off(".dtsps");b.dom.container.detach();b.clearSelections()});this.c.collapse&&this._setCollapseListener();if(this.c.clear)this.dom.clearAll.on("click.dtsps",function(){return b.clearSelections()});a.settings()[0]._searchPanes=this;this.s.dt.state.save()};h.prototype._updateFilterCount=function(){for(var a=0,b=
|
||
|
0,c=this.s.panes;b<c.length;b++){var d=c[b];d.s.dtPane&&(a+=d.getPaneCount())}this.dom.title.html(this.s.dt.i18n("searchPanes.title",this.c.i18n.title,a));this.c.filterChanged&&"function"===typeof this.c.filterChanged&&this.c.filterChanged.call(this.s.dt,a);0===a?this.dom.clearAll.addClass(this.classes.disabledButton).attr("disabled","true"):this.dom.clearAll.removeClass(this.classes.disabledButton).removeAttr("disabled")};h.version="2.0.0";h.classes={clear:"dtsp-clear",clearAll:"dtsp-clearAll",collapseAll:"dtsp-collapseAll",
|
||
|
container:"dtsp-searchPanes",disabledButton:"dtsp-disabledButton",emptyMessage:"dtsp-emptyMessage",hide:"dtsp-hidden",panes:"dtsp-panesContainer",search:"dtsp-search",showAll:"dtsp-showAll",title:"dtsp-title",titleRow:"dtsp-titleRow"};h.defaults={clear:!0,collapse:!0,columns:[],container:function(a){return a.table().container()},filterChanged:void 0,i18n:{clearMessage:"Clear All",clearPane:"×",collapse:{0:"SearchPanes",_:"SearchPanes (%d)"},collapseMessage:"Collapse All",count:"{total}",emptyMessage:"<em>No data</em>",
|
||
|
emptyPanes:"No SearchPanes",loadMessage:"Loading Search Panes...",showMessage:"Show All",title:"Filters Active - %d"},layout:"auto",order:[],panes:[],preSelect:[]};return h}(),Q=window&&window.__extends||function(){var h=function(a,b){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var e in d)d.hasOwnProperty(e)&&(c[e]=d[e])};return h(a,b)};return function(a,b){function c(){this.constructor=a}h(a,b);a.prototype=null===b?Object.create(b):(c.prototype=
|
||
|
b.prototype,new c)}}(),L=function(h){function a(b,c,d){void 0===d&&(d=!1);var e=this,f;c.cascadePanes&&c.viewTotal?f=K:c.cascadePanes?f=F:c.viewTotal&&(f=p);e=h.call(this,b,c,d,f)||this;var g=e.s.dt.state.loaded();e.s.dt.off("init.dtsps").on("init.dtsps",function(){return e._initSelectionListeners(!0,g&&g.searchPanes&&g.searchPanes.selectionList?g.searchPanes.selectionList:e.c.preSelect)});return e}Q(a,h);a.prototype._initSelectionListeners=function(b,c){void 0===b&&(b=!0);void 0===c&&(c=[]);b&&(this.s.selectionList=
|
||
|
c);b=0;for(c=this.s.panes;b<c.length;b++){var d=c[b];if(d.s.displayed)d.s.dtPane.off("select.dtsp").on("select.dtsp",this._update(d)).off("deselect.dtsp").on("deselect.dtsp",this._update(d))}this.s.dt.off("draw.dtsps").on("draw.dtsps",this._update());this._updateSelectionList()};a.prototype._serverTotals=function(){for(var b=0,c=this.s.panes;b<c.length;b++){var d=c[b];if(d.s.colOpts.show){var e=this.s.dt.column(d.s.index).dataSrc(),f=!0,g=0;for(e=this.s.serverData.searchPanes.options[e];g<e.length;g++){var m=
|
||
|
e[g];if(m.total!==m.count){f=!1;break}}d.s.filteringActive=!f;d._serverPopulate(this.s.serverData)}}};a.prototype._stateLoadListener=function(){var b=this,c=function(d,e,f){if(void 0!==f.searchPanes){b.s.selectionList=f.searchPanes.selectionList?f.searchPanes.selectionList:[];if(f.searchPanes.panes)for(d=0,f=f.searchPanes.panes;d<f.length;d++){e=f[d];for(var g=0,m=b.s.panes;g<m.length;g++){var q=m[g];e.id===q.s.index&&(q.dom.searchBox.val(e.searchTerm),q.s.dtPane.order(e.order))}}b._updateSelectionList()}};
|
||
|
this.s.dt.off("stateLoadParams.dtsps",c).on("stateLoadParams.dtsps",c)};a.prototype._updateSelection=function(){};a.prototype._update=function(b){var c=this;void 0===b&&(b=void 0);return function(){return c._updateSelectionList(b)}};a.prototype._updateSelectionList=function(b){void 0===b&&(b=void 0);if(!(this.s.updating||b&&b.s.serverSelecting)){if(void 0!==b){this.s.dt.page.info().serverSide&&b._updateSelection();var c=b.s.dtPane.rows({selected:!0}).data().toArray().map(function(d){return d.filter});
|
||
|
this.s.selectionList=this.s.selectionList.filter(function(d){return d.column!==b.s.index});0<c.length&&this.s.selectionList.push({column:b.s.index,rows:c});this.s.dt.page.info().serverSide&&this.s.dt.draw(!1)}this._remakeSelections();this._updateFilterCount()}};a.prototype._remakeSelections=function(){this.s.updating=!0;if(this.s.dt.page.info().serverSide){e=void 0;0<this.s.selectionList.length&&(e=this.s.panes[this.s.selectionList[this.s.selectionList.length-1].column]);for(var b=0,c=this.s.panes;b<
|
||
|
c.length;b++)B=c[b],!B.s.displayed||e&&B.s.index===e.s.index||B.updateRows()}else{e=this.s.selectionList;b=!1;this.clearSelections();this.s.dt.draw();this.s.dt.rows().toArray()[0].length>this.s.dt.rows({search:"applied"}).toArray()[0].length&&(b=!0);this.s.selectionList=e;c=0;for(var d=this.s.panes;c<d.length;c++){var e=d[c];e.s.displayed&&(e.s.filteringActive=b,e.updateRows())}c=0;for(d=this.s.selectionList;c<d.length;c++){B=d[c];e=void 0;for(var f=0,g=this.s.panes;f<g.length;f++){var m=g[f];if(m.s.index===
|
||
|
B.column){e=m;break}}if(e.s.dtPane){f=e.s.dtPane.rows().indexes().toArray();g=0;for(m=B.rows;g<m.length;g++)for(var q=m[g],w=0,y=f;w<y.length;w++){var z=e.s.dtPane.row(y[w]),E=z.data();q===E.filter&&z.select()}e.s.selections=B.rows;if(0!==B.rows.length){this.s.dt.draw();q=f=m=g=0;for(w=this.s.panes;q<w.length;q++){var B=w[q];B.s.dtPane&&(g+=B.getPaneCount(),g>m&&(f++,m=g))}g=0<g;m=0;for(q=this.s.panes;m<q.length;m++)B=q[m],B.s.displayed&&(b||e.s.index!==B.s.index||!g?B.s.filteringActive=g||b:1===
|
||
|
f&&(B.s.filteringActive=!1),B.s.index!==e.s.index&&B.updateRows())}}}this.s.dt.draw()}this.s.updating=!1};return a}(J);(function(h){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return h(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net")(a,b).$);return h(b,a,a.document)}:h(window.jQuery,window,document)})(function(h,a,b){function c(e,f,g){void 0===f&&(f=null);void 0===g&&
|
||
|
(g=!1);e=new d.Api(e);f=f?f:e.init().searchPanes||d.defaults.searchPanes;return(f&&(f.cascadePanes||f.viewTotal)?new L(e,f,g):new J(e,f,g)).getNode()}l(h);n(h);N=x=t=h;var d=h.fn.dataTable;h.fn.dataTable.SearchPanes=J;h.fn.DataTable.SearchPanes=J;h.fn.dataTable.SearchPanesST=L;h.fn.DataTable.SearchPanesST=L;h.fn.dataTable.SearchPane=v;h.fn.DataTable.SearchPane=v;h.fn.dataTable.SearchPaneViewTotal=p;h.fn.DataTable.SearchPaneViewTotal=p;h.fn.dataTable.SearchPaneCascade=F;h.fn.DataTable.SearchPaneCascade=
|
||
|
F;h.fn.dataTable.SearchPaneCascadeViewTotal=K;h.fn.DataTable.SearchPaneCascadeViewTotal=K;a=h.fn.dataTable.Api.register;a("searchPanes()",function(){return this});a("searchPanes.clearSelections()",function(){return this.iterator("table",function(e){e._searchPanes&&e._searchPanes.clearSelections()})});a("searchPanes.rebuildPane()",function(e,f){return this.iterator("table",function(g){g._searchPanes&&g._searchPanes.rebuild(e,f)})});a("searchPanes.resizePanes()",function(){var e=this.context[0];return e._searchPanes?
|
||
|
e._searchPanes.resizePanes():null});a("searchPanes.container()",function(){var e=this.context[0];return e._searchPanes?e._searchPanes.getNode():null});h.fn.dataTable.ext.buttons.searchPanesClear={action:function(e,f){f.searchPanes.clearSelections()},text:"Clear Panes"};h.fn.dataTable.ext.buttons.searchPanes={action:function(e,f,g,m){this.popover(m._panes.getNode(),{align:"container",span:"container"});m._panes.rebuild(void 0,!0)},config:{},init:function(e,f,g){var m=h.extend({filterChanged:function(q){e.button(f).text(e.i18n("searchPanes.collapse",
|
||
|
void 0!==e.context[0].oLanguage.searchPanes?e.context[0].oLanguage.searchPanes.collapse:e.context[0]._searchPanes.c.i18n.collapse,q))}},g.config);m=m&&(m.cascadePanes||m.viewTotal)?new h.fn.dataTable.SearchPanesST(e,m):new h.fn.dataTable.SearchPanes(e,m);e.button(f).text(g.text||e.i18n("searchPanes.collapse",m.c.i18n.collapse,0));g._panes=m},text:null};h(b).on("preInit.dt.dtsp",function(e,f){"dt"===e.namespace&&(f.oInit.searchPanes||d.defaults.searchPanes)&&(f._searchPanes||c(f,null,!0))});d.ext.feature.push({cFeature:"P",
|
||
|
fnInit:c});d.ext.features&&d.ext.features.register("searchPanes",c)})})();
|