Skip to content

Commit

Permalink
chore(release): 1.0.0-alpha.3 distribution files
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrowhurstram committed Aug 14, 2015
1 parent d1e02cc commit 6bc49a3
Show file tree
Hide file tree
Showing 9 changed files with 229 additions and 14 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
<a name="1.0.0-alpha.3"></a>
# 1.0.0-alpha.3 (2015-08-14)


## Bug Fixes

- **ngTableController:** should be consistent about adding empty option item
([d2080600](https://github.com/esvit/ng-table/commit/d2080600641206d84505c54f271c1eaebee391e8))


## Features

- **filters:**
- add filterLayout option to control position of multi-template filters
([d1e02ccd](https://github.com/esvit/ng-table/commit/d1e02ccd7d0e9f3f9fb882a32113cc724bcfe5f4))
- support placeholder attribute for filter input
([275f1c88](https://github.com/esvit/ng-table/commit/275f1c88f46515415a43e434a65fe54b4d813637))
- render a multi-template filter horizontally
([c834cc09](https://github.com/esvit/ng-table/commit/c834cc098ee2fa6ffe986ec701ceb0f3360b5680))


## Breaking Changes

- **ngTableController:** due to [d2080600](https://github.com/esvit/ng-table/commit/d2080600641206d84505c54f271c1eaebee391e8),


An empty item - `{ id: '', title: '' }` - is added to an array returned synchronously by `filterData`
function.

Implications:
* make sure to *not* add an empty option yourself as this will be a duplicate
* your array of items need to have an `id` and `title` field so as to match the empty option


<a name="1.0.0-alpha.2"></a>
# 1.0.0-alpha.2 (2015-08-12)

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": "ng-table",
"version": "1.0.0-alpha.2",
"version": "1.0.0-alpha.3",
"main": [
"./dist/ng-table.min.js",
"./dist/ng-table.min.css"
Expand Down
77 changes: 77 additions & 0 deletions dist/ng-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,80 @@
display: block;
}
}
.filter:before,
.filter:after {
display: table;
content: " ";
}
.filter:after {
clear: both;
}
.filter > .filter-cell {
float: left;
box-sizing: border-box;
}
.filter-horizontal > .filter-cell {
padding: 0 2px;
}
.filter-horizontal > .filter-cell:first-child {
padding-left: 0;
}
.filter-horizontal > .filter-cell:last-child,
.filter-horizontal > .filter-cell.last {
padding-right: 0;
}
.s12 {
width: 100%;
}
.s11 {
width: 91.66666666666666%;
}
.s10 {
width: 83.33333333333334%;
}
.s9 {
width: 75%;
}
.s8 {
width: 66.66666666666666%;
}
.s7 {
width: 58.333333333333336%;
}
.s6 {
width: 50%;
}
.s5 {
width: 41.66666666666667%;
}
.s4 {
width: 33.33333333333333%;
}
.s3 {
width: 25%;
}
.s2 {
width: 16.666666666666664%;
}
.s1 {
width: 8.333333333333332%;
}
@media all and (max-width: 468px) {
.s12,
.s11,
.s10,
.s9,
.s8,
.s7,
.s6,
.s5,
.s4,
.s3,
.s2,
.s1 {
width: 100%;
}
.filter > .filter-cell {
padding: 0px;
}
}
44 changes: 37 additions & 7 deletions dist/ng-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@
/////////

function getTemplateUrl(filterValue, filterKey){
if (angular.isObject(filterValue)){
filterValue = filterValue.id;
}
if (filterValue.indexOf('/') !== -1){
return filterValue;
}
Expand Down Expand Up @@ -996,6 +999,7 @@
total: 0,
defaultSort: 'desc',
filterDelay: 750,
filterLayout: 'stack', // alternative: 'horizontal'
counts: [10, 25, 50, 100],
interceptors: [],
paginationMaxBlocks: 11,
Expand Down Expand Up @@ -1158,19 +1162,27 @@
// if none of the above was found - we just want an empty array
data = [];
} else if (angular.isArray(data)) {
data.unshift({
title: '',
id: ''
});
ensureEmptyListOption(data);
}
$column.data = data;
});
}
// otherwise, we just return what the user gave us. It could be a function, array, object, whatever
else {
ensureEmptyListOption(result);
return $column.data = result;
}
});

function ensureEmptyListOption(data){
if (!angular.isArray(data)){
return;
}
data.unshift({
title: '',
id: ''
});
}
};

this.buildColumns = function (columns) {
Expand Down Expand Up @@ -1488,6 +1500,24 @@
function ngTableFilterRowController($scope, ngTableFilterConfig){

$scope.config = ngTableFilterConfig;

$scope.getFilterCellCss = function (filter, layout){
if (layout !== 'horizontal') {
return 's12';
}

var size = Object.keys(filter).length;
var width = parseInt(12 / size, 10);
return 's' + width;
};

$scope.getFilterPlaceholderValue = function(filterValue/*, filterName*/){
if (angular.isObject(filterValue)) {
return filterValue.placeholder;
} else {
return '';
}
};
}
})();

Expand Down Expand Up @@ -1587,11 +1617,11 @@
})();

