data-filter
Advanced tools
Comparing version 2.0.0-rc.7 to 2.0.0-rc.8
@@ -1,2 +0,2 @@ | ||
/** @license Data-Engine v2.0.0-rc.7 | ||
/** @license Data-Engine v2.0.0-rc.8 | ||
* data-filter.development.js | ||
@@ -524,5 +524,5 @@ * | ||
this.sortFunc = this.defaultSort; | ||
this.setSortFunction(sortFunction); | ||
this.setPrimaryKey(primaryKey); | ||
this.setSortFunction(sortFunction); | ||
this.setData(data); | ||
this.setData(data, true); | ||
} | ||
@@ -650,3 +650,3 @@ /** | ||
this.setData = function (data) { | ||
var shouldSort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | ||
var shouldSort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
@@ -657,3 +657,3 @@ _this.data = data; | ||
} | ||
return data; | ||
return _this.data; | ||
}; | ||
@@ -669,4 +669,3 @@ | ||
this.setPrimaryKey = function (key) { | ||
if (!_this.isCustomFunction) { | ||
_this.sortFunc = _this.defaultSortWithKey; | ||
if (_this.isCustomFunction) { | ||
return; | ||
@@ -679,2 +678,3 @@ } | ||
} | ||
_this.sortFunc = _this.defaultSortWithKey; | ||
} | ||
@@ -724,3 +724,3 @@ }; | ||
if (_this.currentName) { | ||
return _this.data.sort(_this.sortFunc); | ||
_this.data = _this.data.sort(_this.sortFunc); | ||
} | ||
@@ -731,3 +731,4 @@ return _this.data; | ||
this.reverseData = function () { | ||
return _this.data.reverse(); | ||
_this.data = _this.data.reverse(); | ||
return _this.data; | ||
}; | ||
@@ -734,0 +735,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** @license Data-Engine v2.0.0-rc.7 | ||
/** @license Data-Engine v2.0.0-rc.8 | ||
* data-filter.production.min.js | ||
@@ -23,7 +23,7 @@ * | ||
break;case "object":a instanceof Date&&(b="date")}return b}} | ||
var q=Object.freeze({default:p}),r=q&&p||q,t=r.default?r.default:r,v=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;k(this,a);u.call(this);this.currentName=null;this.sortFunc=this.defaultSort;this.setPrimaryKey(c);this.setSortFunction(e);this.setData(b)}l(a,[{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"PrimaryKey", | ||
var q=Object.freeze({default:p}),r=q&&p||q,t=r.default?r.default:r,v=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;k(this,a);u.call(this);this.currentName=null;this.sortFunc=this.defaultSort;this.setSortFunction(e);this.setPrimaryKey(c);this.setData(b,!0)}l(a,[{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"PrimaryKey", | ||
set:function(a){this.setPrimaryKey(a)}}]);return a}(); | ||
function u(){var a=this;this.setData=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;a.data=b;return c?a.sortData():b};this.setSortFunction=function(b){"function"===typeof b&&(a.sortFunc=b,a.isCustomFunction=!0)};this.setPrimaryKey=function(b){a.isCustomFunction?"string"===typeof b&&0<b.length&&(a.primaryKey=b,null===a.currentName&&(a.currentName=b)):a.sortFunc=a.defaultSortWithKey};this.removePrimaryKey=function(){a.primaryKey="";a.isCustomFunction||(a.sortFunc=a.defaultSort)}; | ||
this.setDefaultSort=function(){a.isCustomFunction=!1;a.sortFunc=a.primaryKey?a.defaultSortWithKey:a.defaultSort};this.comparePrimaryKey=function(b,c){return b[a.primaryKey]>c[a.primaryKey]};this.compare=function(b,c){return b[a.currentName]>c[a.currentName]};this.sortBy=function(b){if(a.currentName===b)return a.reverseData();a.currentName=b;return a.sortData()};this.defaultSortWithKey=function(b,c){return b[a.currentName]===c[a.currentName]?a.comparePrimaryKey(b,c):a.compare(b,c)};this.defaultSort= | ||
function(b,c){return a.compare(b,c)};this.sortData=function(){return a.currentName?a.data.sort(a.sortFunc):a.data};this.reverseData=function(){return a.data.reverse()};this.getData=function(){return a.data}} | ||
function u(){var a=this;this.setData=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1;a.data=b;return c?a.sortData():a.data};this.setSortFunction=function(b){"function"===typeof b&&(a.sortFunc=b,a.isCustomFunction=!0)};this.setPrimaryKey=function(b){!a.isCustomFunction&&"string"===typeof b&&0<b.length&&(a.primaryKey=b,null===a.currentName&&(a.currentName=b),a.sortFunc=a.defaultSortWithKey)};this.removePrimaryKey=function(){a.primaryKey="";a.isCustomFunction||(a.sortFunc= | ||
a.defaultSort)};this.setDefaultSort=function(){a.isCustomFunction=!1;a.sortFunc=a.primaryKey?a.defaultSortWithKey:a.defaultSort};this.comparePrimaryKey=function(b,c){return b[a.primaryKey]>c[a.primaryKey]};this.compare=function(b,c){return b[a.currentName]>c[a.currentName]};this.sortBy=function(b){if(a.currentName===b)return a.reverseData();a.currentName=b;return a.sortData()};this.defaultSortWithKey=function(b,c){return b[a.currentName]===c[a.currentName]?a.comparePrimaryKey(b,c):a.compare(b,c)}; | ||
this.defaultSort=function(b,c){return a.compare(b,c)};this.sortData=function(){a.currentName&&(a.data=a.data.sort(a.sortFunc));return a.data};this.reverseData=function(){a.data=a.data.reverse();return a.data};this.getData=function(){return a.data}} | ||
var w=Object.freeze({default:v}),x=w&&v||w,y=x.default?x.default:x,A=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;k(this,a);z.call(this);this.filtered=b;this.filters={};this.SortEngine=c;this.Data=b}l(a,[{key:"Data",set:function(a){this.setData(a)},get:function(){return this.data}},{key:"FilteredData",get:function(){return this.getFilteredData()}},{key:"SortEngine",set:function(a){a instanceof | ||
@@ -30,0 +30,0 @@ y?(this.sortEngine=a,this.updateFce=this.filterWSort):(this.sortEngine=null,this.updateFce=this.filterWOSort)},get:function(){return this.sortEngine}}]);return a}(); |
{ | ||
"name": "data-filter", | ||
"description": "Data engine is small data management lib for some sort and filter.", | ||
"version": "2.0.0-rc.7", | ||
"version": "2.0.0-rc.8", | ||
"keywords": [ | ||
@@ -49,4 +49,4 @@ "Data", | ||
"loose-envify": "^1.1.0", | ||
"filter-value": "^2.0.0-rc.7", | ||
"data-sort": "^2.0.0-rc.7" | ||
"filter-value": "^2.0.0-rc.8", | ||
"data-sort": "^2.0.0-rc.8" | ||
}, | ||
@@ -53,0 +53,0 @@ "browserify": { |
@@ -1,2 +0,2 @@ | ||
/** @license Engine v2.0.0-rc.7 | ||
/** @license Engine v2.0.0-rc.8 | ||
* data-filter.development.js | ||
@@ -526,5 +526,5 @@ * | ||
this.sortFunc = this.defaultSort; | ||
this.setSortFunction(sortFunction); | ||
this.setPrimaryKey(primaryKey); | ||
this.setSortFunction(sortFunction); | ||
this.setData(data); | ||
this.setData(data, true); | ||
} | ||
@@ -652,3 +652,3 @@ /** | ||
this.setData = function (data) { | ||
var shouldSort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | ||
var shouldSort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
@@ -659,3 +659,3 @@ _this.data = data; | ||
} | ||
return data; | ||
return _this.data; | ||
}; | ||
@@ -671,4 +671,3 @@ | ||
this.setPrimaryKey = function (key) { | ||
if (!_this.isCustomFunction) { | ||
_this.sortFunc = _this.defaultSortWithKey; | ||
if (_this.isCustomFunction) { | ||
return; | ||
@@ -681,2 +680,3 @@ } | ||
} | ||
_this.sortFunc = _this.defaultSortWithKey; | ||
} | ||
@@ -726,3 +726,3 @@ }; | ||
if (_this.currentName) { | ||
return _this.data.sort(_this.sortFunc); | ||
_this.data = _this.data.sort(_this.sortFunc); | ||
} | ||
@@ -733,3 +733,4 @@ return _this.data; | ||
this.reverseData = function () { | ||
return _this.data.reverse(); | ||
_this.data = _this.data.reverse(); | ||
return _this.data; | ||
}; | ||
@@ -736,0 +737,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** @license Data-Engine v2.0.0-rc.7 | ||
/** @license Data-Engine v2.0.0-rc.8 | ||
* data-filter.production.min.js | ||
@@ -22,9 +22,9 @@ * | ||
d(b)){case "boolean":c="boolean";break;case "function":c="func";break;case "object":Array.isArray(b)?c="array":b instanceof RegExp?c="regexp":b.from&&b.to&&a.checkRangeAbleTypes(b.from)===a.checkRangeAbleTypes(b.to)&&(c="range")}return c};this.checkRangeAbleTypes=function(a){var b=null;switch("undefined"===typeof a?"undefined":d(a)){case "string":b="string";break;case "number":b="number";break;case "object":a instanceof Date&&(b="date")}return b}},k=Object.freeze({default:e});e=k&&e||k;var n=e.default? | ||
e.default:e;e=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;g(this,a);p.call(this);this.currentName=null;this.sortFunc=this.defaultSort;this.setPrimaryKey(c);this.setSortFunction(d);this.setData(b)}f(a,[{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"PrimaryKey",set:function(a){this.setPrimaryKey(a)}}]);return a}(); | ||
var p=function(){var a=this;this.setData=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;a.data=b;return c?a.sortData():b};this.setSortFunction=function(b){"function"===typeof b&&(a.sortFunc=b,a.isCustomFunction=!0)};this.setPrimaryKey=function(b){a.isCustomFunction?"string"===typeof b&&0<b.length&&(a.primaryKey=b,null===a.currentName&&(a.currentName=b)):a.sortFunc=a.defaultSortWithKey};this.removePrimaryKey=function(){a.primaryKey="";a.isCustomFunction||(a.sortFunc=a.defaultSort)}; | ||
this.setDefaultSort=function(){a.isCustomFunction=!1;a.sortFunc=a.primaryKey?a.defaultSortWithKey:a.defaultSort};this.comparePrimaryKey=function(b,c){return b[a.primaryKey]>c[a.primaryKey]};this.compare=function(b,c){return b[a.currentName]>c[a.currentName]};this.sortBy=function(b){if(a.currentName===b)return a.reverseData();a.currentName=b;return a.sortData()};this.defaultSortWithKey=function(b,c){return b[a.currentName]===c[a.currentName]?a.comparePrimaryKey(b,c):a.compare(b,c)};this.defaultSort= | ||
function(b,c){return a.compare(b,c)};this.sortData=function(){return a.currentName?a.data.sort(a.sortFunc):a.data};this.reverseData=function(){return a.data.reverse()};this.getData=function(){return a.data}};e=(k=Object.freeze({default:e}))&&e||k;var q=e.default?e.default:e;e=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;g(this,a);r.call(this);this.filtered=b;this.filters={};this.SortEngine=c; | ||
this.Data=b}f(a,[{key:"Data",set:function(a){this.setData(a)},get:function(){return this.data}},{key:"FilteredData",get:function(){return this.getFilteredData()}},{key:"SortEngine",set:function(a){a instanceof q?(this.sortEngine=a,this.updateFce=this.filterWSort):(this.sortEngine=null,this.updateFce=this.filterWOSort)},get:function(){return this.sortEngine}}]);return a}();var r=function(){var a=this;this.updateFce=this.filterWOSort;this.setData=function(b){a.data=b;return a.updateFilter()};this.update= | ||
function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];var e=a.getFilteredData;c.forEach(function(b){if(!(b instanceof n))throw new TypeError(b+" has to have filterValue instance");a.filters[b.Name]=b;e=a.updateFilter});return e()};this.removeFilters=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];var e=a.getFilteredData;c.forEach(function(b){b="string"===typeof b?b:b.Name;a.filters[b]&&(delete a.filters[b],e=a.updateFilter)});return e()};this.clearFilters= | ||
function(){a.filters={};a.filtered=a.data;return a.getFilteredData()};this.updateFilter=function(){if(null===a.data)throw Error("Data are null and cannot be filtered!");a.filtered=a.data.filter(a.filterAll);return a.getFilteredData()};this.filterAll=function(b){return Object.keys(a.filters).every(function(c){return a.filters[c].compare(b[c])})};this.getFilteredData=function(){return a.updateFce()};this.filterWOSort=function(){return a.filtered};this.filterWSort=function(){return a.SortEngine.setData(a.filtered)}; | ||
this.getFilter=function(b){return a.filters[b]?a.filters[b]:null}};e=(k=Object.freeze({default:e}))&&e||k;return e.default?e.default:e}); | ||
e.default:e;e=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;g(this,a);p.call(this);this.currentName=null;this.sortFunc=this.defaultSort;this.setSortFunction(d);this.setPrimaryKey(c);this.setData(b,!0)}f(a,[{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"PrimaryKey",set:function(a){this.setPrimaryKey(a)}}]);return a}(); | ||
var p=function(){var a=this;this.setData=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1;a.data=b;return c?a.sortData():a.data};this.setSortFunction=function(b){"function"===typeof b&&(a.sortFunc=b,a.isCustomFunction=!0)};this.setPrimaryKey=function(b){!a.isCustomFunction&&"string"===typeof b&&0<b.length&&(a.primaryKey=b,null===a.currentName&&(a.currentName=b),a.sortFunc=a.defaultSortWithKey)};this.removePrimaryKey=function(){a.primaryKey="";a.isCustomFunction||(a.sortFunc= | ||
a.defaultSort)};this.setDefaultSort=function(){a.isCustomFunction=!1;a.sortFunc=a.primaryKey?a.defaultSortWithKey:a.defaultSort};this.comparePrimaryKey=function(b,c){return b[a.primaryKey]>c[a.primaryKey]};this.compare=function(b,c){return b[a.currentName]>c[a.currentName]};this.sortBy=function(b){if(a.currentName===b)return a.reverseData();a.currentName=b;return a.sortData()};this.defaultSortWithKey=function(b,c){return b[a.currentName]===c[a.currentName]?a.comparePrimaryKey(b,c):a.compare(b,c)}; | ||
this.defaultSort=function(b,c){return a.compare(b,c)};this.sortData=function(){a.currentName&&(a.data=a.data.sort(a.sortFunc));return a.data};this.reverseData=function(){a.data=a.data.reverse();return a.data};this.getData=function(){return a.data}};e=(k=Object.freeze({default:e}))&&e||k;var q=e.default?e.default:e;e=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;g(this,a);r.call(this);this.filtered= | ||
b;this.filters={};this.SortEngine=c;this.Data=b}f(a,[{key:"Data",set:function(a){this.setData(a)},get:function(){return this.data}},{key:"FilteredData",get:function(){return this.getFilteredData()}},{key:"SortEngine",set:function(a){a instanceof q?(this.sortEngine=a,this.updateFce=this.filterWSort):(this.sortEngine=null,this.updateFce=this.filterWOSort)},get:function(){return this.sortEngine}}]);return a}();var r=function(){var a=this;this.updateFce=this.filterWOSort;this.setData=function(b){a.data= | ||
b;return a.updateFilter()};this.update=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];var e=a.getFilteredData;c.forEach(function(b){if(!(b instanceof n))throw new TypeError(b+" has to have filterValue instance");a.filters[b.Name]=b;e=a.updateFilter});return e()};this.removeFilters=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];var e=a.getFilteredData;c.forEach(function(b){b="string"===typeof b?b:b.Name;a.filters[b]&&(delete a.filters[b], | ||
e=a.updateFilter)});return e()};this.clearFilters=function(){a.filters={};a.filtered=a.data;return a.getFilteredData()};this.updateFilter=function(){if(null===a.data)throw Error("Data are null and cannot be filtered!");a.filtered=a.data.filter(a.filterAll);return a.getFilteredData()};this.filterAll=function(b){return Object.keys(a.filters).every(function(c){return a.filters[c].compare(b[c])})};this.getFilteredData=function(){return a.updateFce()};this.filterWOSort=function(){return a.filtered};this.filterWSort= | ||
function(){return a.SortEngine.setData(a.filtered)};this.getFilter=function(b){return a.filters[b]?a.filters[b]:null}};e=(k=Object.freeze({default:e}))&&e||k;return e.default?e.default:e}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73823
1789
Updateddata-sort@^2.0.0-rc.8
Updatedfilter-value@^2.0.0-rc.8