Skip to content

Commit

Permalink
Generate release
Browse files Browse the repository at this point in the history
  • Loading branch information
iamisti committed Nov 23, 2016
1 parent 8c6efbc commit 85f0902
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 21 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ http://www.google.com/design/spec/components/data-tables.html
- align-rule
- column-definition
- column-filter
- excludeFromColumnSelector
- exclude-from-column-selector
- hide-column-by-default

[Row attributes (`mdt-row`)](#data-row-attributes)
- table-row-id
Expand Down Expand Up @@ -238,6 +239,8 @@ Html support is available for `mdt-row`, see more: [Custom cell content (`mdt-cu
|:white_check_mark:| | placeholderText | Text | optional, placeholder which will show up as a default text (available only for `chips` and `dropdown` filter types |
|: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` |
|:white_check_mark:| exclude-from-column-selector | | Boolean | optional, excludes the column from the column selection feature |
|:white_check_mark:| hide-column-by-default | | Boolean | optional, make column unselected by default in the column selection panel |

> When filters are applied to the columns, a third parameter will be applied to the `mdt-row-paginator` callback function.
# Data-Row attributes
Expand Down
2 changes: 1 addition & 1 deletion app/modules/main/directives/header/mdtColumnDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*
* @param {boolean=} excludeFromColumnSelector disables the column selection for the applied column for the column select feature.
*
* @param {boolean=} columnSelectorExcludeDefault sets the target column as unselected for the column select feature.
* @param {boolean=} hideColumnByDefault sets the target column as unselected for the column select feature.
*
* @example
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @param cellDataToStore
*/
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector, isColumnUnselectedFromColumnSelector) {
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector, hideColumnByDefault) {
if(!columnSelectorFeature.isEnabled){
return;
}
Expand All @@ -25,10 +25,10 @@
cellDataToStore.columnSelectorFeature.isExcluded = false;
}

if(isColumnUnselectedFromColumnSelector){
cellDataToStore.columnSelectorFeature.isUnchecked = true;
if(hideColumnByDefault){
cellDataToStore.columnSelectorFeature.isHidden = true;
}else{
cellDataToStore.columnSelectorFeature.isUnchecked = false;
cellDataToStore.columnSelectorFeature.isHidden = false;
}
};

Expand Down Expand Up @@ -62,7 +62,7 @@
service.initFeatureHeaderValues = function(headerRowsData, columnSelectorFeature){
if(columnSelectorFeature && columnSelectorFeature.isEnabled){
_.each(headerRowsData, function(item){
item.columnSelectorFeature.isVisible = !item.columnSelectorFeature.isUnchecked;
item.columnSelectorFeature.isVisible = !item.columnSelectorFeature.isHidden;
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md-data-table",
"version": "2.1.0",
"version": "2.2.0",
"homepage": "https://github.com/iamisti/mdDataTable",
"author":"Istvan Fodor <[email protected]>",
"main": [
Expand Down
28 changes: 19 additions & 9 deletions dist/md-data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,8 @@
*
* @param {boolean=} excludeFromColumnSelector disables the column selection for the applied column for the column select feature.
*
* @param {boolean=} hideColumnByDefault sets the target column as unselected for the column select feature.
*
* @example
* <pre>
* <mdt-table>
Expand Down Expand Up @@ -1200,7 +1202,8 @@
columnDefinition: '@',
columnSort: '=?',
columnFilter: '=?',
excludeFromColumnSelector: '=?'
excludeFromColumnSelector: '=?',
hideColumnByDefault: '=?'
},
require: ['^mdtTable'],
link: function ($scope, element, attrs, ctrl, transclude) {
Expand All @@ -1217,7 +1220,7 @@

ColumnFilterFeature.appendHeaderCellData($scope, cellDataToStore, mdtTableCtrl.dataStorage);
ColumnSortFeature.appendHeaderCellData(cellDataToStore, $scope.columnSort);
ColumnSelectorFeature.appendHeaderCellData(cellDataToStore, mdtTableCtrl.columnSelectorFeature, $scope.excludeFromColumnSelector);
ColumnSelectorFeature.appendHeaderCellData(cellDataToStore, mdtTableCtrl.columnSelectorFeature, $scope.excludeFromColumnSelector, $scope.hideColumnByDefault);

mdtTableCtrl.dataStorage.addHeaderCellData(cellDataToStore);
});
Expand Down Expand Up @@ -1374,7 +1377,7 @@
});

}else{
element[0].append(val);
element.append(val);
}

}, false);
Expand Down Expand Up @@ -1655,7 +1658,7 @@
};

