From cc1b2216cb9891574cdb94bb429c5db032f1b138 Mon Sep 17 00:00:00 2001 From: Istvan Fodor Date: Fri, 22 Jul 2016 16:38:37 +0200 Subject: [PATCH] Generate release --- dist/md-data-table-templates.js | 2 +- dist/md-data-table.js | 391 ++++++++++++++++---------------- 2 files changed, 202 insertions(+), 191 deletions(-) diff --git a/dist/md-data-table-templates.js b/dist/md-data-table-templates.js index d7f1a34..f35c3f8 100644 --- a/dist/md-data-table-templates.js +++ b/dist/md-data-table-templates.js @@ -1,4 +1,4 @@ -angular.module("mdtTemplates", []).run(["$templateCache", function($templateCache) {$templateCache.put("/main/templates/generateRows.html","\r\n\r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n {{mdtPaginationHelper.mdtRowPaginatorErrorMessage}}\r\n \r\n"); +angular.module("mdtTemplates", []).run(["$templateCache", function($templateCache) {$templateCache.put("/main/templates/generateRows.html","\r\n\r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n {{mdtPaginationHelper.mdtRowPaginatorErrorMessage}}\r\n \r\n\r\n\r\n \r\n {{mdtPaginationHelper.mdtRowPaginatorNoResultsMessage}}\r\n \r\n"); $templateCache.put("/main/templates/generateRowsVirtualRepeat.html","\r\n\r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n {{mdtPaginationHelper.mdtRowPaginatorErrorMessage}}\r\n \r\n"); $templateCache.put("/main/templates/generateTable.html","\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n\r\n \r\n
"); $templateCache.put("/main/templates/largeEditDialog.html","\r\n \r\n
\r\n

{{cellData.attributes.editableFieldTitle}}

\r\n \r\n\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n Save\r\n Cancel\r\n \r\n
"); diff --git a/dist/md-data-table.js b/dist/md-data-table.js index 9c017c8..4837037 100644 --- a/dist/md-data-table.js +++ b/dist/md-data-table.js @@ -46,6 +46,40 @@ (function(){ 'use strict'; + InlineEditModalCtrl.$inject = ['$scope', 'position', 'cellData', '$timeout', '$mdDialog']; + function InlineEditModalCtrl($scope, position, cellData, $timeout, $mdDialog){ + + $timeout(function() { + var el = $('md-dialog'); + el.css('position', 'fixed'); + el.css('top', position['top']); + el.css('left', position['left']); + + el.find('input[type="text"]').focus(); + }); + + $scope.cellData = cellData; + $scope.saveRow = saveRow; + $scope.cancel = cancel; + + function saveRow(){ + if($scope.editFieldForm.$valid){ + $mdDialog.hide(cellData.value); + } + } + + function cancel(){ + $mdDialog.cancel(); + } + } + + angular + .module('mdDataTable') + .controller('InlineEditModalCtrl', InlineEditModalCtrl); +}()); +(function(){ + 'use strict'; + function mdtAlternateHeadersDirective(){ return { restrict: 'E', @@ -145,6 +179,8 @@ * @param {string=} mdtRowPaginatorErrorMessage overrides default error message when promise gets rejected by the * paginator function. * + * @param {string=} mdtRowPaginatorNoResultsMessage overrides default 'no results' message. + * * @param {function(loadPageCallback)=} mdtTriggerRequest provide a callback function for manually triggering an * ajax request. Can be useful when you want to populate the results in the table manually. (e.g.: having a * search field in your page which then can trigger a new request in the table to show the results based on @@ -194,6 +230,7 @@ mdtRow: '=', mdtRowPaginator: '&?', mdtRowPaginatorErrorMessage:"@", + mdtRowPaginatorNoResultsMessage:"@", virtualRepeat: '=', mdtTriggerRequest: '&?' }, @@ -358,40 +395,6 @@ (function(){ 'use strict'; - InlineEditModalCtrl.$inject = ['$scope', 'position', 'cellData', '$timeout', '$mdDialog']; - function InlineEditModalCtrl($scope, position, cellData, $timeout, $mdDialog){ - - $timeout(function() { - var el = $('md-dialog'); - el.css('position', 'fixed'); - el.css('top', position['top']); - el.css('left', position['left']); - - el.find('input[type="text"]').focus(); - }); - - $scope.cellData = cellData; - $scope.saveRow = saveRow; - $scope.cancel = cancel; - - function saveRow(){ - if($scope.editFieldForm.$valid){ - $mdDialog.hide(cellData.value); - } - } - - function cancel(){ - $mdDialog.cancel(); - } - } - - angular - .module('mdDataTable') - .controller('InlineEditModalCtrl', InlineEditModalCtrl); -}()); -(function(){ - 'use strict'; - function mdtAjaxPaginationHelperFactory(){ function mdtAjaxPaginationHelper(params){ @@ -399,6 +402,7 @@ this.rowOptions = params.mdtRowOptions; this.paginatorFunction = params.mdtRowPaginatorFunction; this.mdtRowPaginatorErrorMessage = params.mdtRowPaginatorErrorMessage || 'Ajax error during loading contents.'; + this.mdtRowPaginatorNoResultsMessage = params.mdtRowPaginatorNoResultsMessage || 'No results.'; this.mdtTriggerRequest = params.mdtTriggerRequest; if(params.paginationSetting && @@ -474,6 +478,12 @@ that.totalResultCount = data.totalResultCount; that.totalPages = Math.ceil(data.totalResultCount / that.rowsPerPage); + if(that.totalResultCount == 0){ + that.isNoResults = true; + }else{ + that.isNoResults = false; + } + that.isLoadError = false; that.isLoading = false; @@ -482,6 +492,7 @@ that.isLoadError = true; that.isLoading = false; + that.isNoResults = true; }); }; @@ -793,27 +804,6 @@ (function(){ 'use strict'; - ColumnAlignmentHelper.$inject = ['ColumnOptionProvider']; - function ColumnAlignmentHelper(ColumnOptionProvider){ - var service = this; - service.getColumnAlignClass = getColumnAlignClass; - - function getColumnAlignClass(alignRule) { - if (alignRule === ColumnOptionProvider.ALIGN_RULE.ALIGN_RIGHT) { - return 'rightAlignedColumn'; - } else { - return 'leftAlignedColumn'; - } - } - } - - angular - .module('mdDataTable') - .service('ColumnAlignmentHelper', ColumnAlignmentHelper); -}()); -(function(){ - 'use strict'; - /** * @name ColumnOptionProvider * @returns possible assignable column options you can give @@ -832,6 +822,27 @@ .value('ColumnOptionProvider', ColumnOptionProvider); })(); +(function(){ + 'use strict'; + + ColumnAlignmentHelper.$inject = ['ColumnOptionProvider']; + function ColumnAlignmentHelper(ColumnOptionProvider){ + var service = this; + service.getColumnAlignClass = getColumnAlignClass; + + function getColumnAlignClass(alignRule) { + if (alignRule === ColumnOptionProvider.ALIGN_RULE.ALIGN_RIGHT) { + return 'rightAlignedColumn'; + } else { + return 'leftAlignedColumn'; + } + } + } + + angular + .module('mdDataTable') + .service('ColumnAlignmentHelper', ColumnAlignmentHelper); +}()); (function(){ 'use strict'; @@ -987,141 +998,6 @@ (function(){ 'use strict'; - /** - * @ngdoc directive - * @name mdtColumn - * @restrict E - * @requires mdtTable - * - * @description - * Representing a header column cell which should be placed inside `mdt-header-row` element directive. - * - * @param {string=} alignRule align cell content. This settings will have affect on each data cells in the same - * column (e.g. every x.th cell in every row). - * - * Assignable values: - * - 'left' - * - 'right' - * - * @param {function()=} sortBy compareFunction callback for sorting the column data's. As every compare function, - * should get two parameters and return with the comapred result (-1,1,0) - * - * @param {string=} columnDefinition displays a tooltip on hover. - * - * @example - *
-     *  
-     *      
-     *          Product name
-     *          Price
-     *      
-     *
-     *      
-     *          {{product.name}}
-     *          {{product.price}}
-     *      
-     *  
-     * 
- */ - mdtColumnDirective.$inject = ['$parse']; - function mdtColumnDirective($parse){ - return { - restrict: 'E', - transclude: true, - replace: true, - scope: { - alignRule: '@', - sortBy: '=', - columnDefinition: '@' - }, - require: ['^mdtTable'], - link: function ($scope, element, attrs, ctrl, transclude) { - var mdtTableCtrl = ctrl[0]; - - transclude(function (clone) { - var cellValue; - - if(clone.html().indexOf('{{') !== -1){ - cellValue = $parse(clone.html().replace('{{', '').replace('}}', ''))($scope.$parent); - }else{ - cellValue = clone.html(); - } - - mdtTableCtrl.addHeaderCell({ - alignRule: $scope.alignRule, - sortBy: $scope.sortBy, - columnDefinition: $scope.columnDefinition, - columnName: cellValue - }); - }); - } - }; - } - - angular - .module('mdDataTable') - .directive('mdtColumn', mdtColumnDirective); -}()); -(function(){ - 'use strict'; - - function mdtGeneratedHeaderCellContentDirective(){ - return { - restrict: 'E', - templateUrl: '/main/templates/mdtGeneratedHeaderCellContent.html', - replace: true, - scope: false, - link: function(){} - }; - } - - angular - .module('mdDataTable') - .directive('mdtGeneratedHeaderCellContent', mdtGeneratedHeaderCellContentDirective); -}()); - -(function(){ - 'use strict'; - - /** - * @ngdoc directive - * @name mdtHeaderRow - * @restrict E - * @requires mdtTable - * - * @description - * Representing a header row which should be placed inside `mdt-table` element directive. - * The main responsibility of this directive is to execute all the transcluded `mdt-column` element directives. - * - */ - function mdtHeaderRowDirective(){ - return { - restrict: 'E', - replace: true, - transclude: true, - require: '^mdtTable', - scope: true, - link: function($scope, element, attrs, mdtCtrl, transclude){ - appendColumns(); - - function appendColumns(){ - transclude(function (clone) { - element.append(clone); - }); - } - } - }; - } - - angular - .module('mdDataTable') - .directive('mdtHeaderRow', mdtHeaderRowDirective); -}()); -(function(){ - 'use strict'; - mdtAddAlignClass.$inject = ['ColumnAlignmentHelper']; function mdtAddAlignClass(ColumnAlignmentHelper){ return { @@ -1296,6 +1172,141 @@ (function(){ 'use strict'; + /** + * @ngdoc directive + * @name mdtColumn + * @restrict E + * @requires mdtTable + * + * @description + * Representing a header column cell which should be placed inside `mdt-header-row` element directive. + * + * @param {string=} alignRule align cell content. This settings will have affect on each data cells in the same + * column (e.g. every x.th cell in every row). + * + * Assignable values: + * - 'left' + * - 'right' + * + * @param {function()=} sortBy compareFunction callback for sorting the column data's. As every compare function, + * should get two parameters and return with the comapred result (-1,1,0) + * + * @param {string=} columnDefinition displays a tooltip on hover. + * + * @example + *
+     *  
+     *      
+     *          Product name
+     *          Price
+     *      
+     *
+     *      
+     *          {{product.name}}
+     *          {{product.price}}
+     *      
+     *  
+     * 
+ */ + mdtColumnDirective.$inject = ['$parse']; + function mdtColumnDirective($parse){ + return { + restrict: 'E', + transclude: true, + replace: true, + scope: { + alignRule: '@', + sortBy: '=', + columnDefinition: '@' + }, + require: ['^mdtTable'], + link: function ($scope, element, attrs, ctrl, transclude) { + var mdtTableCtrl = ctrl[0]; + + transclude(function (clone) { + var cellValue; + + if(clone.html().indexOf('{{') !== -1){ + cellValue = $parse(clone.html().replace('{{', '').replace('}}', ''))($scope.$parent); + }else{ + cellValue = clone.html(); + } + + mdtTableCtrl.addHeaderCell({ + alignRule: $scope.alignRule, + sortBy: $scope.sortBy, + columnDefinition: $scope.columnDefinition, + columnName: cellValue + }); + }); + } + }; + } + + angular + .module('mdDataTable') + .directive('mdtColumn', mdtColumnDirective); +}()); +(function(){ + 'use strict'; + + function mdtGeneratedHeaderCellContentDirective(){ + return { + restrict: 'E', + templateUrl: '/main/templates/mdtGeneratedHeaderCellContent.html', + replace: true, + scope: false, + link: function(){} + }; + } + + angular + .module('mdDataTable') + .directive('mdtGeneratedHeaderCellContent', mdtGeneratedHeaderCellContentDirective); +}()); + +(function(){ + 'use strict'; + + /** + * @ngdoc directive + * @name mdtHeaderRow + * @restrict E + * @requires mdtTable + * + * @description + * Representing a header row which should be placed inside `mdt-table` element directive. + * The main responsibility of this directive is to execute all the transcluded `mdt-column` element directives. + * + */ + function mdtHeaderRowDirective(){ + return { + restrict: 'E', + replace: true, + transclude: true, + require: '^mdtTable', + scope: true, + link: function($scope, element, attrs, mdtCtrl, transclude){ + appendColumns(); + + function appendColumns(){ + transclude(function (clone) { + element.append(clone); + }); + } + } + }; + } + + angular + .module('mdDataTable') + .directive('mdtHeaderRow', mdtHeaderRowDirective); +}()); +(function(){ + 'use strict'; + function mdtCardFooterDirective(){ return { restrict: 'E',