Skip to content

Commit 1ffc606

Browse files
v4.11.0
1 parent 18ce14b commit 1ffc606

File tree

152 files changed

+306
-193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+306
-193
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [4.11.0](https://github.com/angular-ui/ui-grid/compare/v4.10.3...v4.11.0) (2021-08-12)
7+
8+
9+
### Bug Fixes
10+
11+
* 🐛 ensure viewport height cannot be negative ([a7111a1](https://github.com/angular-ui/ui-grid/commit/a7111a13b4c7d67068522881783925dedbacda88)), closes [#3034](https://github.com/angular-ui/ui-grid/issues/3034)
12+
13+
14+
### Features
15+
16+
* 🎸 option to disable multi-column sorting ([c9abb8b](https://github.com/angular-ui/ui-grid/commit/c9abb8bab2101479b0498848b4a288c1ad7d17f9)), closes [#2913](https://github.com/angular-ui/ui-grid/issues/2913)
17+
* 🎸 the ability to disable hide columns on a grid level ([2dd1688](https://github.com/angular-ui/ui-grid/commit/2dd168859e03583cdc7e6ab671d146e343ae4275)), closes [#1604](https://github.com/angular-ui/ui-grid/issues/1604)
18+
19+
20+
21+
22+
623
## [4.10.3](https://github.com/angular-ui/ui-grid/compare/v4.10.2...v4.10.3) (2021-08-01)
724

825

css/ui-grid.core.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.10.3 - 2021-08-01
2+
* ui-grid - v4.11.0 - 2021-08-12
33
* Copyright (c) 2021 ; License: MIT
44
*/
55
.ui-grid {

css/ui-grid.core.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

i18n/ui-grid.auto-resize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.10.3 - 2021-08-01
2+
* ui-grid - v4.11.0 - 2021-08-12
33
* Copyright (c) 2021 ; License: MIT
44
*/
55

i18n/ui-grid.auto-resize.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.10.3 - 2021-08-01
2+
* ui-grid - v4.11.0 - 2021-08-12
33
* Copyright (c) 2021 ; License: MIT
44
*/
55

i18n/ui-grid.cellnav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.10.3 - 2021-08-01
2+
* ui-grid - v4.11.0 - 2021-08-12
33
* Copyright (c) 2021 ; License: MIT
44
*/
55

i18n/ui-grid.cellnav.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

i18n/ui-grid.core.js

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.10.3 - 2021-08-01
2+
* ui-grid - v4.11.0 - 2021-08-12
33
* Copyright (c) 2021 ; License: MIT
44
*/
55

@@ -423,6 +423,9 @@ function ( i18nService, uiGridConstants, gridUtil ) {
423423
$scope.$on( '$destroy', deregFunction );
424424
},
425425

426+
getGridOption: function( $scope, option ) {
427+
return typeof($scope.grid) !== 'undefined' && $scope.grid && $scope.grid.options && $scope.grid.options[option];
428+
},
426429

427430
/**
428431
* @ngdoc boolean
@@ -440,7 +443,7 @@ function ( i18nService, uiGridConstants, gridUtil ) {
440443
*
441444
*/
442445
sortable: function( $scope ) {
443-
return Boolean( $scope.grid.options.enableSorting && typeof($scope.col) !== 'undefined' && $scope.col && $scope.col.enableSorting);
446+
return Boolean( this.getGridOption($scope, 'enableSorting') && typeof($scope.col) !== 'undefined' && $scope.col && $scope.col.enableSorting);
444447
},
445448

446449
/**
@@ -487,7 +490,12 @@ function ( i18nService, uiGridConstants, gridUtil ) {
487490
*
488491
*/
489492
hideable: function( $scope ) {
490-
return !(typeof($scope.col) !== 'undefined' && $scope.col && $scope.col.colDef && $scope.col.colDef.enableHiding === false );
493+
return Boolean(
494+
(this.getGridOption($scope, 'enableHiding') &&
495+
typeof($scope.col) !== 'undefined' && $scope.col &&
496+
($scope.col.colDef && $scope.col.colDef.enableHiding !== false || !$scope.col.colDef)) ||
497+
(!this.getGridOption($scope, 'enableHiding') && $scope.col && $scope.col.colDef && $scope.col.colDef.enableHiding)
498+
);
491499
},
492500

493501

@@ -1938,17 +1946,10 @@ angular.module('ui.grid')
19381946
return isColumnVisible(colDef) ? 'ui-grid-icon-ok' : 'ui-grid-icon-cancel';
19391947
}
19401948

1941-
// add header for columns
1942-
showHideColumns.push({
1943-
title: i18nService.getSafeText('gridMenu.columns'),
1944-
order: 300,
1945-
templateUrl: 'ui-grid/ui-grid-menu-header-item'
1946-
});
1947-
19481949
$scope.grid.options.gridMenuTitleFilter = $scope.grid.options.gridMenuTitleFilter ? $scope.grid.options.gridMenuTitleFilter : function( title ) { return title; };
19491950

19501951
$scope.grid.options.columnDefs.forEach( function( colDef, index ) {
1951-
if ( colDef.enableHiding !== false ) {
1952+
if ( $scope.grid.options.enableHiding !== false && colDef.enableHiding !== false || colDef.enableHiding ) {
19521953
// add hide menu item - shows an OK icon as we only show when column is already visible
19531954
var menuItem = {
19541955
icon: getColumnIcon(colDef),
@@ -1977,6 +1978,16 @@ angular.module('ui.grid')
19771978
showHideColumns.push( menuItem );
19781979
}
19791980
});
1981+
1982+
// add header for columns
1983+
if ( showHideColumns.length ) {
1984+
showHideColumns.unshift({
1985+
title: i18nService.getSafeText('gridMenu.columns'),
1986+
order: 300,
1987+
templateUrl: 'ui-grid/ui-grid-menu-header-item'
1988+
});
1989+
}
1990+
19801991
return showHideColumns;
19811992
},
19821993

@@ -5523,7 +5534,7 @@ angular.module('ui.grid')
55235534

55245535
// gridUtil.logDebug('viewPortHeight', viewPortHeight);
55255536

5526-
return viewPortHeight;
5537+
return viewPortHeight > 0 ? viewPortHeight : 0;
55275538
};
55285539

55295540
Grid.prototype.getViewportWidth = function getViewportWidth() {
@@ -5795,7 +5806,7 @@ angular.module('ui.grid')
57955806
direction = directionOrAdd;
57965807
}
57975808

5798-
if (!add) {
5809+
if (!add || (self.options && self.options.suppressMultiSort)) {
57995810
self.resetColumnSorting(column);
58005811
column.sort.priority = undefined;
58015812
// Get the actual priority since there may be columns which have suppressRemoveSort set
@@ -8189,6 +8200,17 @@ angular.module('ui.grid')
81898200
*/
81908201
baseOptions.scrollDebounce = typeof(baseOptions.scrollDebounce) !== "undefined" ? baseOptions.scrollDebounce : 300;
81918202

8203+
/**
8204+
* @ngdoc boolean
8205+
* @name enableHiding
8206+
* @propertyOf ui.grid.class:GridOptions
8207+
* @description True by default. When enabled, this setting adds ability to hide
8208+
* the column headers, allowing hiding of the column from the grid.
8209+
* Column hiding can then be disabled / enabled on individual columns using the columnDefs,
8210+
* if it set, it will override GridOptions enableHiding setting.
8211+
*/
8212+
baseOptions.enableHiding = baseOptions.enableHiding !== false;
8213+
81928214
/**
81938215
* @ngdoc boolean
81948216
* @name enableSorting
@@ -8200,6 +8222,16 @@ angular.module('ui.grid')
82008222
*/
82018223
baseOptions.enableSorting = baseOptions.enableSorting !== false;
82028224

8225+
/**
8226+
* @ngdoc boolean
8227+
* @name suppressMultiSort
8228+
* @propertyOf ui.grid.class:GridOptions
8229+
* @description False by default. When enabled, this setting disables the ability
8230+
* to sort multiple columns by using the shift key or interacting with the column
8231+
* menu. Instead, each column sort will remove all other sorting.
8232+
*/
8233+
baseOptions.suppressMultiSort = baseOptions.suppressMultiSort === true;
8234+
82038235
/**
82048236
* @ngdoc boolean
82058237
* @name enableFiltering
@@ -8623,7 +8655,7 @@ angular.module('ui.grid')
86238655

86248656
viewPortHeight = viewPortHeight + adjustment.height;
86258657

8626-
return viewPortHeight;
8658+
return viewPortHeight > 0 ? viewPortHeight : 0;
86278659
};
86288660

86298661
GridRenderContainer.prototype.getViewportWidth = function getViewportWidth() {

i18n/ui-grid.core.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

i18n/ui-grid.edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.10.3 - 2021-08-01
2+
* ui-grid - v4.11.0 - 2021-08-12
33
* Copyright (c) 2021 ; License: MIT
44
*/
55

0 commit comments

Comments
 (0)