Skip to content

Commit 85f0902

Browse files
committed
Generate release
1 parent 8c6efbc commit 85f0902

File tree

8 files changed

+34
-21
lines changed

8 files changed

+34
-21
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ http://www.google.com/design/spec/components/data-tables.html
6060
- align-rule
6161
- column-definition
6262
- column-filter
63-
- excludeFromColumnSelector
63+
- exclude-from-column-selector
64+
- hide-column-by-default
6465

6566
[Row attributes (`mdt-row`)](#data-row-attributes)
6667
- table-row-id
@@ -238,6 +239,8 @@ Html support is available for `mdt-row`, see more: [Custom cell content (`mdt-cu
238239
|:white_check_mark:| | placeholderText | Text | optional, placeholder which will show up as a default text (available only for `chips` and `dropdown` filter types |
239240
|:white_check_mark:| | filterType | Text | optional, defines the type of the filter you want to use. Available options are: `chips`, `checkbox`, `dropdown`. If you don't specify it, the default will be `chips` |
240241
|:white_check_mark:| exclude-from-column-selector | | Boolean | optional, excludes the column from the column selection feature |
242+
|:white_check_mark:| hide-column-by-default | | Boolean | optional, make column unselected by default in the column selection panel |
243+
241244
> When filters are applied to the columns, a third parameter will be applied to the `mdt-row-paginator` callback function.
242245
243246
# Data-Row attributes

app/modules/main/directives/header/mdtColumnDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*
4040
* @param {boolean=} excludeFromColumnSelector disables the column selection for the applied column for the column select feature.
4141
*
42-
* @param {boolean=} columnSelectorExcludeDefault sets the target column as unselected for the column select feature.
42+
* @param {boolean=} hideColumnByDefault sets the target column as unselected for the column select feature.
4343
*
4444
* @example
4545
* <pre>

app/modules/main/features/ColumnSelectorFeature/ColumnSelectorFeature.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @param cellDataToStore
1414
*/
15-
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector, isColumnUnselectedFromColumnSelector) {
15+
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector, hideColumnByDefault) {
1616
if(!columnSelectorFeature.isEnabled){
1717
return;
1818
}
@@ -25,10 +25,10 @@
2525
cellDataToStore.columnSelectorFeature.isExcluded = false;
2626
}
2727

28-
if(isColumnUnselectedFromColumnSelector){
29-
cellDataToStore.columnSelectorFeature.isUnchecked = true;
28+
if(hideColumnByDefault){
29+
cellDataToStore.columnSelectorFeature.isHidden = true;
3030
}else{
31-
cellDataToStore.columnSelectorFeature.isUnchecked = false;
31+
cellDataToStore.columnSelectorFeature.isHidden = false;
3232
}
3333
};
3434

@@ -62,7 +62,7 @@
6262
service.initFeatureHeaderValues = function(headerRowsData, columnSelectorFeature){
6363
if(columnSelectorFeature && columnSelectorFeature.isEnabled){
6464
_.each(headerRowsData, function(item){
65-
item.columnSelectorFeature.isVisible = !item.columnSelectorFeature.isUnchecked;
65+
item.columnSelectorFeature.isVisible = !item.columnSelectorFeature.isHidden;
6666
});
6767
}
6868
};

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "md-data-table",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"homepage": "https://github.com/iamisti/mdDataTable",
55
"author":"Istvan Fodor <[email protected]>",
66
"main": [

dist/md-data-table.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,8 @@
11721172
*
11731173
* @param {boolean=} excludeFromColumnSelector disables the column selection for the applied column for the column select feature.
11741174
*
1175+
* @param {boolean=} hideColumnByDefault sets the target column as unselected for the column select feature.
1176+
*
11751177
* @example
11761178
* <pre>
11771179
* <mdt-table>
@@ -1200,7 +1202,8 @@
12001202
columnDefinition: '@',
12011203
columnSort: '=?',
12021204
columnFilter: '=?',
1203-
excludeFromColumnSelector: '=?'
1205+
excludeFromColumnSelector: '=?',
1206+
hideColumnByDefault: '=?'
12041207
},
12051208
require: ['^mdtTable'],
12061209
link: function ($scope, element, attrs, ctrl, transclude) {
@@ -1217,7 +1220,7 @@
12171220

12181221
ColumnFilterFeature.appendHeaderCellData($scope, cellDataToStore, mdtTableCtrl.dataStorage);
12191222
ColumnSortFeature.appendHeaderCellData(cellDataToStore, $scope.columnSort);
1220-
ColumnSelectorFeature.appendHeaderCellData(cellDataToStore, mdtTableCtrl.columnSelectorFeature, $scope.excludeFromColumnSelector);
1223+
ColumnSelectorFeature.appendHeaderCellData(cellDataToStore, mdtTableCtrl.columnSelectorFeature, $scope.excludeFromColumnSelector, $scope.hideColumnByDefault);
12211224

12221225
mdtTableCtrl.dataStorage.addHeaderCellData(cellDataToStore);
12231226
});
@@ -1374,7 +1377,7 @@
13741377
});
13751378

13761379
}else{
1377-
element[0].append(val);
1380+
element.append(val);
13781381
}
13791382

13801383
}, false);
@@ -1655,7 +1658,7 @@
16551658
};
16561659

16571660
/**
1658-
* Set the position of the column filter panel. It's required to attach it to the outer container
1661+
* Set the position of the column filter panel. It's required to attach it to the outer container
16591662
* of the component because otherwise some parts of the panel can became partially or fully hidden
16601663
* (e.g.: when table has only one row to show)
16611664
*/
@@ -1666,13 +1669,13 @@
16661669
top: elementPosition.top + 60,
16671670
left: elementPosition.left
16681671
};
1669-
1672+
16701673
element.css('position', 'absolute');
16711674
element.detach().appendTo('body');
16721675

16731676
element.css({
1674-
top: targetMetrics.top + 'px',
1675-
left: targetMetrics.left + 'px',
1677+
top: targetMetrics.top + 'px',
1678+
left: targetMetrics.left + 'px',
16761679
position:'absolute'
16771680
});
16781681
}
@@ -1696,7 +1699,7 @@
16961699
*
16971700
* @param cellDataToStore
16981701
*/
1699-
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector) {
1702+
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector, hideColumnByDefault) {
17001703
if(!columnSelectorFeature.isEnabled){
17011704
return;
17021705
}
@@ -1708,6 +1711,12 @@
17081711
}else{
17091712
cellDataToStore.columnSelectorFeature.isExcluded = false;
17101713
}
1714+
1715+
if(hideColumnByDefault){
1716+
cellDataToStore.columnSelectorFeature.isHidden = true;
1717+
}else{
1718+
cellDataToStore.columnSelectorFeature.isHidden = false;
1719+
}
17111720
};
17121721

17131722
/**
@@ -1740,7 +1749,7 @@
17401749
service.initFeatureHeaderValues = function(headerRowsData, columnSelectorFeature){
17411750
if(columnSelectorFeature && columnSelectorFeature.isEnabled){
17421751
_.each(headerRowsData, function(item){
1743-
item.columnSelectorFeature.isVisible =true;
1752+
item.columnSelectorFeature.isVisible = !item.columnSelectorFeature.isHidden;
17441753
});
17451754
}
17461755
};
@@ -2243,6 +2252,7 @@
22432252

22442253
$scope.headerRowsData = _.map($scope.dataStorage.header, function(item){
22452254
//excluded content should also be in, since we use the index of the array to apply the changes. Do not exclude them.
2255+
22462256
return {
22472257
columnName: item.columnName,
22482258
isVisible: item.columnSelectorFeature.isVisible,

docs/js/docs-setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ NG_DOCS={
1919
"type": "directive",
2020
"moduleName": "mdtColumn",
2121
"shortDescription": "Representing a header column cell which should be placed inside mdt-header-row element directive.",
22-
"keywords": "activate affect align align-rule alignrule api applied array assignable cell cells checkbox chips clicking column column-definition columndefinition columnfilter columnselectorexcludedefault columnsort comparator compare compared content ctrl data default defines directive disables display displays don dropdown element excludefromcolumnselector false feature filter filtertype function gross header hover icon inside left mdt-header-row mdtcolumn mdttable ng-repeat object objects optional options order parameters passed placeholder placeholdertext price product products promise properties provided representing required resolves result return reverse rotate row select selected selection sets settings sort sorted sorting strings target text tooltip transforms true type types unselected user values valuesprovidercallback valuestransformercallback visually"
22+
"keywords": "activate affect align align-rule alignrule api applied array assignable cell cells checkbox chips clicking column column-definition columndefinition columnfilter columnsort comparator compare compared content ctrl data default defines directive disables display displays don dropdown element excludefromcolumnselector false feature filter filtertype function gross header hidecolumnbydefault hover icon inside left mdt-header-row mdtcolumn mdttable ng-repeat object objects optional options order parameters passed placeholder placeholdertext price product products promise properties provided representing required resolves result return reverse rotate row select selected selection sets settings sort sorted sorting strings target text tooltip transforms true type types unselected user values valuesprovidercallback valuestransformercallback visually"
2323
},
2424
{
2525
"section": "api",

docs/partials/api/mdtColumn.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2 id="usage">Usage</h2>
1616
[column-filter="{object}"]
1717
[column-definition="{string}"]
1818
[exclude-from-column-selector="{boolean}"]
19-
[column-selector-exclude-default="{boolean}"]&gt;
19+
[hide-column-by-default="{boolean}"]&gt;
2020
&lt;/mdt-column&gt;</pre>
2121
<h4 id="usage_parameters">Parameters</h4><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>alignRule <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="mdtcolumn-page"><p>align cell content. This settings will have affect on each data cells in the same
2222
column (e.g. every x.th cell in every row).</p>
@@ -42,7 +42,7 @@ <h4 id="usage_parameters">Parameters</h4><table class="variables-matrix table ta
4242
- {string=} filterType defines the type of the filter you want to use. Available options are: `chips`, `checkbox`, `dropdown`. If you don&#39;t specify it, the default will be `chips`
4343
</code></pre></div></td></tr><tr><td>columnDefinition <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="mdtcolumn-page"><p>displays a tooltip on hover.</p>
4444
</div></td></tr><tr><td>excludeFromColumnSelector <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-boolean">boolean</a></td><td><div class="mdtcolumn-page"><p>disables the column selection for the applied column for the column select feature.</p>
45-
</div></td></tr><tr><td>columnSelectorExcludeDefault <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-boolean">boolean</a></td><td><div class="mdtcolumn-page"><p>sets the target column as unselected for the column select feature.</p>
45+
</div></td></tr><tr><td>hideColumnByDefault <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-boolean">boolean</a></td><td><div class="mdtcolumn-page"><p>sets the target column as unselected for the column select feature.</p>
4646
</div></td></tr></tbody></table></div>
4747
<h2 id="example">Example</h2>
4848
<div class="example"><div class="mdtcolumn-page"><pre class="prettyprint linenums">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "md-data-table",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"author": "Istvan Fodor <[email protected]>",
55
"registry": "github",
66
"repository": {

0 commit comments

Comments
 (0)