angular.module('ngTable').run(['$templateCache', function ($templateCache) {
$templateCache.put('ng-table/filterRow.html', '<tr ng-show="show_filter" class="ng-table-filters"> <th data-title-text="{{$column.titleAlt(this) || $column.title(this)}}" ng-repeat="$column in $columns" ng-if="$column.show(this)" class="filter"> <div ng-repeat="(name, filter) in $column.filter(this)"> <div ng-include="config.getTemplateUrl(filter)"></div> </div> </th> </tr> ');
$templateCache.put('ng-table/filters/number.html', '<input type="number" name="{{name}}" ng-disabled="$filterRow.disabled" ng-model="params.filter()[name]" class="input-filter form-control"/> ');
$templateCache.put('ng-table/filterRow.html', '<tr ng-show="show_filter" class="ng-table-filters"> <th data-title-text="{{$column.titleAlt(this) || $column.title(this)}}" ng-repeat="$column in $columns" ng-if="$column.show(this)" class="filter" ng-class="params.settings().filterLayout===\'horizontal\' ? \'filter-horizontal\' : \'\'"> <div ng-repeat="(name, filter) in $column.filter(this)" ng-include="config.getTemplateUrl(filter)" class="filter-cell" ng-class="[getFilterCellCss($column.filter(this), params.settings().filterLayout), $last ? \'last\' : \'\']"> </div> </th> </tr> ');
$templateCache.put('ng-table/filters/number.html', '<input type="number" name="{{name}}" ng-disabled="$filterRow.disabled" ng-model="params.filter()[name]" class="input-filter form-control" placeholder="{{getFilterPlaceholderValue(filter, name)}}"/> ');
$templateCache.put('ng-table/filters/select-multiple.html', '<select ng-options="data.id as data.title for data in $column.data" ng-disabled="$filterRow.disabled" multiple ng-multiple="true" ng-model="params.filter()[name]" class="filter filter-select-multiple form-control" name="{{name}}"> </select> ');
$templateCache.put('ng-table/filters/select.html', '<select ng-options="data.id as data.title for data in $column.data" ng-disabled="$filterRow.disabled" ng-model="params.filter()[name]" class="filter filter-select form-control" name="{{name}}"> <option style="display:none" value=""></option> </select> ');
$templateCache.put('ng-table/filters/text.html', '<input type="text" name="{{name}}" ng-disabled="$filterRow.disabled" ng-model="params.filter()[name]" class="input-filter form-control"/> ');
$templateCache.put('ng-table/filters/text.html', '<input type="text" name="{{name}}" ng-disabled="$filterRow.disabled" ng-model="params.filter()[name]" class="input-filter form-control" placeholder="{{getFilterPlaceholderValue(filter, name)}}"/> ');
$templateCache.put('ng-table/header.html', '<ng-table-sorter-row></ng-table-sorter-row> <ng-table-filter-row></ng-table-filter-row> ');
$templateCache.put('ng-table/pager.html', '<div class="ng-cloak ng-table-pager" ng-if="params.data.length"> <div ng-if="params.settings().counts.length" class="ng-table-counts btn-group pull-right"> <button ng-repeat="count in params.settings().counts" type="button" ng-class="{\'active\':params.count()==count}" ng-click="params.count(count)" class="btn btn-default"> <span ng-bind="count"></span> </button> </div> <ul ng-if="pages.length" class="pagination ng-table-pagination"> <li ng-class="{\'disabled\': !page.active && !page.current, \'active\': page.current}" ng-repeat="page in pages" ng-switch="page.type"> <a ng-switch-when="prev" ng-click="params.page(page.number)" href="">&laquo;</a> <a ng-switch-when="first" ng-click="params.page(page.number)" href=""><span ng-bind="page.number"></span></a> <a ng-switch-when="page" ng-click="params.page(page.number)" href=""><span ng-bind="page.number"></span></a> <a ng-switch-when="more" ng-click="params.page(page.number)" href="">&#8230;</a> <a ng-switch-when="last" ng-click="params.page(page.number)" href=""><span ng-bind="page.number"></span></a> <a ng-switch-when="next" ng-click="params.page(page.number)" href="">&raquo;</a> </li> </ul> </div> ');
$templateCache.put('ng-table/sorterRow.html', '<tr> <th title="{{$column.headerTitle(this)}}" ng-repeat="$column in $columns" ng-class="{ \'sortable\': $column.sortable(this), \'sort-asc\': params.sorting()[$column.sortable(this)]==\'asc\', \'sort-desc\': params.sorting()[$column.sortable(this)]==\'desc\' }" ng-click="sortBy($column, $event)" ng-if="$column.show(this)" ng-init="template=$column.headerTemplateURL(this)" class="header {{$column.class(this)}}"> <div ng-if="!template" class="ng-table-header" ng-class="{\'sort-indicator\': params.settings().sortingIndicator==\'div\'}"> <span ng-bind="$column.title(this)" ng-class="{\'sort-indicator\': params.settings().sortingIndicator==\'span\'}"></span> </div> <div ng-if="template" ng-include="template"></div> </th> </tr> ');
Expand Down
74 changes: 74 additions & 0 deletions dist/ng-table.less
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,77 @@
.ng-table-pagination {}
.ng-table-counts {}
}

.filter:before,
.filter:after {
display: table;
content: " ";
}
.filter:after {
clear: both;
}

.filter > .filter-cell {
float: left;
box-sizing: border-box;
}

.filter-horizontal > .filter-cell {
padding: 0 2px;
}

.filter-horizontal > .filter-cell:first-child {
padding-left: 0;
}

.filter-horizontal > .filter-cell {
&:last-child, &.last {
padding-right: 0;
}
}

.s12 {
width: 100%;
}
.s11 {
width: 91.66666666666666%;
}
.s10 {
width: 83.33333333333334%;
}
.s9 {
width: 75%;
}
.s8 {
width: 66.66666666666666%;
}
.s7 {
width: 58.333333333333336%;
}
.s6 {
width: 50%;
}
.s5 {
width: 41.66666666666667%;
}
.s4 {
width: 33.33333333333333%;
}
.s3 {
width: 25%;
}
.s2 {
width: 16.666666666666664%;
}
.s1 {
width: 8.333333333333332%;
}

@media all and (max-width: 468px) {
.s12,.s11,.s10,.s9,.s8,.s7,.s6,.s5,.s4,.s3,.s2,.s1 {
width: 100%;
}
.filter > .filter-cell {
padding: 0px;
}
}
4 changes: 2 additions & 2 deletions dist/ng-table.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/ng-table.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ng-table.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-table",
"version": "1.0.0-alpha.2",
"version": "1.0.0-alpha.3",
"author": "Vitalii Savchuk <[email protected]>",
"license": "BSD",
"repository": {
Expand Down

0 comments on commit 6bc49a3

Please sign in to comment.