<commit_before>!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.VueTables=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports={get:function(){return Math.ceil(this.page/this.options.pagination.chunk)}}},{}],2:[function(require,module,exports){module.exports={get:function(){return(this.currentChunk-1)*this.options.pagination.chunk+1}}},{}],3:[function(require,module,exports){module.exports=function(){return this.options.filterByColumn?JSON.stringify(this.query):this.query}},{}],4:[function(require,module,exports){module.exports={get:function(){return Math.ceil(this.totalPages/this.options.pagination.chunk)}}},{}],5:[function(require,module,exports){module.exports={get:function(){return Math.ceil(this.count/this.limit)}}},{}],6:[function(require,module,exports){module.exports=function(){return function(){return{columns:[],perPage:10,sortable:[],templates:{},delay:500,dateFormat:"",skin:"table-striped table-bordered table-hover",texts:{count:"{count} Records",filter:"Filter Results:",filterPlaceholder:"Search query",limit:"Records:",page:"Page:",noResults:"No matching records",filterBy:"Filter by {column}"},filterByColumn:!1,highlightMatches:!1,headings:{},pagination:{dropdown:!1,chunk:10}}}}},{}],7:[function(require,module,exports){module.exports=function(property,format){if(!(property instanceof Date))return property;var formatter=require("dateformat");return format=format?format:this.options.dateFormat,formatter(property,format)}},{dateformat:40}],8:[function(require,module,exports){module.exports=function(property,column){if(!this.options.highlightMatches||this.templatesKeys.indexOf(column)>-1)return property;var query=this.options.filterByColumn?this.query[column]:this.query;return query?(query=new RegExp(query,"i"),property=String(property).replace(query,function(highlight){return"<b class='VueTables__highlight'>"+highlight+"</b>"})):property}},{}],9:[function(require,module,exports){module.exports=function(data){var limit=parseInt(this.limit),page=parseInt(this.page),offset=limit*(page-1);return data.slice(offset,limit+offset)}},{}],10:[function(require,module,exports){module.exports=function(value,row,column){if(-1==$.inArray(column,this.templatesKeys))return value;var regex,template=this.options.templates[column];return this.allColumns.forEach(function(col){regex=new RegExp("{"+col+"}","g"),template=template.replace(regex,String(row[col]))}.bind(this)),template}},{}],11:[function(require,module,exports){var object_filled_keys_count=require("../helpers/object-filled-keys-count");module.exports=function(data,query){var totalQueries=query?1:0;if(this.options.filterByColumn&&(query=JSON.parse(query),totalQueries=object_filled_keys_count(query)),!totalQueries)return data;var value,found,currentQuery;return data.filter(function(row,index){return found=0,this.queryable.forEach(function(column){value=String(row[column]).toLowerCase(),currentQuery=this.options.filterByColumn?query[column]:query,currentQuery=currentQuery.toLowerCase(),currentQuery&&value.indexOf(currentQuery)>-1&&found++}.bind(this)),found==totalQueries}.bind(this))}},{"../helpers/object-filled-keys-count":15}],12:[function(require,module,exports){module.exports=function(data){return this.count=data.length,data}},{}],13:[function(require,module,exports){module.exports=function(a){return this.filter(function(i){return a.indexOf(i)<0})}},{}],14:[function(require,module,exports){module.exports=function(replacements){var template='<div class="VueTables VueTables--[[source]]"> <div class="row"> <div class="col-md-6"> <div v-if="!options.filterByColumn" class="form-group form-inline pull-left VueTables__search"> <label>{{display(\'filter\')}}</label> <input class="form-control" type="text" placeholder="{{display(\'filterPlaceholder\')}}" @keyup="search()" v-model="query"/> </div></div><div class="col-md-6"> <div v-if="options.pagination && options.pagination.dropdown && totalPages>0" class="form-group form-inline pull-right VueTables__dropdown-pagination"> <label>{{display(\'page\')}}</label> <select class="form-control" v-model="page" @change="setPage(page)"> <option v-for="page in totalPages">{{page+1}}</option> </select> </div><div class="form-group form-inline pull-right VueTables__limit"> <label>{{display(\'limit\')}}</label> <select class="form-control" v-model="limit" @change="setPage(1)" > <option v-for="length in lengths">{{length}}</option> </select> </div></div></div><table class="VueTables__table table" v-bind:class="options.skin"> <thead> <tr> <th @click="orderByColumn(column)" v-for="column in columns"><span class="VueTables__heading">{{getHeading(column)}}</span> <span class="VueTables__sort-icon glyphicon" v-bind:class="orderClass(column)"></span></th> </tr><tr v-if="options.filterByColumn" class="VueTables__filters-row"> <th v-for="column in columns"> <input @keyup="search()" v-if="extras.indexOf(column)==-1" class="form-control" type="text" placeholder="{{display(\'filterBy\',getHeading(column))}}" v-model="query[column]"> </th> </tr></thead><tbody> <tr v-for="row in data [[rowFilters]]" [[trackBy]]> <td v-for="column in columns" v-html="row[column] | render row column [[columnFilters]]"></td></tr><tr v-if="count==0"class="VueTables__no-results"><td class="text-center"colspan="{{columns.length}}">{{display(\'noResults\')}}</td></tr></tbody></table><ul v-show="totalPages>1" v-if="options.pagination && !options.pagination.dropdown" class="pagination VueTables__pagination"> <li class="VueTables__pagination-item VueTables__pagination-item-prev-chunk" v-bind:class="chunkNavDisabled(-1)?\'disabled\':\'\'"> <a href="javascript:void(0);" @click="!chunkNavDisabled(-1) && chunk(-1)"><<</a></li><li class="VueTables__pagination-item VueTables__pagination-item-prev-page"v-bind:class="pageNavDisabled(-1)?\'disabled\':\'\'"><a href="javascript:void(0);"@click="!pageNavDisabled(-1) && setPage(page-1)"><</a></li><li class="VueTables__pagination-item"v-for="page in options.pagination.chunk"v-if="paginationStart + $index <=totalPages"v-bind:class="active(paginationStart + $index - 1)"><a href="javascript:void(0);"@click="setPage(paginationStart + $index)">{{paginationStart + $index}}</a></li><li class="VueTables__pagination-item VueTables__pagination-item-next-page"v-bind:class="pageNavDisabled(1)?\'disabled\':\'\'"><a href="javascript:void(0);"@click="!pageNavDisabled(1) && setPage(page+1)">></a></li><li class="VueTables__pagination-item VueTables__pagination-item-next-chunk"v-bind:class="chunkNavDisabled(1)?\'disabled\':\'\'"><a href="javascript:void(0);"@click="!chunkNavDisabled(1) && chunk(1)">>></a></li></ul><p v-if="count!=0"class="VueTables__count">{{display(\'count\', count)}}</p></div>';for(var replacement in replacements)template=template.replace("[["+replacement+"]]",replacements[replacement]);return template}},{}],15:[function(require,module,exports){module.exports=function(obj){var count=0;for(var prop in obj)obj[prop].trim()&&count++;return count}},{}],16:[function(require,module,exports){module.exports=function(obj){var keys=[];for(var prop in obj)keys.push(prop);return keys}},{}],17:[function(require,module,exports){module.exports=function(){return this.charAt(0).toUpperCase()+this.slice(1)}},{}],18:[function(require,module,exports){module.exports=function(index){return this.page==index+1?"active":""}},{}],19:[function(require,module,exports){module.exports=function(){return this.data.forEach(function(row,index){this.extras.forEach(function(extra){this.$set("data["+index+"]."+extra,this.options.templates[extra])}.bind(this))}.bind(this)),this.data}},{}],20:[function(require,module,exports){module.exports=function(direction){return 1==direction&&this.currentChunk==this.totalChunks||-1==direction&&1==this.currentChunk}},{}],21:[function(require,module,exports){module.exports=function(direction){var page=(this.currentChunk-1+direction)*this.options.pagination.chunk+1;this.setPage(page)}},{}],22:[function(require,module,exports){module.exports=function(text,value){if(!this.options.texts)return"";var text=this.options.texts[text];return text&&value&&(text=text.replace(/{.+}/,value)),text}},{}],23:[function(require,module,exports){module.exports=function(){var data={query:this.query,limit:this.limit,orderBy:this.orderBy,ascending:this.ascending,page:this.page,byColumn:this.options.filterByColumn?1:0};this.$dispatch("vue-tables.loading",data);var data=$.param(data);return $.ajax({url:this.url,dataType:"json",data:data})}},{}],24:[function(require,module,exports){module.exports=function(value){return this.options.headings.hasOwnProperty(value)?this.options.headings[value]:value.split("_").join(" ").ucfirst()}},{}],25:[function(require,module,exports){module.exports=function(){if(!this.options.columns.length)return this.allColumns;var queryable=this.allColumns.filter(function(n){return-1!=this.options.columns.indexOf(n)}.bind(this));return queryable.length?queryable:this.allColumns}},{}],26:[function(require,module,exports){module.exports=function(queryable){if(!this.options.filterByColumn)return"";var query={};return queryable.forEach(function(column){query[column]=""}.bind(this)),query}},{}],27:[function(require,module,exports){module.exports=function(colName){this.sortable(colName)&&(colName==this.orderBy&&(this.ascending=1==this.ascending?-1:1),this.orderBy=colName,"server"==this.source&&this.getData().done(function(data){this.setData(data)}.bind(this)))}},{}],28:[function(require,module,exports){module.exports=function(column){return this.sortable(column)?column!=this.orderBy?"":1==this.ascending?"glyphicon-chevron-up":"glyphicon-chevron-down":void 0}},{}],29:[function(require,module,exports){module.exports=function(direction){return 1==direction&&this.page==this.totalPages||-1==direction&&1==this.page}},{}],30:[function(require,module,exports){module.exports=function(){this.search(this.byColumn)}},{}],31:[function(require,module,exports){module.exports=function(){if("client"==this.source)return void(this.page=1);var elapsed;this.lastKeyStrokeAt=new Date,setTimeout(function(){elapsed=new Date-this.lastKeyStrokeAt,elapsed>=this.options.delay&&(this.page=1,this.loading=!0,this.getData().done(function(data){this.setData(data),this.loading=!1}.bind(this)))}.bind(this),this.options.delay)}},{}],32:[function(require,module,exports){module.exports=function(data){this.data=data.data,this.count=data.count,this.addExtras(),setTimeout(function(){this.$dispatch("vue-tables.loaded",data)}.bind(this),0)}},{}],33:[function(require,module,exports){module.exports=function(page){this.page=page,"server"==this.source&&this.getData().done(function(data){this.setData(data)}.bind(this))}},{}],34:[function(require,module,exports){module.exports=function(column){var isExtra=this.extras.indexOf(column)>-1;if(isExtra)return!1;var sortAll=!this.options.sortable.length;return sortAll?!0:this.options.sortable.indexOf(column)>-1}},{}],35:[function(require,module,exports){module.exports={computed:{totalPages:require("../computed/total-pages"),paginationStart:require("../computed/pagination-start"),totalChunks:require("../computed/total-chunks"),currentChunk:require("../computed/current-chunk")}}},{"../computed/current-chunk":1,"../computed/pagination-start":2,"../computed/total-chunks":4,"../computed/total-pages":5}],36:[function(require,module,exports){module.exports={filters:{render:require("../filters/render"),highlightMatches:require("../filters/highlight-matches")}}},{"../filters/highlight-matches":8,"../filters/render":10}],37:[function(require,module,exports){module.exports={methods:{initQuery:require("../methods/init-query"),active:require("../methods/active"),orderClass:require("../methods/order-class"),display:require("../methods/display"),orderByColumn:require("../methods/order-by-column"),getHeading:require("../methods/get-heading"),setPage:require("../methods/set-page"),addExtras:require("../methods/add-extras"),sortable:require("../methods/sortable"),chunk:require("../methods/chunk"),pageNavDisabled:require("../methods/page-nav-disabled"),chunkNavDisabled:require("../methods/chunk-nav-disabled"),display:require("../methods/display"),search:require("../methods/search")}}},{"../methods/active":18,"../methods/add-extras":19,"../methods/chunk":21,"../methods/chunk-nav-disabled":20,"../methods/display":22,"../methods/get-heading":24,"../methods/init-query":26,"../methods/order-by-column":27,"../methods/order-class":28,"../methods/page-nav-disabled":29,"../methods/search":31,"../methods/set-page":33,"../methods/sortable":34}],38:[function(require,module,exports){var object_keys=require("./helpers/object-keys"),defaults=require("./config/defaults")(),methods=require("./mixins/methods"),computed=require("./mixins/computed"),filters=require("./mixins/filters"),template=require("./helpers/generate-table-html");exports.install=function(Vue,globalOptions){var client={template:template({source:"client",rowFilters:"| search q | orderBy orderBy ascending | setCount | page",trackBy:'track-by="id"',columnFilters:"| date | highlightMatches column"}),mixins:[methods,computed,filters],props:{data:{type:Array,required:!0},options:{type:Object,required:!1,"default":function(){return{}}}},ready:function(){this.source="client",this.defaults=defaults(),globalOptions&&(this.defaults=$.extend(!0,this.defaults,globalOptions)),this.options=$.extend(!0,this.defaults,this.options),this.lengths.indexOf(this.options.perPage)>-1&&(this.limit=this.options.perPage),this.allColumns=object_keys(this.data[0]),this.queryable=this.getQueryableColumns(),this.query=this.initQuery(this.queryable),this.templatesKeys=object_keys(this.options.templates),this.extras=this.templatesKeys.diff(this.allColumns),this.columns=this.queryable.concat(this.extras),this.data=this.addExtras(),this.orderBy=this.columns[0],this.count=this.data.length},data:function(){return{source:null,columns:[],allColumns:!1,totalPages:null,lengths:[5,10,20,50],ascending:1,orderBy:null,query:null,page:1,count:0,limit:10,queryable:[]}},computed:{q:require("./computed/q")},filters:{page:require("./filters/page"),setCount:require("./filters/set-count"),date:require("./filters/date"),search:require("./filters/search")},methods:{getQueryableColumns:require("./methods/get-queryable-columns")}};Vue.component("v-client-table",client)}},{"./computed/q":3,"./config/defaults":6,"./filters/date":7,"./filters/page":9,"./filters/search":11,"./filters/set-count":12,"./helpers/generate-table-html":14,"./helpers/object-keys":16,"./methods/get-queryable-columns":25,"./mixins/computed":35,"./mixins/filters":36,"./mixins/methods":37}],39:[function(require,module,exports){var object_keys=require("./helpers/object-keys"),defaults=require("./config/defaults")(),methods=require("./mixins/methods"),computed=require("./mixins/computed"),filters=require("./mixins/filters"),template=require("./helpers/generate-table-html");exports.install=function(Vue,globalOptions){var server={template:template({source:"server",rowFilters:"",trackBy:"",columnFilters:"| highlightMatches column"}),mixins:[methods,computed,filters],props:{url:{type:String,required:!0},options:{type:Object,required:!1,"default":function(){return{}}}},ready:function(){this.source="server",this.defaults=defaults(),globalOptions&&(this.defaults=$.extend(!0,this.defaults,globalOptions)),this.options=$.extend(!0,this.defaults,this.options),this.lengths.indexOf(this.options.perPage)>-1&&(this.limit=this.options.perPage),this.getData().done(function(data){return data.count||this.options.columns.length?(this.allColumns=object_keys(data.data[0]),this.columns=this.options.columns.length?this.options.columns:this.allColumns,this.query=this.initQuery(this.columns),this.templatesKeys=object_keys(this.options.templates),this.extras=this.templatesKeys?this.templatesKeys.diff(this.columns):[],this.columns=this.columns.concat(this.extras),this.orderBy=this.columns[0],void this.setData(data)):void console.error("vue-tables: unable to set column names. No results returned from server upon first request. Please declare the columns excplicitly.")}.bind(this))},data:function(){return{data:[],source:null,columns:[],allColumns:!1,totalPages:null,lengths:[5,10,20,50],ascending:1,orderBy:null,query:null,page:1,count:0,limit:10,countTemplate:"{count} Records",lastKeyStrokeAt:!1,loading:!1}},methods:{refresh:require("./methods/refresh"),getData:require("./methods/get-data"),setData:require("./methods/set-data")}};Vue.component("v-server-table",server)}},{"./config/defaults":6,"./helpers/generate-table-html":14,"./helpers/object-keys":16,"./methods/get-data":23,"./methods/refresh":30,"./methods/set-data":32,"./mixins/computed":35,"./mixins/filters":36,"./mixins/methods":37}],40:[function(require,module,exports){!function(global){"use strict";function pad(val,len){for(val=String(val),len=len||2;val.length<len;)val="0"+val;return val}function getWeek(date){var targetThursday=new Date(date.getFullYear(),date.getMonth(),date.getDate());targetThursday.setDate(targetThursday.getDate()-(targetThursday.getDay()+6)%7+3);var firstThursday=new Date(targetThursday.getFullYear(),0,4);firstThursday.setDate(firstThursday.getDate()-(firstThursday.getDay()+6)%7+3);var ds=targetThursday.getTimezoneOffset()-firstThursday.getTimezoneOffset();targetThursday.setHours(targetThursday.getHours()-ds);var weekDiff=(targetThursday-firstThursday)/6048e5;return 1+Math.floor(weekDiff)}function getDayOfWeek(date){var dow=date.getDay();return 0===dow&&(dow=7),dow}function kindOf(val){return null===val?"null":void 0===val?"undefined":"object"!=typeof val?typeof val:Array.isArray(val)?"array":{}.toString.call(val).slice(8,-1).toLowerCase()}var dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g;return function(date,mask,utc,gmt){if(1!==arguments.length||"string"!==kindOf(date)||/\d/.test(date)||(mask=date,date=void 0),date=date||new Date,date instanceof Date||(date=new Date(date)),isNaN(date))throw TypeError("Invalid date");mask=String(dateFormat.masks[mask]||mask||dateFormat.masks["default"]);var maskSlice=mask.slice(0,4);("UTC:"===maskSlice||"GMT:"===maskSlice)&&(mask=mask.slice(4),utc=!0,"GMT:"===maskSlice&&(gmt=!0));var _=utc?"getUTC":"get",d=date[_+"Date"](),D=date[_+"Day"](),m=date[_+"Month"](),y=date[_+"FullYear"](),H=date[_+"Hours"](),M=date[_+"Minutes"](),s=date[_+"Seconds"](),L=date[_+"Milliseconds"](),o=utc?0:date.getTimezoneOffset(),W=getWeek(date),N=getDayOfWeek(date),flags={d:d,dd:pad(d),ddd:dateFormat.i18n.dayNames[D],dddd:dateFormat.i18n.dayNames[D+7],m:m+1,mm:pad(m+1),mmm:dateFormat.i18n.monthNames[m],mmmm:dateFormat.i18n.monthNames[m+12],yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(Math.round(L/10)),t:12>H?"a":"p",tt:12>H?"am":"pm",T:12>H?"A":"P",TT:12>H?"AM":"PM",Z:gmt?"GMT":utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(100*Math.floor(Math.abs(o)/60)+Math.abs(o)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10],W:W,N:N};return mask.replace(token,function(match){return match in flags?flags[match]:match.slice(1,match.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},"function"==typeof define&&define.amd?define(function(){return dateFormat}):"object"==typeof exports?module.exports=dateFormat:global.dateFormat=dateFormat}(this)},{}],41:[function(require,module,exports){String.prototype.ucfirst=require("./lib/helpers/ucfirst"),Array.prototype.diff=require("./lib/helpers/array-diff"),exports.client=require("./lib/v-client-table"),exports.server=require("./lib/v-server-table")},{"./lib/helpers/array-diff":13,"./lib/helpers/ucfirst":17,"./lib/v-client-table":38,"./lib/v-server-table":39}]},{},[41])(41)});<commit_msg>build min<commit_after>!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.VueTables=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports={get:function(){return Math.ceil(this.page/this.options.pagination.chunk)}}},{}],2:[function(require,module,exports){module.exports={get:function(){return(this.currentChunk-1)*this.options.pagination.chunk+1}}},{}],3:[function(require,module,exports){module.exports=function(){return this.options.filterByColumn?JSON.stringify(this.query):this.query}},{}],4:[function(require,module,exports){module.exports={get:function(){return Math.ceil(this.totalPages/this.options.pagination.chunk)}}},{}],5:[function(require,module,exports){module.exports={get:function(){return Math.ceil(this.count/this.limit)}}},{}],6:[function(require,module,exports){module.exports=function(){return function(){return{columns:[],perPage:10,sortable:[],templates:{},delay:500,dateFormat:"",skin:"table-striped table-bordered table-hover",texts:{count:"{count} Records",filter:"Filter Results:",filterPlaceholder:"Search query",limit:"Records:",page:"Page:",noResults:"No matching records",filterBy:"Filter by {column}"},filterByColumn:!1,highlightMatches:!1,headings:{},pagination:{dropdown:!1,chunk:10}}}}},{}],7:[function(require,module,exports){module.exports=function(property,format){if(!(property instanceof Date))return property;var formatter=require("dateformat");return format=format?format:this.options.dateFormat,formatter(property,format)}},{dateformat:41}],8:[function(require,module,exports){module.exports=function(property,column){if(!this.options.highlightMatches||this.templatesKeys.indexOf(column)>-1)return property;var query=this.options.filterByColumn?this.query[column]:this.query;return query?(query=new RegExp(query,"i"),property=String(property).replace(query,function(highlight){return"<b class='VueTables__highlight'>"+highlight+"</b>"})):property}},{}],9:[function(require,module,exports){module.exports=function(data){var limit=parseInt(this.limit),page=parseInt(this.page),offset=limit*(page-1);return data.slice(offset,limit+offset)}},{}],10:[function(require,module,exports){module.exports=function(value,row,column){if(-1==$.inArray(column,this.templatesKeys))return value;var regex,template=this.options.templates[column];return this.allColumns.forEach(function(col){regex=new RegExp("{"+col+"}","g"),template=template.replace(regex,String(row[col]))}.bind(this)),template}},{}],11:[function(require,module,exports){var object_filled_keys_count=require("../helpers/object-filled-keys-count");module.exports=function(data,query){var totalQueries=query?1:0;if(this.options.filterByColumn&&(query=JSON.parse(query),totalQueries=object_filled_keys_count(query)),!totalQueries)return data;var value,found,currentQuery;return data.filter(function(row,index){return found=0,this.queryable.forEach(function(column){value=String(row[column]).toLowerCase(),currentQuery=this.options.filterByColumn?query[column]:query,currentQuery=currentQuery.toLowerCase(),currentQuery&&value.indexOf(currentQuery)>-1&&found++}.bind(this)),found==totalQueries}.bind(this))}},{"../helpers/object-filled-keys-count":15}],12:[function(require,module,exports){module.exports=function(data){return this.count=data.length,data}},{}],13:[function(require,module,exports){module.exports=function(a){return this.filter(function(i){return a.indexOf(i)<0})}},{}],14:[function(require,module,exports){module.exports=function(replacements){var template='<div class="VueTables VueTables--[[source]]"> <div class="row"> <div class="col-md-6"> <div v-if="!options.filterByColumn" class="form-group form-inline pull-left VueTables__search"> <label>{{display(\'filter\')}}</label> <input class="form-control" type="text" placeholder="{{display(\'filterPlaceholder\')}}" @keyup="search()" v-model="query"/> </div></div><div class="col-md-6"> <div v-if="options.pagination && options.pagination.dropdown && totalPages>0" class="form-group form-inline pull-right VueTables__dropdown-pagination"> <label>{{display(\'page\')}}</label> <select class="form-control" v-model="page" @change="setPage(page)"> <option v-for="page in totalPages">{{page+1}}</option> </select> </div><div class="form-group form-inline pull-right VueTables__limit"> <label>{{display(\'limit\')}}</label> <select class="form-control" v-model="limit" @change="setPage(1)" > <option v-for="length in lengths">{{length}}</option> </select> </div></div></div><table class="VueTables__table table" v-bind:class="options.skin"> <thead> <tr> <th @click="orderByColumn(column)" v-for="column in columns" v-bind:class="sortableClass(column)"><span class="VueTables__heading">{{getHeading(column)}}</span> <span v-if="sortable(column)" class="VueTables__sort-icon glyphicon" v-bind:class="sortableChevronClass(column)"></span></th> </tr><tr v-if="options.filterByColumn" class="VueTables__filters-row"> <th v-for="column in columns"> <input @keyup="search()" v-if="extras.indexOf(column)==-1" class="form-control" type="text" placeholder="{{display(\'filterBy\',getHeading(column))}}" v-model="query[column]"> </th> </tr></thead><tbody> <tr v-for="row in data [[rowFilters]]" [[trackBy]]> <td v-for="column in columns" v-html="row[column] | render row column [[columnFilters]]"></td></tr><tr v-if="count==0"class="VueTables__no-results"><td class="text-center"colspan="{{columns.length}}">{{display(\'noResults\')}}</td></tr></tbody></table><ul v-show="totalPages>1" v-if="options.pagination && !options.pagination.dropdown" class="pagination VueTables__pagination"> <li class="VueTables__pagination-item VueTables__pagination-item-prev-chunk" v-bind:class="chunkNavDisabled(-1)?\'disabled\':\'\'"> <a href="javascript:void(0);" @click="!chunkNavDisabled(-1) && chunk(-1)"><<</a></li><li class="VueTables__pagination-item VueTables__pagination-item-prev-page"v-bind:class="pageNavDisabled(-1)?\'disabled\':\'\'"><a href="javascript:void(0);"@click="!pageNavDisabled(-1) && setPage(page-1)"><</a></li><li class="VueTables__pagination-item"v-for="page in options.pagination.chunk"v-if="paginationStart + $index <=totalPages"v-bind:class="active(paginationStart + $index - 1)"><a href="javascript:void(0);"@click="setPage(paginationStart + $index)">{{paginationStart + $index}}</a></li><li class="VueTables__pagination-item VueTables__pagination-item-next-page"v-bind:class="pageNavDisabled(1)?\'disabled\':\'\'"><a href="javascript:void(0);"@click="!pageNavDisabled(1) && setPage(page+1)">></a></li><li class="VueTables__pagination-item VueTables__pagination-item-next-chunk"v-bind:class="chunkNavDisabled(1)?\'disabled\':\'\'"><a href="javascript:void(0);"@click="!chunkNavDisabled(1) && chunk(1)">>></a></li></ul><p v-if="count!=0"class="VueTables__count">{{display(\'count\', count)}}</p></div>';for(var replacement in replacements)template=template.replace("[["+replacement+"]]",replacements[replacement]);return template}},{}],15:[function(require,module,exports){module.exports=function(obj){var count=0;for(var prop in obj)obj[prop].trim()&&count++;return count}},{}],16:[function(require,module,exports){module.exports=function(obj){var keys=[];for(var prop in obj)keys.push(prop);return keys}},{}],17:[function(require,module,exports){module.exports=function(){return this.charAt(0).toUpperCase()+this.slice(1)}},{}],18:[function(require,module,exports){module.exports=function(index){return this.page==index+1?"active":""}},{}],19:[function(require,module,exports){module.exports=function(){return this.data.forEach(function(row,index){this.extras.forEach(function(extra){this.$set("data["+index+"]."+extra,this.options.templates[extra])}.bind(this))}.bind(this)),this.data}},{}],20:[function(require,module,exports){module.exports=function(direction){return 1==direction&&this.currentChunk==this.totalChunks||-1==direction&&1==this.currentChunk}},{}],21:[function(require,module,exports){module.exports=function(direction){var page=(this.currentChunk-1+direction)*this.options.pagination.chunk+1;this.setPage(page)}},{}],22:[function(require,module,exports){module.exports=function(text,value){if(!this.options.texts)return"";var text=this.options.texts[text];return text&&value&&(text=text.replace(/{.+}/,value)),text}},{}],23:[function(require,module,exports){module.exports=function(){var data={query:this.query,limit:this.limit,orderBy:this.orderBy,ascending:this.ascending,page:this.page,byColumn:this.options.filterByColumn?1:0};this.$dispatch("vue-tables.loading",data);var data=$.param(data);return $.ajax({url:this.url,dataType:"json",data:data})}},{}],24:[function(require,module,exports){module.exports=function(value){return this.options.headings.hasOwnProperty(value)?this.options.headings[value]:value.split("_").join(" ").ucfirst()}},{}],25:[function(require,module,exports){module.exports=function(){if(!this.options.columns.length)return this.allColumns;var queryable=this.allColumns.filter(function(n){return-1!=this.options.columns.indexOf(n)}.bind(this));return queryable.length?queryable:this.allColumns}},{}],26:[function(require,module,exports){module.exports=function(queryable){if(!this.options.filterByColumn)return"";var query={};return queryable.forEach(function(column){query[column]=""}.bind(this)),query}},{}],27:[function(require,module,exports){module.exports=function(colName){this.sortable(colName)&&(colName==this.orderBy&&(this.ascending=1==this.ascending?-1:1),this.orderBy=colName,"server"==this.source&&this.getData().done(function(data){this.setData(data)}.bind(this)))}},{}],28:[function(require,module,exports){module.exports=function(direction){return 1==direction&&this.page==this.totalPages||-1==direction&&1==this.page}},{}],29:[function(require,module,exports){module.exports=function(){this.search(this.byColumn)}},{}],30:[function(require,module,exports){module.exports=function(){if("client"==this.source)return void(this.page=1);var elapsed;this.lastKeyStrokeAt=new Date,setTimeout(function(){elapsed=new Date-this.lastKeyStrokeAt,elapsed>=this.options.delay&&(this.page=1,this.loading=!0,this.getData().done(function(data){this.setData(data),this.loading=!1}.bind(this)))}.bind(this),this.options.delay)}},{}],31:[function(require,module,exports){module.exports=function(data){this.data=data.data,this.count=data.count,this.addExtras(),setTimeout(function(){this.$dispatch("vue-tables.loaded",data)}.bind(this),0)}},{}],32:[function(require,module,exports){module.exports=function(page){this.page=page,"server"==this.source&&this.getData().done(function(data){this.setData(data)}.bind(this))}},{}],33:[function(require,module,exports){module.exports=function(column){return this.sortable(column)?column!=this.orderBy?"":1==this.ascending?"glyphicon-chevron-up":"glyphicon-chevron-down":void 0}},{}],34:[function(require,module,exports){module.exports=function(column){return this.sortable(column)?"VueTables__sortable":""}},{}],35:[function(require,module,exports){module.exports=function(column){var isExtra=this.extras.indexOf(column)>-1;if(isExtra)return!1;var sortAll=!this.options.sortable.length;return sortAll?!0:this.options.sortable.indexOf(column)>-1}},{}],36:[function(require,module,exports){module.exports={computed:{totalPages:require("../computed/total-pages"),paginationStart:require("../computed/pagination-start"),totalChunks:require("../computed/total-chunks"),currentChunk:require("../computed/current-chunk")}}},{"../computed/current-chunk":1,"../computed/pagination-start":2,"../computed/total-chunks":4,"../computed/total-pages":5}],37:[function(require,module,exports){module.exports={filters:{render:require("../filters/render"),highlightMatches:require("../filters/highlight-matches")}}},{"../filters/highlight-matches":8,"../filters/render":10}],38:[function(require,module,exports){module.exports={methods:{initQuery:require("../methods/init-query"),active:require("../methods/active"),sortableClass:require("../methods/sortable-class"),sortableChevronClass:require("../methods/sortable-chevron-class"),display:require("../methods/display"),orderByColumn:require("../methods/order-by-column"),getHeading:require("../methods/get-heading"),setPage:require("../methods/set-page"),addExtras:require("../methods/add-extras"),sortable:require("../methods/sortable"),chunk:require("../methods/chunk"),pageNavDisabled:require("../methods/page-nav-disabled"),chunkNavDisabled:require("../methods/chunk-nav-disabled"),display:require("../methods/display"),search:require("../methods/search")}}},{"../methods/active":18,"../methods/add-extras":19,"../methods/chunk":21,"../methods/chunk-nav-disabled":20,"../methods/display":22,"../methods/get-heading":24,"../methods/init-query":26,"../methods/order-by-column":27,"../methods/page-nav-disabled":28,"../methods/search":30,"../methods/set-page":32,"../methods/sortable":35,"../methods/sortable-chevron-class":33,"../methods/sortable-class":34}],39:[function(require,module,exports){var object_keys=require("./helpers/object-keys"),defaults=require("./config/defaults")(),methods=require("./mixins/methods"),computed=require("./mixins/computed"),filters=require("./mixins/filters"),template=require("./helpers/generate-table-html");exports.install=function(Vue,globalOptions){var client={template:template({source:"client",rowFilters:"| search q | orderBy orderBy ascending | setCount | page",trackBy:'track-by="id"',columnFilters:"| date | highlightMatches column"}),mixins:[methods,computed,filters],props:{data:{type:Array,required:!0},options:{type:Object,required:!1,"default":function(){return{}}}},ready:function(){this.source="client",this.defaults=defaults(),globalOptions&&(this.defaults=$.extend(!0,this.defaults,globalOptions)),this.options=$.extend(!0,this.defaults,this.options),this.lengths.indexOf(this.options.perPage)>-1&&(this.limit=this.options.perPage),this.allColumns=object_keys(this.data[0]),this.queryable=this.getQueryableColumns(),this.query=this.initQuery(this.queryable),this.templatesKeys=object_keys(this.options.templates),this.extras=this.templatesKeys.diff(this.allColumns),this.columns=this.queryable.concat(this.extras),this.data=this.addExtras(),this.orderBy=this.columns[0],this.count=this.data.length},data:function(){return{source:null,columns:[],allColumns:!1,totalPages:null,lengths:[5,10,20,50],ascending:1,orderBy:null,query:null,page:1,count:0,limit:10,queryable:[]}},computed:{q:require("./computed/q")},filters:{page:require("./filters/page"),setCount:require("./filters/set-count"),date:require("./filters/date"),search:require("./filters/search")},methods:{getQueryableColumns:require("./methods/get-queryable-columns")}};Vue.component("v-client-table",client)}},{"./computed/q":3,"./config/defaults":6,"./filters/date":7,"./filters/page":9,"./filters/search":11,"./filters/set-count":12,"./helpers/generate-table-html":14,"./helpers/object-keys":16,"./methods/get-queryable-columns":25,"./mixins/computed":36,"./mixins/filters":37,"./mixins/methods":38}],40:[function(require,module,exports){var object_keys=require("./helpers/object-keys"),defaults=require("./config/defaults")(),methods=require("./mixins/methods"),computed=require("./mixins/computed"),filters=require("./mixins/filters"),template=require("./helpers/generate-table-html");exports.install=function(Vue,globalOptions){var server={template:template({source:"server",rowFilters:"",trackBy:"",columnFilters:"| highlightMatches column"}),mixins:[methods,computed,filters],props:{url:{type:String,required:!0},options:{type:Object,required:!1,"default":function(){return{}}}},ready:function(){this.source="server",this.defaults=defaults(),globalOptions&&(this.defaults=$.extend(!0,this.defaults,globalOptions)),this.options=$.extend(!0,this.defaults,this.options),this.lengths.indexOf(this.options.perPage)>-1&&(this.limit=this.options.perPage),this.getData().done(function(data){return data.count||this.options.columns.length?(this.allColumns=object_keys(data.data[0]),this.columns=this.options.columns.length?this.options.columns:this.allColumns,this.query=this.initQuery(this.columns),this.templatesKeys=object_keys(this.options.templates),this.extras=this.templatesKeys?this.templatesKeys.diff(this.columns):[],this.columns=this.columns.concat(this.extras),this.orderBy=this.columns[0],void this.setData(data)):void console.error("vue-tables: unable to set column names. No results returned from server upon first request. Please declare the columns excplicitly.")}.bind(this))},data:function(){return{data:[],source:null,columns:[],allColumns:!1,totalPages:null,lengths:[5,10,20,50],ascending:1,orderBy:null,query:null,page:1,count:0,limit:10,countTemplate:"{count} Records",lastKeyStrokeAt:!1,loading:!1}},methods:{refresh:require("./methods/refresh"),getData:require("./methods/get-data"),setData:require("./methods/set-data")}};Vue.component("v-server-table",server)}},{"./config/defaults":6,"./helpers/generate-table-html":14,"./helpers/object-keys":16,"./methods/get-data":23,"./methods/refresh":29,"./methods/set-data":31,"./mixins/computed":36,"./mixins/filters":37,"./mixins/methods":38}],41:[function(require,module,exports){!function(global){"use strict";function pad(val,len){for(val=String(val),len=len||2;val.length<len;)val="0"+val;return val}function getWeek(date){var targetThursday=new Date(date.getFullYear(),date.getMonth(),date.getDate());targetThursday.setDate(targetThursday.getDate()-(targetThursday.getDay()+6)%7+3);var firstThursday=new Date(targetThursday.getFullYear(),0,4);firstThursday.setDate(firstThursday.getDate()-(firstThursday.getDay()+6)%7+3);var ds=targetThursday.getTimezoneOffset()-firstThursday.getTimezoneOffset();targetThursday.setHours(targetThursday.getHours()-ds);var weekDiff=(targetThursday-firstThursday)/6048e5;return 1+Math.floor(weekDiff)}function getDayOfWeek(date){var dow=date.getDay();return 0===dow&&(dow=7),dow}function kindOf(val){return null===val?"null":void 0===val?"undefined":"object"!=typeof val?typeof val:Array.isArray(val)?"array":{}.toString.call(val).slice(8,-1).toLowerCase()}var dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g;return function(date,mask,utc,gmt){if(1!==arguments.length||"string"!==kindOf(date)||/\d/.test(date)||(mask=date,date=void 0),date=date||new Date,date instanceof Date||(date=new Date(date)),isNaN(date))throw TypeError("Invalid date");mask=String(dateFormat.masks[mask]||mask||dateFormat.masks["default"]);var maskSlice=mask.slice(0,4);("UTC:"===maskSlice||"GMT:"===maskSlice)&&(mask=mask.slice(4),utc=!0,"GMT:"===maskSlice&&(gmt=!0));var _=utc?"getUTC":"get",d=date[_+"Date"](),D=date[_+"Day"](),m=date[_+"Month"](),y=date[_+"FullYear"](),H=date[_+"Hours"](),M=date[_+"Minutes"](),s=date[_+"Seconds"](),L=date[_+"Milliseconds"](),o=utc?0:date.getTimezoneOffset(),W=getWeek(date),N=getDayOfWeek(date),flags={d:d,dd:pad(d),ddd:dateFormat.i18n.dayNames[D],dddd:dateFormat.i18n.dayNames[D+7],m:m+1,mm:pad(m+1),mmm:dateFormat.i18n.monthNames[m],mmmm:dateFormat.i18n.monthNames[m+12],yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(Math.round(L/10)),t:12>H?"a":"p",tt:12>H?"am":"pm",T:12>H?"A":"P",TT:12>H?"AM":"PM",Z:gmt?"GMT":utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(100*Math.floor(Math.abs(o)/60)+Math.abs(o)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10],W:W,N:N};return mask.replace(token,function(match){return match in flags?flags[match]:match.slice(1,match.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},"function"==typeof define&&define.amd?define(function(){return dateFormat}):"object"==typeof exports?module.exports=dateFormat:global.dateFormat=dateFormat}(this)},{}],42:[function(require,module,exports){String.prototype.ucfirst=require("./lib/helpers/ucfirst"),Array.prototype.diff=require("./lib/helpers/array-diff"),exports.client=require("./lib/v-client-table"),exports.server=require("./lib/v-server-table")},{"./lib/helpers/array-diff":13,"./lib/helpers/ucfirst":17,"./lib/v-client-table":39,"./lib/v-server-table":40}]},{},[42])(42)});
{'fraction_non_alphanumeric': 0.239870378141465, 'fraction_numerical': 0.017624842635333614, 'mean_word_length': 14.468806346916697, 'pattern_counts': {'":': 128, '<': 181, '<?xml version=': 0, '>': 203, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7020668', 'n_tokens_mistral': 14509, 'n_tokens_neox': 14061, 'n_words': 701}