/**
* Set the position of the column filter panel. It's required to attach it to the outer container
* Set the position of the column filter panel. It's required to attach it to the outer container
* of the component because otherwise some parts of the panel can became partially or fully hidden
* (e.g.: when table has only one row to show)
*/
Expand All @@ -1666,13 +1669,13 @@
top: elementPosition.top + 60,
left: elementPosition.left
};

element.css('position', 'absolute');
element.detach().appendTo('body');

element.css({
top: targetMetrics.top + 'px',
left: targetMetrics.left + 'px',
top: targetMetrics.top + 'px',
left: targetMetrics.left + 'px',
position:'absolute'
});
}
Expand All @@ -1696,7 +1699,7 @@
*
* @param cellDataToStore
*/
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector) {
service.appendHeaderCellData = function(cellDataToStore, columnSelectorFeature, isColumnExcludedFromColumnSelector, hideColumnByDefault) {
if(!columnSelectorFeature.isEnabled){
return;
}
Expand All @@ -1708,6 +1711,12 @@
}else{
cellDataToStore.columnSelectorFeature.isExcluded = false;
}

if(hideColumnByDefault){
cellDataToStore.columnSelectorFeature.isHidden = true;
}else{
cellDataToStore.columnSelectorFeature.isHidden = false;
}
};

/**
Expand Down Expand Up @@ -1740,7 +1749,7 @@
service.initFeatureHeaderValues = function(headerRowsData, columnSelectorFeature){
if(columnSelectorFeature && columnSelectorFeature.isEnabled){
_.each(headerRowsData, function(item){
item.columnSelectorFeature.isVisible =true;
item.columnSelectorFeature.isVisible = !item.columnSelectorFeature.isHidden;
});
}
};
Expand Down Expand Up @@ -2243,6 +2252,7 @@

$scope.headerRowsData = _.map($scope.dataStorage.header, function(item){
//excluded content should also be in, since we use the index of the array to apply the changes. Do not exclude them.

return {
columnName: item.columnName,
isVisible: item.columnSelectorFeature.isVisible,
Expand Down
2 changes: 1 addition & 1 deletion docs/js/docs-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ NG_DOCS={
"type": "directive",
"moduleName": "mdtColumn",
"shortDescription": "Representing a header column cell which should be placed inside mdt-header-row element directive.",
"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"
"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"
},
{
"section": "api",
Expand Down
4 changes: 2 additions & 2 deletions docs/partials/api/mdtColumn.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2 id="usage">Usage</h2>
[column-filter="{object}"]
[column-definition="{string}"]
[exclude-from-column-selector="{boolean}"]
[column-selector-exclude-default="{boolean}"]&gt;
[hide-column-by-default="{boolean}"]&gt;
&lt;/mdt-column&gt;</pre>
<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
column (e.g. every x.th cell in every row).</p>
Expand All @@ -42,7 +42,7 @@ <h4 id="usage_parameters">Parameters</h4><table class="variables-matrix table ta
- {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`
</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>
</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>
</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>
</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>
</div></td></tr></tbody></table></div>
<h2 id="example">Example</h2>
<div class="example"><div class="mdtcolumn-page"><pre class="prettyprint linenums">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md-data-table",
"version": "2.1.0",
"version": "2.2.0",
"author": "Istvan Fodor <[email protected]>",
"registry": "github",
"repository": {
Expand Down

0 comments on commit 85f0902

Please sign in to comment.