-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): 1.0.0 distribution files
- Loading branch information
1 parent
a6b2a9f
commit d635559
Showing
7 changed files
with
98 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,15 +218,15 @@ | |
|
||
///////// | ||
|
||
function getTemplateUrl(filterValue, filterKey){ | ||
if (angular.isObject(filterValue)){ | ||
filterValue = filterValue.id; | ||
function getTemplateUrl(filterDef, filterKey){ | ||
if (angular.isObject(filterDef)){ | ||
filterDef = filterDef.id; | ||
} | ||
if (filterValue.indexOf('/') !== -1){ | ||
return filterValue; | ||
if (filterDef.indexOf('/') !== -1){ | ||
return filterDef; | ||
} | ||
|
||
return service.getUrlForAlias(filterValue, filterKey); | ||
return service.getUrlForAlias(filterDef, filterKey); | ||
} | ||
|
||
function getUrlForAlias(aliasName/*, filterKey*/){ | ||
|
@@ -371,43 +371,6 @@ | |
} | ||
})(); | ||
|
||
/** | ||
* ngTable: Table + Angular JS | ||
* | ||
* @author Vitalii Savchuk <[email protected]> | ||
* @url https://github.com/esvit/ng-table/ | ||
* @license New BSD License <http://creativecommons.org/licenses/BSD/> | ||
*/ | ||
|
||
(function(){ | ||
'use strict'; | ||
|
||
// todo: remove shim after an acceptable depreciation period | ||
|
||
angular.module('ngTable') | ||
.factory('ngTableGetDataBcShim', ngTableGetDataBcShim); | ||
|
||
ngTableGetDataBcShim.$inject = ['$q']; | ||
|
||
function ngTableGetDataBcShim($q){ | ||
|
||
return createWrapper; | ||
|
||
function createWrapper(getDataFn){ | ||
return function getDataShim(/*args*/){ | ||
var $defer = $q.defer(); | ||
var pData = getDataFn.apply(this, [$defer].concat(Array.prototype.slice.call(arguments))); | ||
if (!pData) { | ||
// If getData resolved the $defer, and didn't promise us data, | ||
// create a promise from the $defer. We need to return a promise. | ||
pData = $defer.promise; | ||
} | ||
return pData; | ||
} | ||
} | ||
} | ||
})(); | ||
|
||
/** | ||
* ngTable: Table + Angular JS | ||
* | ||
|
@@ -546,7 +509,7 @@ | |
* @description Parameters manager for ngTable | ||
*/ | ||
|
||
angular.module('ngTable').factory('NgTableParams', ['$q', '$log', '$filter', 'ngTableDefaults', 'ngTableGetDataBcShim', 'ngTableDefaultGetData', 'ngTableEventsChannel', function($q, $log, $filter, ngTableDefaults, ngTableGetDataBcShim, ngTableDefaultGetData, ngTableEventsChannel) { | ||
angular.module('ngTable').factory('NgTableParams', ['$q', '$log', '$filter', 'ngTableDefaults', 'ngTableDefaultGetData', 'ngTableEventsChannel', function($q, $log, $filter, ngTableDefaults, ngTableDefaultGetData, ngTableEventsChannel) { | ||
var isNumber = function(n) { | ||
return !isNaN(parseFloat(n)) && isFinite(n); | ||
}; | ||
|
@@ -676,16 +639,6 @@ | |
newSettings.total = newSettings.dataset.length; | ||
} | ||
|
||
// todo: remove the backwards compatibility shim and the following two if blocks | ||
if (newSettings.getData && newSettings.getData.length > 1){ | ||
// support the old getData($defer, params) api | ||
newSettings.getDataFnAdaptor = ngTableGetDataBcShim; | ||
} | ||
if (newSettings.getGroups && newSettings.getGroups.length > 2){ | ||
// support the old getGroups($defer, params) api | ||
newSettings.getGroupsFnAdaptor = ngTableGetDataBcShim; | ||
} | ||
|
||
var originalDataset = settings.dataset; | ||
settings = angular.extend(settings, newSettings); | ||
|
||
|
@@ -1090,9 +1043,9 @@ | |
isCommittedDataset = true; | ||
|
||
if (self.hasGroup()) { | ||
pData = runInterceptorPipeline(runGetGroups); | ||
pData = runInterceptorPipeline($q.when(settings.getGroups(self))); | ||
} else { | ||
pData = runInterceptorPipeline(runGetData); | ||
pData = runInterceptorPipeline($q.when(settings.getData(self))); | ||
} | ||
|
||
log('ngTable: reload data'); | ||
|
@@ -1108,11 +1061,6 @@ | |
ngTableEventsChannel.publishAfterReloadData(self, data, oldData); | ||
self.reloadPages(); | ||
|
||
// todo: remove after acceptable depreciation period | ||
if (settings.$scope) { | ||
settings.$scope.$emit('ngTableAfterReloadData'); | ||
} | ||
|
||
return data; | ||
}).catch(function(reason){ | ||
errParamsMemento = prevParamsMemento; | ||
|
@@ -1155,17 +1103,7 @@ | |
} | ||
})(); | ||
|
||
function runGetData(){ | ||
var getDataFn = settings.getDataFnAdaptor(settings.getData); | ||
return $q.when(getDataFn.call(settings, self)); | ||
} | ||
|
||
function runGetGroups(){ | ||
var getGroupsFn = settings.getGroupsFnAdaptor(settings.getGroups); | ||
return $q.when(getGroupsFn.call(settings, self)); | ||
} | ||
|
||
function runInterceptorPipeline(fetchFn){ | ||
function runInterceptorPipeline(fetchedData){ | ||
var interceptors = settings.interceptors || []; | ||
|
||
return interceptors.reduce(function(result, interceptor){ | ||
|
@@ -1176,14 +1114,12 @@ | |
}, function(reason){ | ||
return rejectFn(reason, self); | ||
}); | ||
}, fetchFn()); | ||
}, fetchedData); | ||
} | ||
|
||
function getDefaultSettingFns(){ | ||
|
||
return { | ||
getDataFnAdaptor: angular.identity, | ||
getGroupsFnAdaptor: angular.identity, | ||
getData: getData, | ||
getGroups: getGroups | ||
}; | ||
|
@@ -1231,8 +1167,7 @@ | |
var settings = params.settings(); | ||
var originalDataOptions = settings.dataOptions; | ||
settings.dataOptions = { applyPaging: false }; | ||
var adaptedFn = settings.getDataFnAdaptor(settings.getData); | ||
var gotData = $q.when(adaptedFn.call(settings, params)); | ||
var gotData = $q.when(settings.getData(params)); | ||
return gotData.then(function(data) { | ||
var groups = {}; | ||
angular.forEach(data, function(item) { | ||
|
@@ -1300,8 +1235,6 @@ | |
* @description configuration settings for `NgTableParams` | ||
*/ | ||
var settings = { | ||
// todo: remove $scope after acceptable depreciation period as no longer required | ||
$scope: null, // set by ngTable controller | ||
$loading: false, | ||
dataset: null, //allows data to be set when table is initialized | ||
total: 0, | ||
|
@@ -1332,15 +1265,6 @@ | |
}; | ||
return NgTableParams; | ||
}]); | ||
|
||
/** | ||
* @ngdoc service | ||
* @name ngTableParams | ||
* @description Backwards compatible shim for lowercase 'n' in NgTableParams | ||
*/ | ||
angular.module('ngTable').factory('ngTableParams', ['NgTableParams', function(NgTableParams) { | ||
return NgTableParams; | ||
}]); | ||
})(); | ||
|
||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ng-table", | ||
"version": "1.0.0-beta.9", | ||
"version": "1.0.0", | ||
"author": "Vitalii Savchuk <[email protected]>", | ||
"license": "BSD", | ||
"repository": { | ||
|