mithril-material
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,14 +7,8 @@ Object.defineProperty(exports, "__esModule", { | ||
var _mithril = require('mithril'); | ||
var _mithril = require("mithril"); | ||
var _mithril2 = _interopRequireDefault(_mithril); | ||
var _Checkbox = require('../form/checkbox/Checkbox'); | ||
var _Checkbox2 = _interopRequireDefault(_Checkbox); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** @jsx m */ | ||
exports.default = { | ||
@@ -26,5 +20,14 @@ | ||
oninit: function oninit(vnode) { | ||
var self = this; | ||
this.vnode = vnode; | ||
this.rows = vnode.attrs.rows; | ||
this.columns = vnode.attrs.columns; | ||
for (var i = 0; i < this.rows.length; i++) { | ||
if (self.rows[i]._selected == true) {} else { | ||
self.rows[i]._selected = false; | ||
} | ||
} | ||
}, | ||
@@ -53,14 +56,14 @@ | ||
return (0, _mithril2.default)( | ||
'table', | ||
{ className: 'bordered highlight striped' }, | ||
"table", | ||
{ className: "bordered highlight striped" }, | ||
(0, _mithril2.default)( | ||
'thead', | ||
"thead", | ||
null, | ||
(0, _mithril2.default)( | ||
'tr', | ||
"tr", | ||
null, | ||
(0, _mithril2.default)( | ||
'th', | ||
"th", | ||
null, | ||
(0, _mithril2.default)(_Checkbox2.default, { | ||
(0, _mithril2.default)(Checkbox, { | ||
onchange: self.selectAll.bind(self) }) | ||
@@ -77,3 +80,3 @@ ), | ||
return (0, _mithril2.default)( | ||
'th', | ||
"th", | ||
null, | ||
@@ -86,13 +89,15 @@ columnName | ||
(0, _mithril2.default)( | ||
'tbody', | ||
"tbody", | ||
null, | ||
self.rows.map(function (row) { | ||
return (0, _mithril2.default)( | ||
'tr', | ||
"tr", | ||
null, | ||
(0, _mithril2.default)( | ||
'td', | ||
"td", | ||
null, | ||
(0, _mithril2.default)(_Checkbox2.default, { | ||
key: "" + row._selected, | ||
(0, _mithril2.default)("input", { | ||
id: row.id, | ||
type: "checkbox", | ||
key: row.id, | ||
onchange: self.selectSingleRow.bind(self, row), | ||
@@ -103,3 +108,3 @@ checked: row._selected }) | ||
return (0, _mithril2.default)( | ||
'td', | ||
"td", | ||
null, | ||
@@ -115,2 +120,2 @@ row[column.key] | ||
}; | ||
}; /** @jsx m */ |
{ | ||
"name": "mithril-material", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Material Design components for MithrilJs Applications", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
923
78145