1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-19 23:06:42 +02:00
TableFilter/dist/tablefilter/tablefilter.js

14 lines
217 KiB
JavaScript
Raw Normal View History

/**
* tablefilter v0.5.12 by Max Guglielmi
* build date: 2017-05-07T05:55:30.374Z
* MIT License
*/
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i=window.webpackJsonp;window.webpackJsonp=function(e,n,r){for(var o,a,u=0,l=[];u<e.length;u++)a=e[u],s[a]&&l.push(s[a][0]),s[a]=0;for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);for(i&&i(e,n,r);l.length;)l.shift()()};var n={},s={1:0};return e.e=function(t){function i(){r.onerror=r.onload=null,clearTimeout(o);var e=s[t];0!==e&&(e&&e[1](new Error("Loading chunk "+t+" failed.")),s[t]=void 0)}if(0===s[t])return Promise.resolve();if(s[t])return s[t][2];var n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.type="text/javascript",r.charset="utf-8",r.async=!0,r.timeout=12e4,e.nc&&r.setAttribute("nonce",e.nc),r.src=e.p+"tf-"+({}[t]||t)+"-"+{0:"550b7c88a36d42262f0e"}[t]+".js";var o=setTimeout(i,12e4);r.onerror=r.onload=i;var a=new Promise(function(e,i){s[t]=[e,i]});return s[t][2]=a,n.appendChild(r),a},e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e.oe=function(t){throw console.error(t),t},e(e.s=126)}([function(t,e,i){(function(e){(function(){"use strict";function i(){if(N=I[O],!N){if(N=function(t){return U(N,function(e,i){T(A,i)&&e.extend(t)}),N},R)t.exports=N;else try{I[O]=N}catch(t){}U(F.split(" "),function(t){n(t)}),s()}}function n(t){function e(t,e,i){C(n,t,function(t,s,r){var u=a(t,s,r);return o(n,u.methods,e,i,u.last),n})}var i="Object"===t,n=d(t,!0),s=function(e){function s(t,e){return i&&e===p&&(!M||"get"===t||"set"===t)}function r(t,i){var n=e[t];if(n)for(var s,r=0;s=n[r];r++)if(s===i)return!0;return!1}function o(t,i){return e[t]&&!r(t,i)}function a(t,i,n){if(!i[t]||!n)return!1;for(var s=0;s<n.length;s++)if(e[n[s]]===!1)return!0}function u(){return r("except",d)||o("namespaces",d)}function l(t){return r("except",t)}function c(t,e,i){return!s(t,i)&&!a(t,i,e.flags)&&!l(t)}var h,d=I[t],p=d.prototype,m={},g={};if(e=e||{},h=e.methods,!u())return i&&"boolean"==typeof e.objectPrototype&&(M=e.objectPrototype),U(h||n,function(t,e){h&&(e=t,t=n[e]),T(t,"instance")&&c(e,t,p)&&(g[e]=t.instance),T(t,"static")&&c(e,t,d)&&(m[e]=t)}),f(d,m),f(p,g),h||C(n,"active",!0),n};return e("defineStatic",P),e("defineInstance",S),e("defineInstanceAndStatic",S|P),e("defineStaticWithArguments",P,!0),e("defineInstanceWithArguments",S,!0),C(n,"defineStaticPolyfill",function(e,i,s){var r=a(e,i,s);return f(I[t],r.methods,!0,r.last),n}),C(n,"defineInstancePolyfill",function(e,i,s){var r=a(e,i,s);return f(I[t].prototype,r.methods,!0,r.last),U(r.methods,function(t,e){p(n,e,t)}),n}),C(n,"alias",function(t,e){var i="string"==typeof e?n[e]:e;return h(n,t,i),n}),C(n,"extend",s),A[t]=n,L["[object "+t+"]"]=n,_(t),m(n),N[t]=n}function s(){C(N,"extend",N),C(N,"toString",r),C(N,"createNamespace",n),C(N,"util",{hasOwn:T,getOwn:k,setProperty:C,classToString:E,defineProperty:j,forEachProperty:U,mapNativeToChainable:_})}function r(){return O}function o(t,e,i,n,s){U(e,function(e,r){var o,a=e;n&&(a=l(e)),s&&(a.flags=s),i&S&&!e.instance&&(o=u(e,n),C(a,"instance",o)),i&P&&C(a,"static",!0),h(t,r,a),t.active&&t.extend(r)})}function a(t,e,i){var n,s;return"string"==typeof t?(n={},n[t]=e,s=i):(n=t,s=e),{last:s,methods:n}}function u(t,e){return e?l(t,!0):c(t)}function l(t,e){var i=t.length-1-(e?1:0);return function(){var n,s=[],r=[];e&&s.push(this),n=Math.max(arguments.length,i);for(var o=0;o<n;o++)o<i?s.push(arguments[o]):r.push(arguments[o]);return s.push(r),t.apply(this,s)}}function c(t){switch(t.length){case 0:case 1:return function(){return t(this)};case 2:return functio
c.addEvt)(o,"click",function(t){return n.onCheckListClick(t)}),o.appendChild((0,a.createText)(this.activateText))):this.build(t),this.emitter.on(["build-checklist-filter"],function(t,e,i){return n.build(e,i)}),this.emitter.on(["select-checklist-options"],function(t,e,i){return n.selectOptions(e,i)}),this.emitter.on(["rows-changed"],function(){return n.refreshAll()}),this.initialized=!0},e.prototype.build=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.tf;t=parseInt(t,10),this.emitter.emit("before-populating-filter",i,t),this.opts=[],this.optsTxt=[];var n=this.containers[t],s=(0,a.createElm)("ul",["id",i.fltIds[t]],["colIndex",t]);s.className=this.filterCssClass;var r=i.dom().rows,o=i.getRowsNb(!0),c=i.caseSensitive;if(this.isCustom=i.isCustomOptions(t),this.isCustom){var f=i.getCustomOptions(t);this.opts=f[0],this.optsTxt=f[1]}var h=void 0,d=i.getActiveFilterId();e&&d&&(h=i.getColumnIndexFromFilterId(d));var p=[];e&&i.disableExcludedOptions&&(this.excludedOpts=[]),n.innerHTML="";for(var m=i.refRow;m<o;m++)if(!i.hasVisibleRows||i.visibleRows.indexOf(m)===-1){var g=r[m].cells,y=g.length;if(y===i.nbCells&&!this.isCustom)for(var v=0;v<y;v++)if(t===v&&!(e&&!i.disableExcludedOptions&&!i.paging&&!i.isRowDisplayed(m)||i.paging&&h&&!i.isRowValid(m))){var b=i.getCellValue(g[v]),_=(0,l.matchCase)(b,c);(0,u.has)(this.opts,_,c)||this.opts.push(b);var x=p[v];e&&i.disableExcludedOptions&&(x||(x=i.getVisibleColumnValues(v)),(0,u.has)(x,_,c)||(0,u.has)(this.excludedOpts,_,c)||this.excludedOpts.push(b))}}this.opts=this.sortOptions(t,this.opts),this.excludedOpts&&(this.excludedOpts=this.sortOptions(t,this.excludedOpts)),this.addChecks(t,s),i.loadFltOnDemand&&(n.innerHTML=""),n.appendChild(s),n.setAttribute("filled","1"),this.emitter.emit("after-populating-filter",i,t,n)},e.prototype.addChecks=function(t,e){for(var i=this,n=this.tf,s=this.addTChecks(t,e),r=0;r<this.opts.length;r++){var o=this.opts[r],f=this.isCustom?this.optsTxt[r]:o,d=n.fltIds[t],p=(0,a.createCheckItem)(d+"_"+(r+s),o,f);p.className=this.itemCssClass,n.linkedFilters&&n.disableExcludedOptions&&(0,u.has)(this.excludedOpts,(0,l.matchCase)(o,n.caseSensitive),n.caseSensitive)?((0,a.addClass)(p,this.disabledItemCssClass),p.check.disabled=!0,p.disabled=!0):(0,c.addEvt)(p.check,"click",function(t){return i.optionClick(t)}),e.appendChild(p),""===o&&(p.style.display=h.NONE)}},e.prototype.addTChecks=function(t,e){var i=this,n=this.tf,s=1,r=n.fltIds[t],o=(0,a.createCheckItem)(r+"_0","",n.getClearFilterText(t));if(o.className=this.itemCssClass,e.appendChild(o),(0,c.addEvt)(o.check,"click",function(t){return i.optionClick(t)}),this.enableResetOption||(o.style.display=h.NONE),n.enableEmptyOption){var u=(0,a.createCheckItem)(r+"_1",n.emOperator,n.emptyText);u.className=this.itemCssClass,e.appendChild(u),(0,c.addEvt)(u.check,"click",function(t){return i.optionClick(t)}),s++}if(n.enableNonEmptyOption){var l=(0,a.createCheckItem)(r+"_2",n.nmOperator,n.nonEmptyText);l.className=this.itemCssClass,e.appendChild(l),(0,c.addEvt)(l.check,"click",function(t){return i.optionClick(t)}),s++}return s},e.prototype.setCheckListValues=function(t){if(t){var e=this.tf,i=t.value,n=parseInt(t.id.split("_")[2],10),s=e.getColumnIndexFromFilterId(t.id),r="LI",o=e.getFilterElement(parseInt(s,10)),u=o.childNodes[n],c=o.getAttribute("colIndex"),f=o.getAttribute("value"),h=o.getAttribute("indexes");if(t.checked){if(""===i){if(h&&""!==h)for(var d=h.split(e.separator),p=0;p<d.length;p++){var m=(0,a.elm)(e.fltIds[c]+"_"+d[p]);m&&(m.checked=!1,(0,a.removeClass)(o.childNodes[d[p]],this.selectedItemCssClass))}o.setAttribute("value",""),o.setAttribute("indexes","")}else f=f?f:"",i=(0,l.trim)(f+" "+i+" "+e.orOperator),n=h+n+e.separator,o.setAttribute("value",i),o.setAttribute("indexes",n),(0,a.elm)(e.fltIds[c]+"_0")&&((0,a.elm)(e.fltIds[c]+"_0").checked=!1);u.nodeName===r&&((0,a.removeClass)(o.childNodes[0],this.selectedItemCssClass),(0,a.addClass)(u,this.selectedItemCssClass))}else{if(""!==i){var g=new RegExp((0,l.rgxEsc)(i+" "+e.orOperator));f=f.replace(g,""),o.setAttribute("value",(0,l.tr
case"tomorrow"===e:return l(t,1);case"yesterday"===e:return l(t,-1);case"weekday"===e:return c(t)>0&&c(t)<6;case"weekend"===e:return 0===c(t)||6===c(t);case a(n=m.weekdayMap[e]):return c(t)===n;case a(n=m.monthMap[e]):return o(t)===n}return d(t,e,i)}}var s=i(7),r=i(150),o=i(29),a=i(27),u=i(40),l=i(206),c=i(20),f=i(45),h=i(3),d=i(82),p=h.isString,m=s.English;t.exports=n},function(t,e,i){"use strict";function n(t,e){var i=0,n=0;return r(function(t,s){if(n=o(e(t)),n>=1)return i=s,!1}),[n,i,t]}var s=i(6),r=i(61),o=s.abs;t.exports=n},function(t,e,i){"use strict";function n(t,e){return s(t,e)||s(t,e+"s")||"day"===e&&s(t,"date")}var s=i(138);t.exports=n},function(t,e,i){"use strict";function n(t){return 32-o(new Date(s(t),r(t),32),"Date")}var s=i(30),r=i(29),o=i(18);t.exports=n},function(t,e,i){"use strict";function n(t){return s(t,"Hours")}var s=i(18);t.exports=n},function(t,e,i){"use strict";function n(t,e){return t.length>1&&(t="(?:"+t+")"),e&&(t+="?"),t}t.exports=n},function(t,e,i){"use strict";function n(t,e){var i,n,u,c=s(t)?0:o(t);return u=e===!0?":":"",!c&&e?"Z":(i=a(r(-c/60),2,!0),n=a(l(c%60),2),i+u+n)}var s=i(21),r=i(23),o=i(49),a=i(54),u=i(6),l=u.abs;t.exports=n},function(t,e,i){"use strict";function n(t,e){var i=e-1;return s(t,7*a((r(t)-i)/7)+i),t}var s=i(24),r=i(20),o=i(6),a=o.ceil;t.exports=n},function(t,e,i){"use strict";function n(t,e,i){o(t,u),r(t,i),a(t,e)}var s=i(5),r=i(35),o=i(36),a=i(62),u=s.MONTH_INDEX;t.exports=n},function(t,e,i){"use strict";function n(t){return r(t,o)}var s=i(5),r=i(36),o=s.HOURS_INDEX;t.exports=n},function(t,e,i){"use strict";function n(t,e){if(g(e)){var i=f(t),n=h(t);m(i,y,v),o(i,r(i)+7*(e-1)),a(t,u(i)),c(t,l(i)),o(t,r(i)),d(t,n||7)}return t.getTime()}var s=i(63),r=i(34),o=i(35),a=i(228),u=i(30),l=i(29),c=i(227),f=i(33),h=i(20),d=i(24),p=i(3),m=i(94),g=p.isNumber,y=s.ISO_FIRST_DAY_OF_WEEK,v=s.ISO_FIRST_DAY_OF_WEEK_YEAR;t.exports=n},function(t,e,i){"use strict";function n(t,e){for(;t>=0&&e(s[t],t)!==!1;)t=r(t)}var s=i(31),r=i(39);t.exports=n},function(t,e,i){"use strict";var n=i(57),s=n({mdy:!0,firstDayOfWeek:0,firstDayOfWeekYear:1,short:"{MM}/{dd}/{yyyy}",medium:"{Month} {d}, {yyyy}",long:"{Month} {d}, {yyyy} {time}",full:"{Weekday}, {Month} {d}, {yyyy} {time}",stamp:"{Dow} {Mon} {d} {yyyy} {time}",time:"{h}:{mm} {TT}"});t.exports=s},function(t,e,i){"use strict";var n={ISO8601:"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{SSS}{Z}",RFC1123:"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {ZZ}",RFC1036:"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {ZZ}"};t.exports=n},function(t,e,i){"use strict";var n={year:{base:"yyyy",requiresSuffix:!0},month:{base:"MM",requiresSuffix:!0},date:{base:"dd",requiresSuffix:!0},hour:{base:"hh",requiresSuffixOr:":"},minute:{base:"mm"},second:{base:"ss"},num:{src:"\\d+",requiresNumerals:!0}};t.exports=n},function(t,e,i){"use strict";t.exports=6e4},function(t,e,i){"use strict";var n={yyyy:{param:"year",src:"\\d{4}"},MM:{param:"month",src:"[01]?\\d"},dd:{param:"date",src:"[0123]?\\d"},hh:{param:"hour",src:"[0-2]?\\d"},mm:{param:"minute",src:"[0-5]\\d"},ss:{param:"second",src:"[0-5]\\d(?:[,.]\\d+)?"},yy:{param:"year",src:"\\d{2}"},y:{param:"year",src:"\\d"},yearSign:{src:"[+-]",sign:!0},tzHour:{src:"[0-1]\\d"},tzMinute:{src:"[0-5]\\d"},tzSign:{src:"[+-]",sign:!0},ihh:{param:"hour",src:"[0-2]?\\d(?:[,.]\\d+)?"},imm:{param:"minute",src:"[0-5]\\d(?:[,.]\\d+)?"},GMT:{param:"utc",src:"GMT",val:1},Z:{param:"utc",src:"Z",val:1},timestamp:{src:"\\d+"}};t.exports=n},function(t,e,i){"use strict";i(199),i(411),t.exports=i(0)},function(t,e,i){"use strict";function n(t){return o(t)?new Date(t.getTime()):r(t)}var s=i(3),r=i(107),o=s.isDate;t.exports=n},function(t,e,i){"use strict";function n(t){return o(t)?t:null==t?new Date:a.create?a.create(t):new Date(t)}var s=i(3),r=i(22),o=s.isDate,a=r.sugarDate;t.exports=n},function(t,e,i){"use strict";function n(t){var e,i,n;return a(t)?[t,"Milliseconds"]:(e=t.match(s),i=+e[1]||1,n=o(e[2].toLowerCase()),n.match(/hour|minute|second/i)?n+="s":"Year"===n?n="FullYear":"Week"===n?(n="Date",i*=7):"Day"===n&&(n="Date"),[i,n])}var s=i(432),r=i(3),o=i(55),a=r.is
n&&(0,u.removeElm)(n),n=null,s&&(0,u.removeElm)(s),s=null,r&&(0,u.removeElm)(r),r=null}this.fltElms=[],this.fltSpans=[],this.fltIcons=[],tf.externalFltTgtIds=[],this.emitter.off(["before-filtering"],function(){return t.setIconsState()}),this.emitter.off(["after-filtering"],function(){return t.closeAll()}),this.emitter.off(["cell-processed"],function(e,i){return t.changeState(i,!0)}),this.emitter.off(["filters-row-inserted"],function(){return t.buildIcons()}),this.emitter.off(["before-filter-init"],function(e,i){return t.build(i)}),this.initialized=!1}},e}(o.Feature)},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.RowsCounter=void 0;var o=i(11),a=i(8),u=i(9);e.RowsCounter=function(t){function e(i){n(this,e);var r=s(this,t.call(this,i,"rowsCounter")),o=r.config.rows_counter||{};return r.targetId=o.target_id||null,r.container=null,r.label=null,r.text=o.text||"Rows: ",r.fromToTextSeparator=o.separator||"-",r.overText=o.over_text||" / ",r.cssClass=o.css_class||"tot",r.onBeforeRefreshCounter=(0,u.isFn)(o.on_before_refresh_counter)?o.on_before_refresh_counter:u.EMPTY_FN,r.onAfterRefreshCounter=(0,u.isFn)(o.on_after_refresh_counter)?o.on_after_refresh_counter:u.EMPTY_FN,r}return r(e,t),e.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf,i=(0,a.createElm)("div");i.className=this.cssClass;var n=(0,a.createElm)("span"),s=(0,a.createElm)("span");s.appendChild((0,a.createText)(this.text)),this.targetId||e.setToolbar();var r=this.targetId?(0,a.elm)(this.targetId):e.lDiv;this.targetId?(r.appendChild(s),r.appendChild(n)):(i.appendChild(s),i.appendChild(n),r.appendChild(i)),this.container=i,this.label=n,this.emitter.on(["after-filtering","grouped-by-page"],function(){return t.refresh(e.getValidRowsNb())}),this.emitter.on(["rows-changed"],function(){return t.refresh()}),this.initialized=!0,this.refresh()}},e.prototype.refresh=function(t){if(this.initialized&&this.isEnabled()){var e=this.tf;this.onBeforeRefreshCounter(e,this.label);var i=void 0;if(e.paging){var n=e.feature("paging");if(n){var s=e.getValidRowsNb(),r=parseInt(n.startPagingRow,10)+(s>0?1:0),o=r+n.pagingLength-1<=s?r+n.pagingLength-1:s;i=r+this.fromToTextSeparator+o+this.overText+s}}else i=t&&""!==t?t:e.getFilterableRowsNb()-e.nbHiddenRows;this.label.innerHTML=i,this.onAfterRefreshCounter(e,this.label,i)}},e.prototype.destroy=function(){var t=this;this.initialized&&(!this.targetId&&this.container?(0,a.removeElm)(this.container):(0,a.elm)(this.targetId).innerHTML="",this.label=null,this.container=null,this.emitter.off(["after-filtering","grouped-by-page"],function(){return t.refresh(tf.getValidRowsNb())}),this.emitter.off(["rows-changed"],function(){return t.refresh()}),this.initialized=!1)},e}(o.Feature)},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var o=i(11),a=i(116),u=i(125),l=i(19),c=i(9);e.State=function(t){function e(i){n(this,e);var r=s(this,t.
var n=t[i],s=(0,o.elm)(n);s&&(s.innerHTML="")}},t.prototype.isCustomOptions=function(t){return this.hasCustomOptions&&this.customOptions.cols.indexOf(t)!==-1},t.prototype.getCustomOptions=function(t){if(!(0,u.isEmpty)(t)&&this.isCustomOptions(t)){for(var e=this.customOptions,i=e.cols,n=[],s=[],r=i.indexOf(t),o=e.values[r],a=e.texts[r],l=e.sorts[r],c=0,f=o.length;c<f;c++)s.push(o[c]),a[c]?n.push(a[c]):n.push(o[c]);return l&&(s.sort(),n.sort()),[s,n]}},t.prototype.filter=function(){if(this.fltGrid&&this.initialized){this.onBeforeFilter(this),this.emitter.emit("before-filtering",this);var t=this.dom().rows,e=this.getRowsNb(!0),i=0;this.validRowsIndex=[];for(var n=this.getFiltersValue(),s=this.refRow;s<e;s++){t[s].style.display="";var r=t[s].cells,o=r.length;if(o===this.nbCells){for(var l=[],c=!0,f=!1,h=0;h<o;h++){var d=n[this.singleSearchFlt?0:h];if(""!==d){var p=(0,a.matchCase)(this.getCellValue(r[h]),this.caseSensitive),m=d.toString().split(this.orOperator),g=m.length>1,y=d.toString().split(this.anOperator),v=y.length>1;if((0,u.isArray)(d)||g||v){var b=void 0,_=void 0,x=!1;_=(0,u.isArray)(d)?d:g?m:y;for(var w=0,C=_.length;w<C&&(b=(0,a.trim)(_[w]),x=this._testTerm(b,p,h),x&&this.emitter.emit("highlight-keyword",this,r[h],b),!(g&&x||v&&!x))&&(!(0,u.isArray)(d)||!x);w++);l[h]=x}else l[h]=this._testTerm((0,a.trim)(d),p,h),l[h]&&this.emitter.emit("highlight-keyword",this,r[h],d);l[h]||(c=!1),this.singleSearchFlt&&l[h]&&(f=!0),this.emitter.emit("cell-processed",this,h,r[h])}}this.singleSearchFlt&&f&&(c=!0),this.validateRow(s,c),c||i++,this.emitter.emit("row-processed",this,s,this.validRowsIndex.length,c)}}this.nbHiddenRows=i,this.onAfterFilter(this),this.emitter.emit("after-filtering",this,n)}},t.prototype._testTerm=function(t,e,i){var n=void 0,s=this.getDecimal(i),r=new RegExp(this.leOperator),o=new RegExp(this.geOperator),u=new RegExp(this.lwOperator),c=new RegExp(this.grOperator),f=new RegExp(this.dfOperator),h=new RegExp((0,a.rgxEsc)(this.lkOperator)),d=new RegExp(this.eqOperator),p=new RegExp(this.stOperator),m=new RegExp(this.enOperator),g=this.emOperator,v=this.nmOperator,b=new RegExp((0,a.rgxEsc)(this.rgxOperator));t=(0,a.matchCase)(t,this.caseSensitive);var _=!1,x=u.test(t),w=r.test(t),C=c.test(t),E=o.test(t),T=f.test(t),k=d.test(t),N=h.test(t),O=p.test(t),F=m.test(t),P=g===t,S=v===t,D=b.test(t);if(this.hasType(i,[y.DATE])){var I=void 0,R=void 0,M=this.Mod.dateType,A=M.isValid.bind(M),L=M.parse.bind(M),j=M.getLocale(i),H=x&&A(t.replace(u,""),j),B=w&&A(t.replace(r,""),j),z=C&&A(t.replace(c,""),j),W=E&&A(t.replace(o,""),j),U=T&&A(t.replace(f,""),j),V=k&&A(t.replace(d,""),j);I=L(e,j),B?(R=L(t.replace(r,""),j),_=I<=R):H?(R=L(t.replace(u,""),j),_=I<R):W?(R=L(t.replace(o,""),j),_=I>=R):z?(R=L(t.replace(c,""),j),_=I>R):U?(R=L(t.replace(f,""),j),_=I.toString()!==R.toString()):V?(R=L(t.replace(d,""),j),_=I.toString()===R.toString()):h.test(t)?_=(0,a.contains)(t.replace(h,""),e,!1,this.caseSensitive):A(t)?(R=L(t,j),_=I.toString()===R.toString()):_=P?(0,a.isEmpty)(e):S?!(0,a.isEmpty)(e):(0,a.contains)(t,e,this.isExactMatch(i),this.caseSensitive)}else if(n=Number(e)||(0,l.parse)(e,s),w)_=n<=(0,l.parse)(t.replace(r,""),s);else if(E)_=n>=(0,l.parse)(t.replace(o,""),s);else if(x)_=n<(0,l.parse)(t.replace(u,""),s);else if(C)_=n>(0,l.parse)(t.replace(c,""),s);else if(T)_=!(0,a.contains)(t.replace(f,""),e,!1,this.caseSensitive);else if(N)_=(0,a.contains)(t.replace(h,""),e,!1,this.caseSensitive);else if(k)_=(0,a.contains)(t.replace(d,""),e,!0,this.caseSensitive);else if(O)_=0===e.indexOf(t.replace(p,""));else if(F){var Y=t.replace(m,"");_=e.lastIndexOf(Y,e.length-1)===e.length-1-(Y.length-1)&&e.lastIndexOf(Y,e.length-1)>-1}else if(P)_=(0,a.isEmpty)(e);else if(S)_=!(0,a.isEmpty)(e);else if(D)try{var K=t.replace(b,""),G=new RegExp(K);_=G.test(e)}catch(t){_=!1}else n&&this.hasType(i,[y.NUMBER,y.FORMATTED_NUMBER])&&!this.singleSearchFlt?(t=(0,l.parse)(t,s)||t,_=n===t||(0,a.contains)(t.toString(),n.toString(),this.isExactMatch(i),this.caseSensitive)):_=(0,a.contains)(t,e,this.isExactMatch(i),this.caseSensitive,this.ignoresDiacritics(i));retu
},n=function(t,e,i){return a(r(e,i,!0),o,t)},s=function(t,e,i){return a(r(e,i,!0),o,-t)},t[o]=i,t[o+"s"]=i,t[o+"Before"]=s,t[o+"sBefore"]=s,t[o+"Ago"]=s,t[o+"sAgo"]=s,t[o+"After"]=n,t[o+"sAfter"]=n,t[o+"FromNow"]=n,t[o+"sFromNow"]=n})}var s=i(31),r=i(28),o=i(6),a=i(38),u=i(22),l=i(41),c=u.sugarNumber,f=o.round;t.exports=n},function(t,e,i){"use strict";function n(){var t=r("Today Yesterday Tomorrow Weekday Weekend Future Past"),e=l.weekdays.slice(0,7),i=l.months.slice(0,12),n=t.concat(e).concat(i);u(c,n,function(t,e){t["is"+e]=function(t){return o(t,e)}})}var s=i(7),r=i(43),o=i(86),a=i(22),u=i(41),l=s.English,c=a.sugarDate;t.exports=n},function(t,e,i){"use strict";function n(t,e,i,n){"ISOWeek"===e?r(t,i):s(t,e,i,n)}var s=i(32),r=i(96);t.exports=n},function(t,e,i){"use strict";function n(t){var e={},i=0;return o(a,function(n){var s=t[i++];r(s)&&(e[n.name]=s)}),e}var s=i(5),r=i(27),o=i(97),a=s.YEAR_INDEX;t.exports=n},function(t,e,i){"use strict";function n(t,e){var i=u();return e&&s(i,r(i)+e),o(t)===o(i)&&a(t)===a(i)&&r(t)===r(i)}var s=i(35),r=i(34),o=i(30),a=i(29),u=i(40);t.exports=n},function(t,e,i){"use strict";function n(){return new Date}t.exports=n},function(t,e,i){"use strict";function n(t,e){delete t[s(t,e)]}var s=i(88);t.exports=n},function(t,e,i){"use strict";function n(t,e){var i;return e||(e=s(),t>e&&(e=new Date(e.getTime()-10))),i=t-e,o(i,function(i){return u(a(t,e,i))})}var s=i(40),r=i(6),o=i(87),a=i(59),u=r.abs;t.exports=n},function(t,e,i){"use strict";function n(t){return o(t,function(e){return s(r(t/e.multiplier,1))})}var s=i(23),r=i(77),o=i(87);t.exports=n},function(t,e,i){"use strict";function n(t,e,i,n){var s;return i>1&&(s=t[e+(i-1)*n]),s||t[e]}t.exports=n},function(t,e,i){"use strict";function n(t,e){return o(t,s(t,e))}var s=i(88),r=i(10),o=r.getOwn;t.exports=n},function(t,e,i){"use strict";function n(t){var e,i,n={};return e=t.match(/^(-?\d*[\d.]\d*)?\s?(\w+?)s?$/i),e&&(s(i)&&(i=+e[1],isNaN(i)&&(i=1)),n[e[2].toLowerCase()]=i),n}var s=i(37);t.exports=n},function(t,e,i){"use strict";function n(t,e){return o(t,e,s[a])}var s=i(31),r=i(5),o=i(59),a=r.DAY_INDEX;t.exports=n},function(t,e,i){"use strict";function n(t){return t===r?o:t+1}var s=i(5),r=s.DAY_INDEX,o=s.MONTH_INDEX;t.exports=n},function(t,e,i){"use strict";function n(t,e){var i=o(t);return a.get(e).ampm[r(i/12)]||""}var s=i(7),r=i(23),o=i(90),a=s.localeManager;t.exports=n},function(t,e,i){"use strict";function n(t){function e(t){this.init(t)}return e.prototype={getMonthName:function(t,e){return this.monthSuffix?t+1+this.monthSuffix:x(this.months,t,e,12)},getWeekdayName:function(t,e){return x(this.weekdays,t,e,7)},getTokenValue:function(t,e){var i,n=this[t+"Map"];return n&&(i=n[e]),m(i)&&(i=this.getNumber(e),"month"===t&&(i-=1)),i},getNumber:function(t){var e=this.numeralMap[t];return h(e)?e:(e=+t.replace(/,/,"."),isNaN(e)?(e=this.getNumeralValue(t),isNaN(e)?e:(this.numeralMap[t]=e,e)):e)},getNumeralValue:function(t){var e,i,n,s,r,o=1,a=0;r=t.split("");for(var u=r.length-1;n=r[u];u--)s=N(this.numeralMap,n),m(s)&&(s=N(F,n)||0),i=s>0&&s%10===0,i?(e&&(a+=o),u?o=s:a+=s):(a+=s*o,o*=10),e=i;return a},getOrdinal:function(t){var e=this.ordinalSuffix;return e||v(t)},getRelativeFormat:function(t,e){return this.convertAdjustedToFormat(t,e)},getDuration:function(t){return this.convertAdjustedToFormat(T(D(0,t)),"duration")},getFirstDayOfWeek:function(){var t=this.firstDayOfWeek;return h(t)?t:I},getFirstDayOfWeekYear:function(){return this.firstDayOfWeekYear||R},convertAdjustedToFormat:function(t,e){var i,n,s,r=t[0],o=t[1],a=t[2],u=this[e]||this.relative;return A(u)?u.call(this,r,o,a,e):(s=this.plural&&1!==r?1:0,n=this.units[8*s+o]||this.units[o],i=this[a>0?"fromNow":"ago"],u.replace(/\{(.*?)\}/g,function(t,e){switch(e){case"num":return r;case"unit":return n;case"sign":return i}}))},cacheFormat:function(t,e){this.compiledFormats.splice(e,1),this.compiledFormats.unshift(t)},addFormat:function(t,e){function i(t){var i,r,a,u=t.match(/\?$/),l=t.match(/^(\d+)\??$/),f=t.match(/(\d)(?:-(\d))?/),h=t.replace(/[^a-z]+$/i,"");return(a=N(s.parsingAliases,h))?(r=n(a),u&&(r=
long:"{d} {month} {yyyy} {time}",full:"{weekday} {d} {month} {yyyy} {time}",stamp:"{dow} {d} {mon} {yyyy} {time}",time:"{H}:{mm}",past:"{sign} {num} {unit}",future:"{sign} {num} {unit}",duration:"{num} {unit}",timeMarkers:"à",ampm:"am,pm",modifiers:[{name:"day",src:"hier",value:-1},{name:"day",src:"aujourd'hui",value:0},{name:"day",src:"demain",value:1},{name:"sign",src:"il y a",value:-1},{name:"sign",src:"dans|d'ici",value:1},{name:"shift",src:"derni:èr|er|ère|ere",value:-1},{name:"shift",src:"prochain:|e",value:1}],parse:["{months} {year?}","{sign} {num} {unit}","{0?} {unit:5-7} {shift}"],timeParse:["{day|weekday} {shift?}","{weekday?},? {0?} {date}{1?} {months}\\.? {year?}"],timeFrontParse:["{0?} {weekday} {shift}","{weekday?},? {0?} {date}{1?} {months}\\.? {year?}"]})},function(t,e,i){"use strict";i(306),i(307),i(308),i(309),i(310),i(311),i(313),i(314),i(315),i(316),i(317),i(318),i(319),i(320),i(321),i(322),i(323),t.exports=i(0)},function(t,e,i){"use strict";var n=i(4);n("it",{plural:!0,units:"millisecond:o|i,second:o|i,minut:o|i,or:a|e,giorn:o|i,settiman:a|e,mes:e|i,ann:o|i",months:"gen:naio|,feb:braio|,mar:zo|,apr:ile|,mag:gio|,giu:gno|,lug:lio|,ago:sto|,set:tembre|,ott:obre|,nov:embre|,dic:embre|",weekdays:"dom:enica|,lun:edì||edi,mar:tedì||tedi,mer:coledì||coledi,gio:vedì||vedi,ven:erdì||erdi,sab:ato|",numerals:"zero,un:|a|o|',due,tre,quattro,cinque,sei,sette,otto,nove,dieci",tokens:"l'|la|il",short:"{dd}/{MM}/{yyyy}",medium:"{d} {month} {yyyy}",long:"{d} {month} {yyyy} {time}",full:"{weekday}, {d} {month} {yyyy} {time}",stamp:"{dow} {d} {mon} {yyyy} {time}",time:"{H}:{mm}",past:"{num} {unit} {sign}",future:"{num} {unit} {sign}",duration:"{num} {unit}",timeMarkers:"alle",ampm:"am,pm",modifiers:[{name:"day",src:"ieri",value:-1},{name:"day",src:"oggi",value:0},{name:"day",src:"domani",value:1},{name:"day",src:"dopodomani",value:2},{name:"sign",src:"fa",value:-1},{name:"sign",src:"da adesso",value:1},{name:"shift",src:"scors:o|a",value:-1},{name:"shift",src:"prossim:o|a",value:1}],parse:["{months} {year?}","{num} {unit} {sign}","{0?} {unit:5-7} {shift}","{0?} {shift} {unit:5-7}"],timeParse:["{shift?} {day|weekday}","{weekday?},? {date} {months?}\\.? {year?}"],timeFrontParse:["{shift?} {day|weekday}","{weekday?},? {date} {months?}\\.? {year?}"]})},function(t,e,i){"use strict";var n=i(4);n("ja",{ampmFront:!0,numeralUnits:!0,allowsFullWidth:!0,timeMarkerOptional:!0,firstDayOfWeek:0,firstDayOfWeekYear:1,units:"ミリ秒,秒,分,時間,日,週間|週,ヶ月|ヵ月|月,年|年度",weekdays:"日:曜日||曜,月:曜日||曜,火:曜日||曜,水:曜日||曜,木:曜日||曜,金:曜日||曜,土:曜日||曜",numerals:",一,二,三,四,五,六,七,八,九",placeholders:"十,百,千,万",timeSuffixes:",秒,分,時,日,,月,年度?",short:"{yyyy}/{MM}/{dd}",medium:"{yyyy}年{M}月{d}日",long:"{yyyy}年{M}月{d}日{time}",full:"{yyyy}年{M}月{d}日{time} {weekday}",stamp:"{yyyy}年{M}月{d}日 {H}:{mm} {dow}",time:"{tt}{h}時{mm}分",past:"{num}{unit}{sign}",future:"{num}{unit}{sign}",duration:"{num}{unit}",ampm:"午前,午後",modifiers:[{name:"day",src:"一昨々日|前々々日",value:-3},{name:"day",src:"一昨日|おととい|前々日",value:-2},{name:"day",src:"昨日|前日",value:-1},{name:"day",src:"今日|当日|本日",value:0},{name:"day",src:"明日|翌日|次日",value:1},{name:"day",src:"明後日|翌々日",value:2},{name:"day",src:"明々後日|翌々々日",value:3},{name:"sign",src:"前",value:-1},{name:"sign",src:"後",value:1},{name:"edge",src:"始|初日|頭",value:-2},{name:"edge",src:"末|尻",value:2},{name:"edge",src:"末日",value:1},{name:"shift",src:"一昨々|前々々",value:-3},{name:"shift",src:"一昨|前々|先々",value:-2},{name:"shift",src:"先|昨|去|前",value:-1},{name:"shift",src:"今|本|当",value:0},{name:"shift",src:"来|明|翌|次",value:1},{name:"shift",src:"明後|翌々|次々|再来|さ来",value:2},{name:"shift",src:"明々後|翌々々",value:3}],parse:["{month}{edge}","{num}{unit}{sign}","{year?}{month}","{year}"],timeParse:["{day|weekday}","{shift}{unit:5}{weekd
2016-12-24 13:35:26 +01:00
//# sourceMappingURL=tablefilter.js.map