mjml-table
Advanced tools
Comparing version 4.8.1 to 4.8.2
@@ -10,2 +10,10 @@ "use strict"; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
@@ -19,37 +27,50 @@ | ||
class MjTable extends _mjmlCore.BodyComponent { | ||
getStyles() { | ||
return { | ||
table: { | ||
color: this.getAttribute('color'), | ||
'font-family': this.getAttribute('font-family'), | ||
'font-size': this.getAttribute('font-size'), | ||
'line-height': this.getAttribute('line-height'), | ||
'table-layout': this.getAttribute('table-layout'), | ||
width: this.getAttribute('width'), | ||
border: this.getAttribute('border') | ||
} | ||
}; | ||
} | ||
let MjTable = /*#__PURE__*/function (_BodyComponent) { | ||
(0, _inherits2.default)(MjTable, _BodyComponent); | ||
getWidth() { | ||
const width = this.getAttribute('width'); | ||
const { | ||
parsedWidth, | ||
unit | ||
} = (0, _widthParser.default)(width); | ||
return unit === '%' ? width : parsedWidth; | ||
var _super = (0, _createSuper2.default)(MjTable); | ||
function MjTable() { | ||
(0, _classCallCheck2.default)(this, MjTable); | ||
return _super.apply(this, arguments); | ||
} | ||
render() { | ||
const tableAttributes = (0, _reduce2.default)(['cellpadding', 'cellspacing'], (acc, v) => ({ ...acc, | ||
[v]: this.getAttribute(v) | ||
}), {}); | ||
return ` | ||
(0, _createClass2.default)(MjTable, [{ | ||
key: "getStyles", | ||
value: function getStyles() { | ||
return { | ||
table: { | ||
color: this.getAttribute('color'), | ||
'font-family': this.getAttribute('font-family'), | ||
'font-size': this.getAttribute('font-size'), | ||
'line-height': this.getAttribute('line-height'), | ||
'table-layout': this.getAttribute('table-layout'), | ||
width: this.getAttribute('width'), | ||
border: this.getAttribute('border') | ||
} | ||
}; | ||
} | ||
}, { | ||
key: "getWidth", | ||
value: function getWidth() { | ||
const width = this.getAttribute('width'); | ||
const { | ||
parsedWidth, | ||
unit | ||
} = (0, _widthParser.default)(width); | ||
return unit === '%' ? width : parsedWidth; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
const tableAttributes = (0, _reduce2.default)(['cellpadding', 'cellspacing'], (acc, v) => ({ ...acc, | ||
[v]: this.getAttribute(v) | ||
}), {}); | ||
return ` | ||
<table | ||
${this.htmlAttributes({ ...tableAttributes, | ||
width: this.getWidth(), | ||
border: '0', | ||
style: 'table' | ||
})} | ||
width: this.getWidth(), | ||
border: '0', | ||
style: 'table' | ||
})} | ||
> | ||
@@ -59,6 +80,7 @@ ${this.getContent()} | ||
`; | ||
} | ||
} | ||
}]); | ||
return MjTable; | ||
}(_mjmlCore.BodyComponent); | ||
} | ||
exports.default = MjTable; | ||
@@ -65,0 +87,0 @@ (0, _defineProperty2.default)(MjTable, "componentName", 'mj-table'); |
{ | ||
"name": "mjml-table", | ||
"description": "mjml-atable", | ||
"version": "4.8.1", | ||
"version": "4.8.2", | ||
"main": "lib/index.js", | ||
@@ -26,3 +26,3 @@ "files": [ | ||
"lodash": "^4.17.15", | ||
"mjml-core": "4.8.1" | ||
"mjml-core": "4.8.2" | ||
}, | ||
@@ -33,3 +33,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "45507ebde835129ba62671d341e76bc9892552c9" | ||
"gitHead": "67cb33b5edd2b1d80436a72c213d2e815a685cd5" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8561
103
+ Addedmjml-core@4.8.2(transitive)
+ Addedmjml-migrate@4.8.2(transitive)
+ Addedmjml-parser-xml@4.8.2(transitive)
+ Addedmjml-validator@4.8.2(transitive)
- Removedmjml-core@4.8.1(transitive)
- Removedmjml-migrate@4.8.1(transitive)
- Removedmjml-parser-xml@4.8.1(transitive)
- Removedmjml-validator@4.8.1(transitive)
Updatedmjml-core@4.8.2