diff --git a/.editorconfig b/.editorconfig index c2cdfb8ada..300bead886 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,20 +1,17 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - root = true - [*] - -# Change these settings to your own preference -indent_style = space -indent_size = 2 - -# We recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true +indent_brace_style = K&R +curly_bracket_next_line = false +spaces_around_operators = true +max_line_length = 120 +tab_width = 2 +indent_style = space +indent_size = 2 +continuation_indent_size = 4 insert_final_newline = true [*.md] diff --git a/.gitattributes b/.gitattributes index 412eeda78d..930429ee44 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Auto detect text files and perform LF normalization -* text=auto +* text eol=lf # Custom for Visual Studio *.cs diff=csharp diff --git a/.gitignore b/.gitignore index 7783b47656..3bdc2b01fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -c################# +################# ## Vim ################# @@ -199,4 +199,4 @@ Sauce-Connect.jar docs bower_components .grunt -coverage/ +coverage/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c65772e0c..f123c0c1ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ + +## [4.4.10](https://github.com/angular-ui/ui-grid/compare/v4.4.9...v4.4.10) (2018-05-15) + + +### Bug Fixes + +* **ui-grid-menu-button.js:** Change "Columns:" item to a heading. ([85ad462](https://github.com/angular-ui/ui-grid/commit/85ad462)) +* **ui-grid-util.js:** Replace angular.uppercase and .lowercase with String.toUpperCase and .toLowerC ([a41677a](https://github.com/angular-ui/ui-grid/commit/a41677a)), closes [#6715](https://github.com/angular-ui/ui-grid/issues/6715) + + + ## [4.4.9](https://github.com/angular-ui/ui-grid/compare/v4.4.7...v4.4.9) (2018-04-30) diff --git a/bower.json b/bower.json index a5391880df..f6c3730213 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-ui-grid", - "version": "4.4.9", + "version": "4.4.10", "homepage": "http://ui-grid.info", "repository": { "type": "git", diff --git a/grunt/bump.js b/grunt/bump.js index 408ca462bc..60b4212748 100644 --- a/grunt/bump.js +++ b/grunt/bump.js @@ -1,7 +1,7 @@ module.exports = { options: { - files: ['package.json', 'bower.json'], - commitFiles: ['package.json', 'bower.json', 'CHANGELOG.md'], + files: ['package.json', 'package-lock.json', 'bower.json'], + commitFiles: ['package.json', 'package-lock.json', 'bower.json', 'CHANGELOG.md'], push: false, commitMessage: 'chore: Release v%VERSION%' } diff --git a/grunt/jshint.js b/grunt/jshint.js index b6afcddc80..1b678fe04b 100644 --- a/grunt/jshint.js +++ b/grunt/jshint.js @@ -2,8 +2,12 @@ module.exports = { options: { reporter: require('jshint-stylish'), - curly: true, - eqeqeq: true, + curly: false, + expr: true, + asi: true, + laxbreak: true, + eqeqeq: false, + lastsemic: false, immed: true, latedef: false, newcap: true, diff --git a/package-lock.json b/package-lock.json index e92427f90a..596cf09ec1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ui-grid", - "version": "4.4.9", + "version": "4.4.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 16410600e1..b73081060d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui-grid", - "version": "4.4.9", + "version": "4.4.10", "description": "A data grid for Angular", "directories": { "test": "test" diff --git a/src/js/core/directives/ui-grid-menu-button.js b/src/js/core/directives/ui-grid-menu-button.js index f14b6b3c0a..1bf1f6836a 100644 --- a/src/js/core/directives/ui-grid-menu-button.js +++ b/src/js/core/directives/ui-grid-menu-button.js @@ -257,7 +257,8 @@ angular.module('ui.grid') // add header for columns showHideColumns.push({ title: i18nService.getSafeText('gridMenu.columns'), - order: 300 + order: 300, + templateUrl: 'ui-grid/ui-grid-menu-header-item' }); $scope.grid.options.gridMenuTitleFilter = $scope.grid.options.gridMenuTitleFilter ? $scope.grid.options.gridMenuTitleFilter : function( title ) { return title; }; diff --git a/src/js/core/directives/ui-grid-menu.js b/src/js/core/directives/ui-grid-menu.js index 72ff63a154..5c580f16b4 100644 --- a/src/js/core/directives/ui-grid-menu.js +++ b/src/js/core/directives/ui-grid-menu.js @@ -220,7 +220,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18 }]) .directive('uiGridMenuItem', ['gridUtil', '$compile', 'i18nService', function (gridUtil, $compile, i18nService) { - var uiGridMenuItem = { + return { priority: 0, scope: { name: '=', @@ -321,8 +321,6 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18 }; } }; - - return uiGridMenuItem; }]); })(); diff --git a/src/js/core/services/ui-grid-util.js b/src/js/core/services/ui-grid-util.js index d1af3c04d1..d2f40e3719 100644 --- a/src/js/core/services/ui-grid-util.js +++ b/src/js/core/services/ui-grid-util.js @@ -243,11 +243,11 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC return columnName.replace(/_+/g, ' ') // Replace a completely all-capsed word with a first-letter-capitalized version .replace(/^[A-Z]+$/, function (match) { - return angular.lowercase(angular.uppercase(match.charAt(0)) + match.slice(1)); + return match.toLowerCase(); }) // Capitalize the first letter of words .replace(/([\w\u00C0-\u017F]+)/g, function (match) { - return angular.uppercase(match.charAt(0)) + match.slice(1); + return match.charAt(0).toUpperCase() + match.slice(1); }) // Put a space in between words that have partial capilizations (i.e. 'firstName' becomes 'First Name') // .replace(/([A-Z]|[A-Z]\w+)([A-Z])/g, "$1 $2"); diff --git a/src/less/menu.less b/src/less/menu.less index 2bb2225679..e31228c059 100644 --- a/src/less/menu.less +++ b/src/less/menu.less @@ -57,14 +57,18 @@ list-style-type: none; li { - padding: 0px; - button { + padding: 0; + .ui-grid-menu-item { color: @menuTextColor; min-width: 100%; padding: 8px; text-align: left; background: transparent; border: none; + cursor: default; + } + button.ui-grid-menu-item { + cursor: pointer; // Show a shadow when hovering over a menu item &:hover, @@ -78,7 +82,7 @@ } // Show a bottom border on all but the last menu item - li:not(:last-child) > button { + li:not(:last-child) > .ui-grid-menu-item { border-bottom: @gridBorderWidth solid @borderColor; } } diff --git a/src/templates/ui-grid/ui-grid-menu-header-item.html b/src/templates/ui-grid/ui-grid-menu-header-item.html new file mode 100644 index 0000000000..d878f0fa21 --- /dev/null +++ b/src/templates/ui-grid/ui-grid-menu-header-item.html @@ -0,0 +1,12 @@ +