Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-mesa

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-mesa - npm Package Compare versions

Comparing version 2.6.4 to 2.6.5

2

bower.json
{
"name": "angular-mesa",
"version": "2.6.4",
"version": "2.6.5",
"main": [

@@ -5,0 +5,0 @@ "./dist/ap-mesa.js",

@@ -927,6 +927,8 @@ 'use strict';

scope.$watch('sortDirection', updateHandler, true);
scope.$watch('rows', updateHandler);
$timeout(function () {
updateHandler(true, false);
scope.$watch('rows', function (newRows) {
if (angular.isArray(newRows)) {
updateHandler(true, false);
}
});
updateHandler(true, false);
}

@@ -933,0 +935,0 @@ return {

@@ -1,1 +0,1 @@

"use strict";angular.module("apMesa",["apMesa.templates","ui.sortable","ngSanitize","apMesa.directives.apMesa"]),angular.module("apMesa.controllers.ApMesaController",["apMesa.services.apMesaSortFunctions","apMesa.services.apMesaFilterFunctions","apMesa.services.apMesaFormatFunctions"]).controller("ApMesaController",["$scope","$element","apMesaFormatFunctions","apMesaSortFunctions","apMesaFilterFunctions","$log","$window","$filter","$timeout",function(a,b,c,d,e,f,g,h,i){a.getSelectableRows=function(){var b=h("apMesaRowFilter");return angular.isArray(a.rows)?b(a.rows,a.columns,a.searchTerms,a.filterState):[]},a.isSelectedAll=function(){if(!angular.isArray(a.rows)||!angular.isArray(a.selected))return!1;var b=a.getSelectableRows();return b.length>0&&b.length===a.selected.length},a.selectAll=function(){a.deselectAll();var b=a.getSelectableRows();if(!(b.length<=0)){for(var c=a.columns,d=null,e=null,f=0;f<c.length;f++)if(c[f].selector){d=c[f].key,e=c[f].selectObject;break}if(!d)throw new Error("Unable to find selector column key for selectAll");for(var f=0;f<b.length;f++)a.selected.push(e?b[f]:b[f][d])}},a.deselectAll=function(){for(;a.selected.length>0;)a.selected.pop()},a.toggleSelectAll=function(b){var c=b.target;c.checked?a.selectAll():a.deselectAll()},a.addSort=function(b,c){var d=a.sortOrder.indexOf(b);-1===d&&a.sortOrder.push(b),a.sortDirection[b]=c},a.removeSort=function(b){var c=a.sortOrder.indexOf(b);-1!==c&&a.sortOrder.splice(c,1),delete a.sortDirection[b]},a.clearSort=function(){a.sortOrder=[],a.sortDirection={}},a.hasFilterFields=function(){if(!a.columns)return!1;for(var b=a.columns.length-1;b>=0;b--)if("undefined"!=typeof a.columns[b].filter)return!0;return!1},a.clearAndFocusSearch=function(c){a.searchTerms[c]="",b.find("tr.ap-mesa-filter-row th.column-"+c+" input").focus()},a.toggleSort=function(b,c){if(c.sort){if(b.shiftKey)switch(a.sortDirection[c.id]){case"+":a.sortDirection[c.id]="-";break;case"-":a.removeSort(c.id);break;default:a.addSort(c.id,"+")}else{var d=a.sortDirection[c.id];a.clearSort(),"+"===d?a.addSort(c.id,"-"):a.addSort(c.id,"+")}a.saveToStorage()}},a.getSortClass=function(b){var c=a.options.sortClasses;return"+"===b?c[1]:"-"===b?c[2]:c[0]},a.setColumns=function(b){a.columns=b,a.columns.forEach(function(a){var b=a.format;if("function"!=typeof b)if("string"==typeof b)if("function"==typeof c[b])a.format=c[b];else try{a.format=h(b)}catch(g){delete a.format,f.warn("format function reference in column(id="+a.id+') was not found in built-in format functions or $filters. format function given: "'+b+'". Available built-ins: '+Object.keys(c).join(",")+". If you supplied a $filter, ensure it is available on this module")}else delete a.format;var i=a.sort;"function"!=typeof i&&("string"==typeof i?"function"==typeof d[i]?a.sort=d[i](a.key):(delete a.sort,f.warn("sort function reference in column(id="+a.id+') was not found in built-in sort functions. sort function given: "'+i+'". Available built-ins: '+Object.keys(d).join(",")+". ")):delete a.sort);var j=a.filter;"function"!=typeof j&&("string"==typeof j?"function"==typeof e[j]?a.filter=e[j]:(delete a.filter,f.warn("filter function reference in column(id="+a.id+') was not found in built-in filter functions. filter function given: "'+j+'". Available built-ins: '+Object.keys(e).join(",")+". ")):delete a.filter)})},a.startColumnResize=function(b,c){function d(a){var b=a.pageX,c=b-f;e=j+c,h.css("width",e+"px")}b.preventDefault(),b.originalEvent.preventDefault(),b.stopPropagation();var e=!1,f=b.pageX,h=$('<div class="column-resizer-marquee"></div>'),i=$(b.target).parent("th");i.append(h);var j=i.outerWidth();h.css({width:j+"px",height:i.outerHeight()+"px"}),$(g).on("mousemove",d),$(g).one("mouseup",function(b){b.stopPropagation(),h.remove(),$(g).off("mousemove",d),e===!1?delete c.width:c.width=Math.max(e,0),a.$apply()})},a.sortableOptions={axis:"x",handle:".column-text",helper:"clone",placeholder:"ap-mesa-column-placeholder",distance:5},a.getActiveColCount=function(){var b=0;return a.columns.forEach(function(a){a.disabled||b++}),b},a.saveToStorage=function(){if(a.storage){var b={};["sortOrder","sortDirection","searchTerms"].forEach(function(c){b[c]=a[c]}),b.columns=a.columns.map(function(a){return{id:a.id,disabled:!!a.disabled}}),b.options={},["rowLimit","pagingScheme","storageHash"].forEach(function(c){b.options[c]=a.options[c]}),a.storage.setItem(a.storageKey,JSON.stringify(b))}},a.loadFromStorage=function(){if(a.storage){var b=a.storage.getItem(a.storageKey);if(b){var c;try{if(c=JSON.parse(b),c.options.storageHash!==a.options.storageHash)return;["sortOrder","sortDirection","searchTerms"].forEach(function(b){a[b]=c[b]});var d=c.columns.map(function(a){return a.id});a.columns.sort(function(a,b){var c=-1===d.indexOf(a.id),e=-1===d.indexOf(b.id);return c&&e?0:c?1:e?-1:d.indexOf(a.id)-d.indexOf(b.id)}),a.columns.forEach(function(a,b){["disabled"].forEach(function(d){a[d]=c.columns[b][d]})}),["rowLimit","pagingScheme","storageHash"].forEach(function(b){a.options[b]=c.options[b]})}catch(e){f.warn("Loading from storage failed!")}}}},a.calculateRowLimit=function(){var b=a.scrollDiv.find(".ap-mesa-rendered-rows tr").height();a.rowHeight=b||a.options.defaultRowHeight||20,a.rowLimit=Math.ceil((a.options.bodyHeight+2*a.options.rowPadding)/a.rowHeight)}}]),function(){function a(a){if("object"!=typeof a)return a;for(var b=1,c=arguments.length;c>b;b++){var d=arguments[b];for(var e in d)void 0===a[e]&&(a[e]=d[e])}return a}angular.module("apMesa.directives.apMesa",["apMesa.controllers.ApMesaController","apMesa.directives.apMesaRows","apMesa.directives.apMesaDummyRows","apMesa.directives.apMesaExpandable"]).provider("apMesa",function(){var b={bgSizeMultiplier:1,rowPadding:300,bodyHeight:300,fixedHeight:!1,defaultRowHeight:40,scrollDebounce:100,scrollDivisor:1,loadingText:"loading",loadingError:!1,noRowsText:"no rows",sortClasses:["glyphicon glyphicon-sort","glyphicon glyphicon-chevron-up","glyphicon glyphicon-chevron-down"],onRegisterApi:function(a){}};this.setDefaultOptions=function(c){b=a(c,b)},this.$get=[function(){return{getDefaultOptions:function(){return b}}}]}).directive("apMesa",["$log","$timeout","$q","apMesa",function(b,c,d,e){function f(a,b,d){var e,f,g,h,i,j=function(){var k=Date.now()-h;b>k&&k>0?e=c(j,b-k):(e=null,d||(i=a.apply(g,f),e||(g=f=null)))};return function(){g=this,f=arguments,h=Date.now();var k=d&&!e;return e||(e=c(j,b)),k&&(i=a.apply(g,f),g=f=null),i}}function g(a){a.expandedRows={},a.expandedRowHeights={},a.searchTerms={},a.sortOrder=[],a.sortDirection={},a.filterState={filterCount:a.rows?a.rows.length:0},a.rowOffset=0,a.$broadcast("apMesa:stateReset")}function h(b){if(void 0!==b.options&&b.options.hasOwnProperty("getter")&&"function"!=typeof b.options.getter)throw new Error('"getter" in "options" should be a function!');b.options=b.options||{};var c=b.trackBy?{trackBy:b.trackBy}:{};a(b.options,c,e.getDefaultOptions()),i(b)}function i(a){a.options.initialSorts&&angular.forEach(a.options.initialSorts,function(b){a.addSort(b.id,b.dir)})}function j(a){a._columns&&a._columns.length&&(a.columns=angular.copy(a._columns),a.setColumns(a.columns),g(a))}function k(a,e){var k=[];j(a),a.$watch("_columns",function(b,c){b!==a.columns&&(j(a),i(a))}),g(a),h(a),a.$watch("options",function(b,c){g(a),h(a)}),a.$watch("options.storage",function(b){if(b){if(!a.options.storageKey)throw new Error("apMesa: the storage option requires the storageKey option as well. See the README.");a.storage=a.options.storage,a.storageKey=a.options.storageKey,a.loadFromStorage(),k.push(a.$watchCollection("columns",a.saveToStorage)),k.push(a.$watchCollection("searchTerms",a.saveToStorage)),k.push(a.$watch("options.pagingScheme",a.saveToStorage))}else k.length&&(k.forEach(function(a){a()}),k=[])});var l;a.$watch("options.fillHeight",function(b){b?(l=a.$on("apMesa:resize",function(){a.options.bodyHeight=e.parent().height()-e.find(".mesa-header-table").outerHeight(!0)}),a.$emit("apMesa:resize")):l&&l()}),a.$watch("options.bodyHeight",function(){a.calculateRowLimit(),a.tbodyNgStyle={},a.tbodyNgStyle[a.options.fixedHeight?"height":"max-height"]=a.options.bodyHeight+"px",a.saveToStorage()}),a.$watch("filterState.filterCount",function(){a.onScroll()}),a.$watch("rowHeight",function(b){e.find("tr.ap-mesa-dummy-row").css("background-size","auto "+b*a.options.bgSizeMultiplier+"px")}),a.$watch("options.loadingPromise",function(c){angular.isObject(c)&&"function"==typeof c.then&&(a.api.setLoading(!0),c.then(function(){a.options.loadingError=!1,a.api.setLoading(!1)},function(c){a.options.loadingError=!0,a.api.setLoading(!1),b.warn("Failed loading table data: "+c)}))});var m,n=f(function(){a.calculateRowLimit();var b=a.scrollDiv[0].scrollTop-a.options.rowPadding,c=a.rowHeight;if(0===c)return!1;var d=0,e=0,f=Object.keys(a.expandedRows).map(function(a){return parseInt(a)}).sort();f.push(a.filterState.filterCount);for(var g=0;g<=f.length;g++){var h=f[g],i=(h-d)*c;if(e+i>=b){d+=Math.floor((b-e)/c);break}e+=i;var j=a.expandedRowHeights[h];if(e+=j,d=h,e>=b){d--;break}}a.rowOffset=Math.max(0,d),m.resolve(),m=null,a.options.scrollingPromise=null,a.$digest()},a.options.scrollDebounce);a.onScroll=function(){m||(m=d.defer(),a.options.scrollingPromise=m.promise),n()},a.scrollDiv=e.find(".mesa-rows-table-wrapper"),a.scrollDiv.on("scroll",a.onScroll),c(function(){a.calculateRowLimit()},0),a.api={isSelectedAll:a.isSelectedAll,selectAll:a.selectAll,deselectAll:a.deselectAll,toggleSelectAll:a.toggleSelectAll,setLoading:function(b,c){a.options.loading=b,c&&a.$digest()}},a.options.onRegisterApi(a.api)}return{templateUrl:"src/templates/apMesa.tpl.html",restrict:"EA",replace:!0,scope:{_columns:"=columns",rows:"=",classes:"@tableClass",selected:"=",options:"=?",trackBy:"@?"},controller:"ApMesaController",compile:function(a){var b=a.attr("track-by");return b&&a.find(".ap-mesa-rendered-rows").attr("track-by",b),k}}}])}(),angular.module("apMesa.directives.apMesaCell",["apMesa.directives.apMesaSelector"]).directive("apMesaCell",["$compile",function(a){function b(b,c){b.$watch("column",function(d){var e="";e=d.template?d.template:d.templateUrl?"<div ng-include=\"'"+d.templateUrl+"'\"></div>":d.selector===!0?'<input type="checkbox" ng-checked="selected.indexOf(column.selectObject ? row : row[column.key]) >= 0" ap-mesa-selector class="ap-mesa-selector" />':d.ngFilter?"{{ row[column.key] | "+d.ngFilter+":row }}":d.format?"{{ column.format(row[column.key], row, column) }}":void 0!==b.options&&{}.hasOwnProperty.call(b.options,"getter")?"{{ options.getter(column.key, row) }}":"{{ row[column.key] }}",c.html(e),a(c.contents())(b)})}return{scope:!0,link:b}}]),angular.module("apMesa.directives.apMesaDummyRows",[]).directive("apMesaDummyRows",function(){return{template:'<tr class="ap-mesa-dummy-row" ng-style="{ height: dummyRowHeight + \'px\'}"><td ng-show="dummyRowHeight" ng-attr-colspan="{{columns.length}}"></td></tr>',scope:!0,link:function(a,b,c){a.$watch(c.apMesaDummyRows,function(b){var c=(b[1]-b[0])*a.rowHeight;for(var d in a.expandedRows){var e=parseInt(d);e>=b[0]&&e<b[1]&&(c+=a.expandedRowHeights[d])}a.dummyRowHeight=c})}}}),angular.module("apMesa.directives.apMesaExpandable",[]).directive("apMesaExpandable",["$compile",function(a){return{scope:!1,link:function(b,c,d){b.$watch("row",function(){var d;if(b.options.expandableTemplateUrl)d=angular.element('<div ng-include="options.expandableTemplateUrl"></div>');else{if(!b.options.expandableTemplate)return;d=angular.element(b.options.expandableTemplate)}a(d)(b),c.html(""),c.append(d)})}}}]),angular.module("apMesa.directives.apMesaRow",["apMesa.directives.apMesaCell"]).directive("apMesaRow",["$timeout",function(a){return{template:'<td ng-repeat="column in columns track by column.id" class="ap-mesa-cell col-{{column.id}}" ap-mesa-cell></td>',scope:!1,link:function(b,c){var d=b.$index+b.rowOffset;b.rowIsExpanded=!!b.expandedRows[d],b.toggleRowExpand=function(){b.expandedRows[d]=b.rowIsExpanded=!b.expandedRows[d],a(function(){b.expandedRows[d]?b.refreshExpandedHeight():(delete b.expandedRows[d],delete b.expandedRowHeights[d])})},b.refreshExpandedHeight=function(){var a=c.next("tr.ap-mesa-expand-panel").height();b.expandedRowHeights[d]=a},b.$watch("expandedRows",function(a,c){a!==c&&(b.rowIsExpanded=!1)})}}}]),angular.module("apMesa.directives.apMesaRows",["apMesa.directives.apMesaRow","apMesa.filters.apMesaRowFilter","apMesa.filters.apMesaRowSorter"]).directive("apMesaRows",["$filter","$timeout",function(a,b){function c(a){if(!a.rows||!a.columns)return[];var b;b=e(a.rows,a.columns,a.searchTerms,a.filterState,a.options),b=f(b,a.columns,a.sortOrder,a.sortDirection,a.options),b=g(b,Math.floor(a.rowOffset)-a.filterState.filterCount),b=g(b,a.rowLimit+Math.ceil(a.rowOffset%1));var c=a.rowOffset;return b.forEach(function(a){a.$$$index=c++}),b}function d(a){var d=function(b,d){b!==d&&(a.visible_rows=c(a),a.expandedRows={})},e=function(b,d){b!==d&&(a.visible_rows=c(a))};a.$watch("searchTerms",d,!0),a.$watch("[rowOffset,rowLimit]",e),a.$watch("filterState.filterCount",d),a.$watch("sortOrder",d,!0),a.$watch("sortDirection",d,!0),a.$watch("rows",d),b(function(){d(!0,!1)})}var e=a("apMesaRowFilter"),f=a("apMesaRowSorter"),g=a("limitTo");return{restrict:"A",templateUrl:"src/templates/apMesaRows.tpl.html",compile:function(a,b){var c=a.find("tr[ng-repeat-start]"),e=c.attr("ng-repeat-start");return e+=b.trackBy?" track by row[options.trackBy]":" track by row.$$$index",c.attr("ng-repeat-start",e),d}}}]),angular.module("apMesa.directives.apMesaSelector",[]).directive("apMesaSelector",function(){return{restrict:"A",scope:!1,link:function(a,b){var c=a.selected,d=a.row,e=a.column;b.on("click",function(){var b=c.indexOf(e.selectObject?d:d[e.key]);b>=0?c.splice(b,1):c.push(e.selectObject?d:d[e.key]),a.$apply()})}}}),angular.module("apMesa.filters.apMesaRowFilter",["apMesa.services.apMesaFilterFunctions"]).filter("apMesaRowFilter",["apMesaFilterFunctions","$log",function(a,b){return function(c,d,e,f,g){var h,i=c;return h=d.filter(function(c){var d=e[c.id];if(e.hasOwnProperty(c.id)&&"string"==typeof d){if(!d.trim())return!1;if("function"==typeof c.filter)return!0;var f=a[c.filter];if("function"==typeof f)return c.filter=f,!0;b.warn('apMesa: The filter function "'+c.filter+'" specified by column(id='+c.id+').filter was not found in predefined tableFilterFunctions. Available filters: "'+Object.keys(a).join('","')+'"')}return!1}),h.length&&(i=c.filter(function(a){for(var b=h.length-1;b>=0;b--){var c=h[b],d=c.filter,f=e[c.id],i=void 0!==g&&{}.hasOwnProperty.call(g,"getter")?g.getter(c.key,a):a[c.key],j="function"==typeof c.format?c.format(i,a,c):i;if(!d(f,i,j,a))return!1}return!0})),f.filterCount=i.length,i}}]),angular.module("apMesa.filters.apMesaRowSorter",[]).filter("apMesaRowSorter",function(){function a(a,c){if(b.hasOwnProperty(c))return b[c];for(var d=a.length-1;d>=0;d--)if(a[d].id===c)return b[c]=a[d],a[d]}var b={};return function(b,c,d,e,f){if(!d.length)return b;for(var g=[],h=0;h<b.length;h++)g.push(b[h]);return g.sort(function(b,g){for(var h=0;h<d.length;h++){var i=d[h],j=a(c,i),k=e[i];if(j&&j.sort){var l=j.sort,m="+"===k?l(b,g,f,j):l(g,b,f,j);if(0!==m)return m}}return 0})}}),angular.module("apMesa.services.apMesaFilterFunctions",[]).service("apMesaFilterFunctions",function(){function a(a,b){a=a.toLowerCase().trim(),b=String(b).toLowerCase();var c=a[0];return"!"===c?(a=a.substr(1),""===a?!0:-1===b.indexOf(a)):"="===c?(a=a.substr(1),a===b.trim()):(a=a.replace("\\!","!"),a=a.replace("\\=","="),-1!==b.indexOf(a))}function b(b,c,d,e){return a(b,d,d,e)}function c(a,b){b=parseFloat(b),a=a.trim();var c=a.substr(0,2),d=a[0],e=1*a.substr(1),f=1*a.substr(2);return"<="===c?f>=b:">="===c?b>=f:"<"===d?e>b:">"===d?b>e:"~"===d?Math.round(b)===e:"="===d?e===b:b.toString().indexOf(a.toString())>-1}function d(a,b,d){return c(a,d)}function e(a){for(var b=a.trim().split(","),c=0,d=0;d<b.length;d++){var e=b[d].trim(),f=h.exec(e);if(f){var i=1*f[1],j=f[2].replace(/s$/,"");g.hasOwnProperty(j)&&(c+=i*g[j])}}return c}function f(a,b){if(a=a.trim(),!a)return!0;b*=1;var c,d,f=new Date,h=+f,i=a[0],j=a.substr(1).trim();if("<"===i)return c=h-e(j),b>c;if(">"===i)return d=h-e(j),d>b;if("today"===a)return new Date(b).toDateString()===f.toDateString();if("yesterday"===a)return new Date(b).toDateString()===new Date(h-g.d).toDateString();var k=new Date(a);return isNaN(k)?!1:new Date(b).toDateString()===k.toDateString()}a.placeholder=b.placeholder="string search",a.title=b.title='Search by text, eg. "foo". Use "!" to exclude and "=" to match exact text, e.g. "!bar" or "=baz".',c.placeholder=d.placeholder="number search",c.title=d.title='Search by number, e.g. "123". Optionally use comparator expressions like ">=10" or "<1000". Use "~" for approx. int values, eg. "~3" will match "3.2"';var g={};g.second=g.sec=g.s=1e3,g.minute=g.min=g.m=60*g.second,g.hour=g.hr=g.h=60*g.minute,g.day=g.d=24*g.hour,g.week=g.wk=g.w=7*g.day,g.month=4*g.week,g.year=g.yr=g.y=365*g.day;var h=/(\d+(?:\.\d+)?)\s*([a-z]+)/;return f.placeholder="date search",f.title='Search by date. Enter a date string (RFC2822 or ISO 8601 date). You can also type "today", "yesterday", "> 2 days ago", "< 1 day 2 hours ago", etc.',{like:a,likeFormatted:b,number:c,numberFormatted:d,date:f}}),angular.module("apMesa.services.apMesaFormatFunctions",[]).service("apMesaFormatFunctions",function(){return{}}),angular.module("apMesa.services.apMesaSortFunctions",[]).service("apMesaSortFunctions",function(){return{number:function(a){return function(b,c,d){var e,f;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(e=d.getter(a,b),f=d.getter(a,c)):(e=b[a],f=c[a]),1*e-1*f}},string:function(a){return function(b,c,d){var e,f;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(e=d.getter(a,b),f=d.getter(a,c)):(e=b[a],f=c[a]),e.toString().toLowerCase().localeCompare(f.toString().toLowerCase())}},stringFormatted:function(a){return function(b,c,d,e){var f,g;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(f=d.getter(a,b),g=d.getter(a,c)):(f=b[a],g=c[a]),f=e.format(f,b,e),g=e.format(g,c,e),f.toString().toLowerCase().localeCompare(g.toString().toLowerCase())}},numberFormatted:function(a){return function(b,c,d,e){var f,g;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(f=d.getter(a,b),g=d.getter(a,c)):(f=b[a],g=c[a]),f=e.format(f,b,e),g=e.format(g,c,e),1*f-1*g}}}}),angular.module("apMesa.templates",["src/templates/apMesa.tpl.html","src/templates/apMesaDummyRows.tpl.html","src/templates/apMesaRows.tpl.html"]),angular.module("src/templates/apMesa.tpl.html",[]).run(["$templateCache",function(a){a.put("src/templates/apMesa.tpl.html",'<div class="ap-mesa-wrapper">\n <table ng-class="classes" class="ap-mesa mesa-header-table">\n <thead>\n <tr ui-sortable="sortableOptions" ng-model="columns">\n <th\n scope="col"\n ng-repeat="column in columns"\n ng-click="toggleSort($event,column)"\n ng-class="{\'sortable-column\' : column.sort, \'select-column\': column.selector, \'is-sorting\': sortDirection[column.id] }"\n ng-attr-title="{{ column.title || \'\' }}"\n ng-style="{ width: column.width, \'min-width\': column.width, \'max-width\': column.width }"\n >\n <span class="column-text">\n <input ng-if="column.selector" type="checkbox" ng-checked="isSelectedAll()" ng-click="toggleSelectAll($event)" />\n <span\n ng-if="column.sort"\n title="This column is sortable. Click to toggle sort order. Hold shift while clicking multiple columns to stack sorting."\n class="sorting-icon {{ getSortClass( sortDirection[column.id] ) }}"\n ></span>\n {{column.hasOwnProperty(\'label\') ? column.label : column.id }}\n </span>\n <span\n ng-if="!column.lockWidth"\n ng-class="{\'discreet-width\': !!column.width, \'column-resizer\': true}"\n title="Click and drag to set discreet width. Click once to clear discreet width."\n ng-mousedown="startColumnResize($event, column)"\n >\n &nbsp;\n </span>\n </th>\n </tr>\n <tr ng-if="hasFilterFields()" class="ap-mesa-filter-row">\n <td ng-repeat="column in columns" ng-class="\'column-\' + column.id">\n <input\n type="text"\n ng-if="(column.filter)"\n ng-model="searchTerms[column.id]"\n ng-attr-placeholder="{{ column.filter && column.filter.placeholder }}"\n ng-attr-title="{{ column.filter && column.filter.title }}"\n ng-class="{\'active\': searchTerms[column.id] }"\n >\n <button\n ng-if="(column.filter)"\n ng-show="searchTerms[column.id]"\n class="clear-search-btn"\n role="button"\n type="button"\n ng-click="clearAndFocusSearch(column.id)"\n >\n &times;\n </button>\n\n </td>\n </tr>\n </thead>\n </table>\n <div class="mesa-rows-table-wrapper" ng-style="tbodyNgStyle">\n <table ng-class="classes" class="ap-mesa mesa-rows-table">\n <thead>\n <th\n scope="col"\n ng-repeat="column in columns"\n ng-style="{ width: column.width, \'min-width\': column.width, \'max-width\': column.width }"\n ></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-if="visible_rows.length === 0 || options.loading">\n <td ng-attr-colspan="{{columns.length}}" class="space-holder-row-cell">\n <div ng-if="options.loadingError">\n <div ng-if="!options.loading && options.loadingErrorTemplateUrl" ng-include="options.loadingErrorTemplateUrl"></div>\n <div ng-if="!options.loading && !options.loadingErrorTemplateUrl">{{ options.loadingErrorText }}</div>\n </div>\n <div ng-if="!options.loadingError">\n <div ng-if="options.loading && options.loadingTemplateUrl" ng-include="options.loadingTemplateUrl"></div>\n <div ng-if="options.loading && !options.loadingTemplateUrl">{{ options.loadingText }}</div>\n <div ng-if="!options.loading && options.noRowsTemplateUrl" ng-include="options.noRowsTemplateUrl"></div>\n <div ng-if="!options.loading && !options.noRowsTemplateUrl">{{ options.noRowsText }}</div>\n </div>\n </td>\n </tr>\n </tbody>\n <tbody ng-show="!options.loading" ap-mesa-dummy-rows="[0,rowOffset]" columns="columns" cell-content="..."></tbody>\n <tbody ng-show="!options.loading" ap-mesa-rows class="ap-mesa-rendered-rows"></tbody>\n <tbody ng-show="!options.loading" ap-mesa-dummy-rows="[rowOffset + visible_rows.length, filterState.filterCount]" columns="columns" cell-content="..."></tbody>\n </table>\n </div>\n</div>\n')}]),angular.module("src/templates/apMesaDummyRows.tpl.html",[]).run(["$templateCache",function(a){a.put("src/templates/apMesaDummyRows.tpl.html","")}]),angular.module("src/templates/apMesaRows.tpl.html",[]).run(["$templateCache",function(a){a.put("src/templates/apMesaRows.tpl.html",'<tr ng-repeat-start="row in visible_rows" ng-attr-class="{{ (rowOffset + $index) % 2 ? \'odd\' : \'even\' }}" ap-mesa-row></tr>\n<tr ng-repeat-end ng-if="rowIsExpanded" class="ap-mesa-expand-panel">\n <td ap-mesa-expandable ng-attr-colspan="{{ columns.length }}"></td>\n</tr>\n')}]);
"use strict";angular.module("apMesa",["apMesa.templates","ui.sortable","ngSanitize","apMesa.directives.apMesa"]),angular.module("apMesa.controllers.ApMesaController",["apMesa.services.apMesaSortFunctions","apMesa.services.apMesaFilterFunctions","apMesa.services.apMesaFormatFunctions"]).controller("ApMesaController",["$scope","$element","apMesaFormatFunctions","apMesaSortFunctions","apMesaFilterFunctions","$log","$window","$filter","$timeout",function(a,b,c,d,e,f,g,h,i){a.getSelectableRows=function(){var b=h("apMesaRowFilter");return angular.isArray(a.rows)?b(a.rows,a.columns,a.searchTerms,a.filterState):[]},a.isSelectedAll=function(){if(!angular.isArray(a.rows)||!angular.isArray(a.selected))return!1;var b=a.getSelectableRows();return b.length>0&&b.length===a.selected.length},a.selectAll=function(){a.deselectAll();var b=a.getSelectableRows();if(!(b.length<=0)){for(var c=a.columns,d=null,e=null,f=0;f<c.length;f++)if(c[f].selector){d=c[f].key,e=c[f].selectObject;break}if(!d)throw new Error("Unable to find selector column key for selectAll");for(var f=0;f<b.length;f++)a.selected.push(e?b[f]:b[f][d])}},a.deselectAll=function(){for(;a.selected.length>0;)a.selected.pop()},a.toggleSelectAll=function(b){var c=b.target;c.checked?a.selectAll():a.deselectAll()},a.addSort=function(b,c){var d=a.sortOrder.indexOf(b);-1===d&&a.sortOrder.push(b),a.sortDirection[b]=c},a.removeSort=function(b){var c=a.sortOrder.indexOf(b);-1!==c&&a.sortOrder.splice(c,1),delete a.sortDirection[b]},a.clearSort=function(){a.sortOrder=[],a.sortDirection={}},a.hasFilterFields=function(){if(!a.columns)return!1;for(var b=a.columns.length-1;b>=0;b--)if("undefined"!=typeof a.columns[b].filter)return!0;return!1},a.clearAndFocusSearch=function(c){a.searchTerms[c]="",b.find("tr.ap-mesa-filter-row th.column-"+c+" input").focus()},a.toggleSort=function(b,c){if(c.sort){if(b.shiftKey)switch(a.sortDirection[c.id]){case"+":a.sortDirection[c.id]="-";break;case"-":a.removeSort(c.id);break;default:a.addSort(c.id,"+")}else{var d=a.sortDirection[c.id];a.clearSort(),"+"===d?a.addSort(c.id,"-"):a.addSort(c.id,"+")}a.saveToStorage()}},a.getSortClass=function(b){var c=a.options.sortClasses;return"+"===b?c[1]:"-"===b?c[2]:c[0]},a.setColumns=function(b){a.columns=b,a.columns.forEach(function(a){var b=a.format;if("function"!=typeof b)if("string"==typeof b)if("function"==typeof c[b])a.format=c[b];else try{a.format=h(b)}catch(g){delete a.format,f.warn("format function reference in column(id="+a.id+') was not found in built-in format functions or $filters. format function given: "'+b+'". Available built-ins: '+Object.keys(c).join(",")+". If you supplied a $filter, ensure it is available on this module")}else delete a.format;var i=a.sort;"function"!=typeof i&&("string"==typeof i?"function"==typeof d[i]?a.sort=d[i](a.key):(delete a.sort,f.warn("sort function reference in column(id="+a.id+') was not found in built-in sort functions. sort function given: "'+i+'". Available built-ins: '+Object.keys(d).join(",")+". ")):delete a.sort);var j=a.filter;"function"!=typeof j&&("string"==typeof j?"function"==typeof e[j]?a.filter=e[j]:(delete a.filter,f.warn("filter function reference in column(id="+a.id+') was not found in built-in filter functions. filter function given: "'+j+'". Available built-ins: '+Object.keys(e).join(",")+". ")):delete a.filter)})},a.startColumnResize=function(b,c){function d(a){var b=a.pageX,c=b-f;e=j+c,h.css("width",e+"px")}b.preventDefault(),b.originalEvent.preventDefault(),b.stopPropagation();var e=!1,f=b.pageX,h=$('<div class="column-resizer-marquee"></div>'),i=$(b.target).parent("th");i.append(h);var j=i.outerWidth();h.css({width:j+"px",height:i.outerHeight()+"px"}),$(g).on("mousemove",d),$(g).one("mouseup",function(b){b.stopPropagation(),h.remove(),$(g).off("mousemove",d),e===!1?delete c.width:c.width=Math.max(e,0),a.$apply()})},a.sortableOptions={axis:"x",handle:".column-text",helper:"clone",placeholder:"ap-mesa-column-placeholder",distance:5},a.getActiveColCount=function(){var b=0;return a.columns.forEach(function(a){a.disabled||b++}),b},a.saveToStorage=function(){if(a.storage){var b={};["sortOrder","sortDirection","searchTerms"].forEach(function(c){b[c]=a[c]}),b.columns=a.columns.map(function(a){return{id:a.id,disabled:!!a.disabled}}),b.options={},["rowLimit","pagingScheme","storageHash"].forEach(function(c){b.options[c]=a.options[c]}),a.storage.setItem(a.storageKey,JSON.stringify(b))}},a.loadFromStorage=function(){if(a.storage){var b=a.storage.getItem(a.storageKey);if(b){var c;try{if(c=JSON.parse(b),c.options.storageHash!==a.options.storageHash)return;["sortOrder","sortDirection","searchTerms"].forEach(function(b){a[b]=c[b]});var d=c.columns.map(function(a){return a.id});a.columns.sort(function(a,b){var c=-1===d.indexOf(a.id),e=-1===d.indexOf(b.id);return c&&e?0:c?1:e?-1:d.indexOf(a.id)-d.indexOf(b.id)}),a.columns.forEach(function(a,b){["disabled"].forEach(function(d){a[d]=c.columns[b][d]})}),["rowLimit","pagingScheme","storageHash"].forEach(function(b){a.options[b]=c.options[b]})}catch(e){f.warn("Loading from storage failed!")}}}},a.calculateRowLimit=function(){var b=a.scrollDiv.find(".ap-mesa-rendered-rows tr").height();a.rowHeight=b||a.options.defaultRowHeight||20,a.rowLimit=Math.ceil((a.options.bodyHeight+2*a.options.rowPadding)/a.rowHeight)}}]),function(){function a(a){if("object"!=typeof a)return a;for(var b=1,c=arguments.length;c>b;b++){var d=arguments[b];for(var e in d)void 0===a[e]&&(a[e]=d[e])}return a}angular.module("apMesa.directives.apMesa",["apMesa.controllers.ApMesaController","apMesa.directives.apMesaRows","apMesa.directives.apMesaDummyRows","apMesa.directives.apMesaExpandable"]).provider("apMesa",function(){var b={bgSizeMultiplier:1,rowPadding:300,bodyHeight:300,fixedHeight:!1,defaultRowHeight:40,scrollDebounce:100,scrollDivisor:1,loadingText:"loading",loadingError:!1,noRowsText:"no rows",sortClasses:["glyphicon glyphicon-sort","glyphicon glyphicon-chevron-up","glyphicon glyphicon-chevron-down"],onRegisterApi:function(a){}};this.setDefaultOptions=function(c){b=a(c,b)},this.$get=[function(){return{getDefaultOptions:function(){return b}}}]}).directive("apMesa",["$log","$timeout","$q","apMesa",function(b,c,d,e){function f(a,b,d){var e,f,g,h,i,j=function(){var k=Date.now()-h;b>k&&k>0?e=c(j,b-k):(e=null,d||(i=a.apply(g,f),e||(g=f=null)))};return function(){g=this,f=arguments,h=Date.now();var k=d&&!e;return e||(e=c(j,b)),k&&(i=a.apply(g,f),g=f=null),i}}function g(a){a.expandedRows={},a.expandedRowHeights={},a.searchTerms={},a.sortOrder=[],a.sortDirection={},a.filterState={filterCount:a.rows?a.rows.length:0},a.rowOffset=0,a.$broadcast("apMesa:stateReset")}function h(b){if(void 0!==b.options&&b.options.hasOwnProperty("getter")&&"function"!=typeof b.options.getter)throw new Error('"getter" in "options" should be a function!');b.options=b.options||{};var c=b.trackBy?{trackBy:b.trackBy}:{};a(b.options,c,e.getDefaultOptions()),i(b)}function i(a){a.options.initialSorts&&angular.forEach(a.options.initialSorts,function(b){a.addSort(b.id,b.dir)})}function j(a){a._columns&&a._columns.length&&(a.columns=angular.copy(a._columns),a.setColumns(a.columns),g(a))}function k(a,e){var k=[];j(a),a.$watch("_columns",function(b,c){b!==a.columns&&(j(a),i(a))}),g(a),h(a),a.$watch("options",function(b,c){g(a),h(a)}),a.$watch("options.storage",function(b){if(b){if(!a.options.storageKey)throw new Error("apMesa: the storage option requires the storageKey option as well. See the README.");a.storage=a.options.storage,a.storageKey=a.options.storageKey,a.loadFromStorage(),k.push(a.$watchCollection("columns",a.saveToStorage)),k.push(a.$watchCollection("searchTerms",a.saveToStorage)),k.push(a.$watch("options.pagingScheme",a.saveToStorage))}else k.length&&(k.forEach(function(a){a()}),k=[])});var l;a.$watch("options.fillHeight",function(b){b?(l=a.$on("apMesa:resize",function(){a.options.bodyHeight=e.parent().height()-e.find(".mesa-header-table").outerHeight(!0)}),a.$emit("apMesa:resize")):l&&l()}),a.$watch("options.bodyHeight",function(){a.calculateRowLimit(),a.tbodyNgStyle={},a.tbodyNgStyle[a.options.fixedHeight?"height":"max-height"]=a.options.bodyHeight+"px",a.saveToStorage()}),a.$watch("filterState.filterCount",function(){a.onScroll()}),a.$watch("rowHeight",function(b){e.find("tr.ap-mesa-dummy-row").css("background-size","auto "+b*a.options.bgSizeMultiplier+"px")}),a.$watch("options.loadingPromise",function(c){angular.isObject(c)&&"function"==typeof c.then&&(a.api.setLoading(!0),c.then(function(){a.options.loadingError=!1,a.api.setLoading(!1)},function(c){a.options.loadingError=!0,a.api.setLoading(!1),b.warn("Failed loading table data: "+c)}))});var m,n=f(function(){a.calculateRowLimit();var b=a.scrollDiv[0].scrollTop-a.options.rowPadding,c=a.rowHeight;if(0===c)return!1;var d=0,e=0,f=Object.keys(a.expandedRows).map(function(a){return parseInt(a)}).sort();f.push(a.filterState.filterCount);for(var g=0;g<=f.length;g++){var h=f[g],i=(h-d)*c;if(e+i>=b){d+=Math.floor((b-e)/c);break}e+=i;var j=a.expandedRowHeights[h];if(e+=j,d=h,e>=b){d--;break}}a.rowOffset=Math.max(0,d),m.resolve(),m=null,a.options.scrollingPromise=null,a.$digest()},a.options.scrollDebounce);a.onScroll=function(){m||(m=d.defer(),a.options.scrollingPromise=m.promise),n()},a.scrollDiv=e.find(".mesa-rows-table-wrapper"),a.scrollDiv.on("scroll",a.onScroll),c(function(){a.calculateRowLimit()},0),a.api={isSelectedAll:a.isSelectedAll,selectAll:a.selectAll,deselectAll:a.deselectAll,toggleSelectAll:a.toggleSelectAll,setLoading:function(b,c){a.options.loading=b,c&&a.$digest()}},a.options.onRegisterApi(a.api)}return{templateUrl:"src/templates/apMesa.tpl.html",restrict:"EA",replace:!0,scope:{_columns:"=columns",rows:"=",classes:"@tableClass",selected:"=",options:"=?",trackBy:"@?"},controller:"ApMesaController",compile:function(a){var b=a.attr("track-by");return b&&a.find(".ap-mesa-rendered-rows").attr("track-by",b),k}}}])}(),angular.module("apMesa.directives.apMesaCell",["apMesa.directives.apMesaSelector"]).directive("apMesaCell",["$compile",function(a){function b(b,c){b.$watch("column",function(d){var e="";e=d.template?d.template:d.templateUrl?"<div ng-include=\"'"+d.templateUrl+"'\"></div>":d.selector===!0?'<input type="checkbox" ng-checked="selected.indexOf(column.selectObject ? row : row[column.key]) >= 0" ap-mesa-selector class="ap-mesa-selector" />':d.ngFilter?"{{ row[column.key] | "+d.ngFilter+":row }}":d.format?"{{ column.format(row[column.key], row, column) }}":void 0!==b.options&&{}.hasOwnProperty.call(b.options,"getter")?"{{ options.getter(column.key, row) }}":"{{ row[column.key] }}",c.html(e),a(c.contents())(b)})}return{scope:!0,link:b}}]),angular.module("apMesa.directives.apMesaDummyRows",[]).directive("apMesaDummyRows",function(){return{template:'<tr class="ap-mesa-dummy-row" ng-style="{ height: dummyRowHeight + \'px\'}"><td ng-show="dummyRowHeight" ng-attr-colspan="{{columns.length}}"></td></tr>',scope:!0,link:function(a,b,c){a.$watch(c.apMesaDummyRows,function(b){var c=(b[1]-b[0])*a.rowHeight;for(var d in a.expandedRows){var e=parseInt(d);e>=b[0]&&e<b[1]&&(c+=a.expandedRowHeights[d])}a.dummyRowHeight=c})}}}),angular.module("apMesa.directives.apMesaExpandable",[]).directive("apMesaExpandable",["$compile",function(a){return{scope:!1,link:function(b,c,d){b.$watch("row",function(){var d;if(b.options.expandableTemplateUrl)d=angular.element('<div ng-include="options.expandableTemplateUrl"></div>');else{if(!b.options.expandableTemplate)return;d=angular.element(b.options.expandableTemplate)}a(d)(b),c.html(""),c.append(d)})}}}]),angular.module("apMesa.directives.apMesaRow",["apMesa.directives.apMesaCell"]).directive("apMesaRow",["$timeout",function(a){return{template:'<td ng-repeat="column in columns track by column.id" class="ap-mesa-cell col-{{column.id}}" ap-mesa-cell></td>',scope:!1,link:function(b,c){var d=b.$index+b.rowOffset;b.rowIsExpanded=!!b.expandedRows[d],b.toggleRowExpand=function(){b.expandedRows[d]=b.rowIsExpanded=!b.expandedRows[d],a(function(){b.expandedRows[d]?b.refreshExpandedHeight():(delete b.expandedRows[d],delete b.expandedRowHeights[d])})},b.refreshExpandedHeight=function(){var a=c.next("tr.ap-mesa-expand-panel").height();b.expandedRowHeights[d]=a},b.$watch("expandedRows",function(a,c){a!==c&&(b.rowIsExpanded=!1)})}}}]),angular.module("apMesa.directives.apMesaRows",["apMesa.directives.apMesaRow","apMesa.filters.apMesaRowFilter","apMesa.filters.apMesaRowSorter"]).directive("apMesaRows",["$filter","$timeout",function(a,b){function c(a){if(!a.rows||!a.columns)return[];var b;b=e(a.rows,a.columns,a.searchTerms,a.filterState,a.options),b=f(b,a.columns,a.sortOrder,a.sortDirection,a.options),b=g(b,Math.floor(a.rowOffset)-a.filterState.filterCount),b=g(b,a.rowLimit+Math.ceil(a.rowOffset%1));var c=a.rowOffset;return b.forEach(function(a){a.$$$index=c++}),b}function d(a){var b=function(b,d){b!==d&&(a.visible_rows=c(a),a.expandedRows={})},d=function(b,d){b!==d&&(a.visible_rows=c(a))};a.$watch("searchTerms",b,!0),a.$watch("[rowOffset,rowLimit]",d),a.$watch("filterState.filterCount",b),a.$watch("sortOrder",b,!0),a.$watch("sortDirection",b,!0),a.$watch("rows",function(a){angular.isArray(a)&&b(!0,!1)}),b(!0,!1)}var e=a("apMesaRowFilter"),f=a("apMesaRowSorter"),g=a("limitTo");return{restrict:"A",templateUrl:"src/templates/apMesaRows.tpl.html",compile:function(a,b){var c=a.find("tr[ng-repeat-start]"),e=c.attr("ng-repeat-start");return e+=b.trackBy?" track by row[options.trackBy]":" track by row.$$$index",c.attr("ng-repeat-start",e),d}}}]),angular.module("apMesa.directives.apMesaSelector",[]).directive("apMesaSelector",function(){return{restrict:"A",scope:!1,link:function(a,b){var c=a.selected,d=a.row,e=a.column;b.on("click",function(){var b=c.indexOf(e.selectObject?d:d[e.key]);b>=0?c.splice(b,1):c.push(e.selectObject?d:d[e.key]),a.$apply()})}}}),angular.module("apMesa.filters.apMesaRowFilter",["apMesa.services.apMesaFilterFunctions"]).filter("apMesaRowFilter",["apMesaFilterFunctions","$log",function(a,b){return function(c,d,e,f,g){var h,i=c;return h=d.filter(function(c){var d=e[c.id];if(e.hasOwnProperty(c.id)&&"string"==typeof d){if(!d.trim())return!1;if("function"==typeof c.filter)return!0;var f=a[c.filter];if("function"==typeof f)return c.filter=f,!0;b.warn('apMesa: The filter function "'+c.filter+'" specified by column(id='+c.id+').filter was not found in predefined tableFilterFunctions. Available filters: "'+Object.keys(a).join('","')+'"')}return!1}),h.length&&(i=c.filter(function(a){for(var b=h.length-1;b>=0;b--){var c=h[b],d=c.filter,f=e[c.id],i=void 0!==g&&{}.hasOwnProperty.call(g,"getter")?g.getter(c.key,a):a[c.key],j="function"==typeof c.format?c.format(i,a,c):i;if(!d(f,i,j,a))return!1}return!0})),f.filterCount=i.length,i}}]),angular.module("apMesa.filters.apMesaRowSorter",[]).filter("apMesaRowSorter",function(){function a(a,c){if(b.hasOwnProperty(c))return b[c];for(var d=a.length-1;d>=0;d--)if(a[d].id===c)return b[c]=a[d],a[d]}var b={};return function(b,c,d,e,f){if(!d.length)return b;for(var g=[],h=0;h<b.length;h++)g.push(b[h]);return g.sort(function(b,g){for(var h=0;h<d.length;h++){var i=d[h],j=a(c,i),k=e[i];if(j&&j.sort){var l=j.sort,m="+"===k?l(b,g,f,j):l(g,b,f,j);if(0!==m)return m}}return 0})}}),angular.module("apMesa.services.apMesaFilterFunctions",[]).service("apMesaFilterFunctions",function(){function a(a,b){a=a.toLowerCase().trim(),b=String(b).toLowerCase();var c=a[0];return"!"===c?(a=a.substr(1),""===a?!0:-1===b.indexOf(a)):"="===c?(a=a.substr(1),a===b.trim()):(a=a.replace("\\!","!"),a=a.replace("\\=","="),-1!==b.indexOf(a))}function b(b,c,d,e){return a(b,d,d,e)}function c(a,b){b=parseFloat(b),a=a.trim();var c=a.substr(0,2),d=a[0],e=1*a.substr(1),f=1*a.substr(2);return"<="===c?f>=b:">="===c?b>=f:"<"===d?e>b:">"===d?b>e:"~"===d?Math.round(b)===e:"="===d?e===b:b.toString().indexOf(a.toString())>-1}function d(a,b,d){return c(a,d)}function e(a){for(var b=a.trim().split(","),c=0,d=0;d<b.length;d++){var e=b[d].trim(),f=h.exec(e);if(f){var i=1*f[1],j=f[2].replace(/s$/,"");g.hasOwnProperty(j)&&(c+=i*g[j])}}return c}function f(a,b){if(a=a.trim(),!a)return!0;b*=1;var c,d,f=new Date,h=+f,i=a[0],j=a.substr(1).trim();if("<"===i)return c=h-e(j),b>c;if(">"===i)return d=h-e(j),d>b;if("today"===a)return new Date(b).toDateString()===f.toDateString();if("yesterday"===a)return new Date(b).toDateString()===new Date(h-g.d).toDateString();var k=new Date(a);return isNaN(k)?!1:new Date(b).toDateString()===k.toDateString()}a.placeholder=b.placeholder="string search",a.title=b.title='Search by text, eg. "foo". Use "!" to exclude and "=" to match exact text, e.g. "!bar" or "=baz".',c.placeholder=d.placeholder="number search",c.title=d.title='Search by number, e.g. "123". Optionally use comparator expressions like ">=10" or "<1000". Use "~" for approx. int values, eg. "~3" will match "3.2"';var g={};g.second=g.sec=g.s=1e3,g.minute=g.min=g.m=60*g.second,g.hour=g.hr=g.h=60*g.minute,g.day=g.d=24*g.hour,g.week=g.wk=g.w=7*g.day,g.month=4*g.week,g.year=g.yr=g.y=365*g.day;var h=/(\d+(?:\.\d+)?)\s*([a-z]+)/;return f.placeholder="date search",f.title='Search by date. Enter a date string (RFC2822 or ISO 8601 date). You can also type "today", "yesterday", "> 2 days ago", "< 1 day 2 hours ago", etc.',{like:a,likeFormatted:b,number:c,numberFormatted:d,date:f}}),angular.module("apMesa.services.apMesaFormatFunctions",[]).service("apMesaFormatFunctions",function(){return{}}),angular.module("apMesa.services.apMesaSortFunctions",[]).service("apMesaSortFunctions",function(){return{number:function(a){return function(b,c,d){var e,f;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(e=d.getter(a,b),f=d.getter(a,c)):(e=b[a],f=c[a]),1*e-1*f}},string:function(a){return function(b,c,d){var e,f;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(e=d.getter(a,b),f=d.getter(a,c)):(e=b[a],f=c[a]),e.toString().toLowerCase().localeCompare(f.toString().toLowerCase())}},stringFormatted:function(a){return function(b,c,d,e){var f,g;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(f=d.getter(a,b),g=d.getter(a,c)):(f=b[a],g=c[a]),f=e.format(f,b,e),g=e.format(g,c,e),f.toString().toLowerCase().localeCompare(g.toString().toLowerCase())}},numberFormatted:function(a){return function(b,c,d,e){var f,g;return void 0!==d&&{}.hasOwnProperty.call(d,"getter")?(f=d.getter(a,b),g=d.getter(a,c)):(f=b[a],g=c[a]),f=e.format(f,b,e),g=e.format(g,c,e),1*f-1*g}}}}),angular.module("apMesa.templates",["src/templates/apMesa.tpl.html","src/templates/apMesaDummyRows.tpl.html","src/templates/apMesaRows.tpl.html"]),angular.module("src/templates/apMesa.tpl.html",[]).run(["$templateCache",function(a){a.put("src/templates/apMesa.tpl.html",'<div class="ap-mesa-wrapper">\n <table ng-class="classes" class="ap-mesa mesa-header-table">\n <thead>\n <tr ui-sortable="sortableOptions" ng-model="columns">\n <th\n scope="col"\n ng-repeat="column in columns"\n ng-click="toggleSort($event,column)"\n ng-class="{\'sortable-column\' : column.sort, \'select-column\': column.selector, \'is-sorting\': sortDirection[column.id] }"\n ng-attr-title="{{ column.title || \'\' }}"\n ng-style="{ width: column.width, \'min-width\': column.width, \'max-width\': column.width }"\n >\n <span class="column-text">\n <input ng-if="column.selector" type="checkbox" ng-checked="isSelectedAll()" ng-click="toggleSelectAll($event)" />\n <span\n ng-if="column.sort"\n title="This column is sortable. Click to toggle sort order. Hold shift while clicking multiple columns to stack sorting."\n class="sorting-icon {{ getSortClass( sortDirection[column.id] ) }}"\n ></span>\n {{column.hasOwnProperty(\'label\') ? column.label : column.id }}\n </span>\n <span\n ng-if="!column.lockWidth"\n ng-class="{\'discreet-width\': !!column.width, \'column-resizer\': true}"\n title="Click and drag to set discreet width. Click once to clear discreet width."\n ng-mousedown="startColumnResize($event, column)"\n >\n &nbsp;\n </span>\n </th>\n </tr>\n <tr ng-if="hasFilterFields()" class="ap-mesa-filter-row">\n <td ng-repeat="column in columns" ng-class="\'column-\' + column.id">\n <input\n type="text"\n ng-if="(column.filter)"\n ng-model="searchTerms[column.id]"\n ng-attr-placeholder="{{ column.filter && column.filter.placeholder }}"\n ng-attr-title="{{ column.filter && column.filter.title }}"\n ng-class="{\'active\': searchTerms[column.id] }"\n >\n <button\n ng-if="(column.filter)"\n ng-show="searchTerms[column.id]"\n class="clear-search-btn"\n role="button"\n type="button"\n ng-click="clearAndFocusSearch(column.id)"\n >\n &times;\n </button>\n\n </td>\n </tr>\n </thead>\n </table>\n <div class="mesa-rows-table-wrapper" ng-style="tbodyNgStyle">\n <table ng-class="classes" class="ap-mesa mesa-rows-table">\n <thead>\n <th\n scope="col"\n ng-repeat="column in columns"\n ng-style="{ width: column.width, \'min-width\': column.width, \'max-width\': column.width }"\n ></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-if="visible_rows.length === 0 || options.loading">\n <td ng-attr-colspan="{{columns.length}}" class="space-holder-row-cell">\n <div ng-if="options.loadingError">\n <div ng-if="!options.loading && options.loadingErrorTemplateUrl" ng-include="options.loadingErrorTemplateUrl"></div>\n <div ng-if="!options.loading && !options.loadingErrorTemplateUrl">{{ options.loadingErrorText }}</div>\n </div>\n <div ng-if="!options.loadingError">\n <div ng-if="options.loading && options.loadingTemplateUrl" ng-include="options.loadingTemplateUrl"></div>\n <div ng-if="options.loading && !options.loadingTemplateUrl">{{ options.loadingText }}</div>\n <div ng-if="!options.loading && options.noRowsTemplateUrl" ng-include="options.noRowsTemplateUrl"></div>\n <div ng-if="!options.loading && !options.noRowsTemplateUrl">{{ options.noRowsText }}</div>\n </div>\n </td>\n </tr>\n </tbody>\n <tbody ng-show="!options.loading" ap-mesa-dummy-rows="[0,rowOffset]" columns="columns" cell-content="..."></tbody>\n <tbody ng-show="!options.loading" ap-mesa-rows class="ap-mesa-rendered-rows"></tbody>\n <tbody ng-show="!options.loading" ap-mesa-dummy-rows="[rowOffset + visible_rows.length, filterState.filterCount]" columns="columns" cell-content="..."></tbody>\n </table>\n </div>\n</div>\n')}]),angular.module("src/templates/apMesaDummyRows.tpl.html",[]).run(["$templateCache",function(a){a.put("src/templates/apMesaDummyRows.tpl.html","")}]),angular.module("src/templates/apMesaRows.tpl.html",[]).run(["$templateCache",function(a){a.put("src/templates/apMesaRows.tpl.html",'<tr ng-repeat-start="row in visible_rows" ng-attr-class="{{ (rowOffset + $index) % 2 ? \'odd\' : \'even\' }}" ap-mesa-row></tr>\n<tr ng-repeat-end ng-if="rowIsExpanded" class="ap-mesa-expand-panel">\n <td ap-mesa-expandable ng-attr-colspan="{{ columns.length }}"></td>\n</tr>\n')}]);
{
"name": "angular-mesa",
"version": "2.6.4",
"version": "2.6.5",
"license": "Apache License, v2.0",

@@ -5,0 +5,0 @@ "dependencies": {},

@@ -82,6 +82,8 @@ /*

scope.$watch('sortDirection', updateHandler, true);
scope.$watch('rows', updateHandler);
$timeout(function() {
updateHandler(true, false);
scope.$watch('rows', function(newRows) {
if (angular.isArray(newRows)) {
updateHandler(true, false);
}
});
updateHandler(true, false);
}

@@ -88,0 +90,0 @@

@@ -30,3 +30,3 @@ 'use strict';

beforeEach(inject(function ($compile, $rootScope, $timeout) {
beforeEach(inject(function ($compile, $rootScope) {
// Format functions

@@ -96,3 +96,2 @@ function inches2feet(inches){

isoScope = element.isolateScope();
$timeout.flush();
};

@@ -99,0 +98,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc