Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mjml-table

Package Overview
Dependencies
Maintainers
6
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-table - npm Package Compare versions

Comparing version 4.8.1 to 4.8.2

88

lib/index.js

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc