From 1a810b29a725700c8c037f747ea89222ed93a07b Mon Sep 17 00:00:00 2001 From: Philip Rieck Date: Fri, 19 Aug 2016 15:31:31 -0500 Subject: [PATCH] fix null handling --- dist/amd/au-table-pagination.js | 2 +- dist/amd/au-table.js | 11 +++++++---- dist/commonjs/au-table-pagination.js | 2 +- dist/commonjs/au-table.js | 11 +++++++---- dist/es2015/au-table-pagination.js | 2 +- dist/es2015/au-table.js | 11 +++++++---- dist/system/au-table-pagination.js | 2 +- dist/system/au-table.js | 11 +++++++---- src/au-table.js | 13 ++++++++----- 9 files changed, 40 insertions(+), 25 deletions(-) diff --git a/dist/amd/au-table-pagination.js b/dist/amd/au-table-pagination.js index 9d5f0ec..d54858b 100644 --- a/dist/amd/au-table-pagination.js +++ b/dist/amd/au-table-pagination.js @@ -57,7 +57,7 @@ define(["exports", "aurelia-framework"], function (exports, _aureliaFramework) { var _dec, _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4; - var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({defaultBindingMode: _aureliaFramework.bindingMode.twoWay}), (_class = function () { + var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), (_class = function () { function AutPaginationCustomElement() { _classCallCheck(this, AutPaginationCustomElement); diff --git a/dist/amd/au-table.js b/dist/amd/au-table.js index ec4718b..ddf42f2 100644 --- a/dist/amd/au-table.js +++ b/dist/amd/au-table.js @@ -183,11 +183,14 @@ define(["exports", "aurelia-framework"], function (exports, _aureliaFramework) { var key = _ref2; - var value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key]) { + var value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/dist/commonjs/au-table-pagination.js b/dist/commonjs/au-table-pagination.js index 9bc38cb..eaaa22c 100644 --- a/dist/commonjs/au-table-pagination.js +++ b/dist/commonjs/au-table-pagination.js @@ -54,7 +54,7 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } -var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({defaultBindingMode: _aureliaFramework.bindingMode.twoWay}), (_class = function () { +var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), (_class = function () { function AutPaginationCustomElement() { _classCallCheck(this, AutPaginationCustomElement); diff --git a/dist/commonjs/au-table.js b/dist/commonjs/au-table.js index 69e3bcf..4debad3 100644 --- a/dist/commonjs/au-table.js +++ b/dist/commonjs/au-table.js @@ -180,11 +180,14 @@ var AureliaTableCustomAttribute = exports.AureliaTableCustomAttribute = (_dec = var key = _ref2; - var value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key]) { + var value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/dist/es2015/au-table-pagination.js b/dist/es2015/au-table-pagination.js index 5045d7e..9eed9d5 100644 --- a/dist/es2015/au-table-pagination.js +++ b/dist/es2015/au-table-pagination.js @@ -45,7 +45,7 @@ function _initializerWarningHelper(descriptor, context) { import { bindable, bindingMode } from "aurelia-framework"; -export let AutPaginationCustomElement = (_dec = bindable({defaultBindingMode: bindingMode.twoWay}), (_class = class AutPaginationCustomElement { +export let AutPaginationCustomElement = (_dec = bindable({ defaultBindingMode: bindingMode.twoWay }), (_class = class AutPaginationCustomElement { constructor() { _initDefineProp(this, "currentPage", _descriptor, this); diff --git a/dist/es2015/au-table.js b/dist/es2015/au-table.js index 882a1b5..9537723 100644 --- a/dist/es2015/au-table.js +++ b/dist/es2015/au-table.js @@ -140,11 +140,14 @@ export let AureliaTableCustomAttribute = (_dec = inject(BindingEngine), _dec2 = for (let next of toFilter) { for (let key of this.filterKeys) { - let value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key]) { + let value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/dist/system/au-table-pagination.js b/dist/system/au-table-pagination.js index f48aa6e..d75773c 100644 --- a/dist/system/au-table-pagination.js +++ b/dist/system/au-table-pagination.js @@ -60,7 +60,7 @@ System.register(["aurelia-framework"], function (_export, _context) { bindingMode = _aureliaFramework.bindingMode; }], execute: function () { - _export("AutPaginationCustomElement", AutPaginationCustomElement = (_dec = bindable({defaultBindingMode: bindingMode.twoWay}), (_class = function () { + _export("AutPaginationCustomElement", AutPaginationCustomElement = (_dec = bindable({ defaultBindingMode: bindingMode.twoWay }), (_class = function () { function AutPaginationCustomElement() { _classCallCheck(this, AutPaginationCustomElement); diff --git a/dist/system/au-table.js b/dist/system/au-table.js index e81d922..3e6374b 100644 --- a/dist/system/au-table.js +++ b/dist/system/au-table.js @@ -188,11 +188,14 @@ System.register(["aurelia-framework"], function (_export, _context) { var key = _ref2; - var value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key]) { + var value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/src/au-table.js b/src/au-table.js index 796f997..7875062 100644 --- a/src/au-table.js +++ b/src/au-table.js @@ -101,14 +101,17 @@ export class AureliaTableCustomAttribute { doFilter(toFilter) { let filteredData = []; - + for (let next of toFilter) { for (let key of this.filterKeys) { - let value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if( next[key]){ + let value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } }