@bigbinary/neeto-editor 1.47.86 → 1.47.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor.js +24 -13
- package/dist/Editor.js.map +1 -1
- package/dist/cjs/Editor.cjs.js +24 -13
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/editor-stats.html +1 -1
- package/package.json +1 -1
package/dist/cjs/Editor.cjs.js
CHANGED
|
@@ -20054,31 +20054,42 @@ var Table = Table$2.extend({
|
|
|
20054
20054
|
});
|
|
20055
20055
|
},
|
|
20056
20056
|
renderHTML: function renderHTML(_ref) {
|
|
20057
|
-
var _node$content, _node$attrs, _node$attrs2;
|
|
20057
|
+
var _this$options$cellMin, _this$options, _node$content, _node$attrs, _node$attrs2;
|
|
20058
20058
|
var node = _ref.node;
|
|
20059
|
+
var totalWidth = 0;
|
|
20060
|
+
var fixedWidth = true;
|
|
20059
20061
|
var colgroups = [];
|
|
20060
|
-
var
|
|
20061
|
-
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20065
|
-
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
20062
|
+
var cellMinWidth = (_this$options$cellMin = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.cellMinWidth) !== null && _this$options$cellMin !== void 0 ? _this$options$cellMin : 100;
|
|
20063
|
+
var firstRow = (_node$content = node.content) === null || _node$content === void 0 ? void 0 : _node$content.firstChild;
|
|
20064
|
+
if (firstRow && firstRow.childCount) {
|
|
20065
|
+
for (var i = 0; i < firstRow.childCount; i++) {
|
|
20066
|
+
var cell = firstRow.child(i);
|
|
20067
|
+
var _cell$attrs = cell.attrs,
|
|
20068
|
+
colspan = _cell$attrs.colspan,
|
|
20069
|
+
colwidth = _cell$attrs.colwidth;
|
|
20070
|
+
var span = colspan || 1;
|
|
20071
|
+
for (var j = 0; j < span; j++) {
|
|
20072
|
+
var hasWidth = colwidth && colwidth[j];
|
|
20073
|
+
totalWidth += Number(hasWidth) || cellMinWidth;
|
|
20074
|
+
if (!hasWidth) fixedWidth = false;
|
|
20075
|
+
var style = hasWidth ? "min-width: ".concat(cellMinWidth, "px; width: ").concat(Number(hasWidth), "px;") : "min-width: ".concat(cellMinWidth, "px;");
|
|
20071
20076
|
colgroups.push(["col", {
|
|
20072
20077
|
style: style
|
|
20073
20078
|
}]);
|
|
20074
20079
|
}
|
|
20075
20080
|
}
|
|
20076
20081
|
}
|
|
20082
|
+
var tableStyle = "";
|
|
20083
|
+
if (totalWidth > 0) {
|
|
20084
|
+
tableStyle = fixedWidth ? "width: ".concat(totalWidth, "px;") : "min-width: ".concat(totalWidth, "px;");
|
|
20085
|
+
}
|
|
20077
20086
|
var alignmentClass = (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.textAlign ? "neeto-editor-table--".concat(node.attrs.textAlign) : "neeto-editor-table--left";
|
|
20078
20087
|
return ["div", {
|
|
20079
20088
|
"class": "table-responsive ".concat(alignmentClass),
|
|
20080
20089
|
"data-text-align": ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.textAlign) || "left"
|
|
20081
|
-
}, ["table",
|
|
20090
|
+
}, ["table", tableStyle ? {
|
|
20091
|
+
style: tableStyle
|
|
20092
|
+
} : {}, ["colgroup"].concat(colgroups), ["tbody", 0]]];
|
|
20082
20093
|
},
|
|
20083
20094
|
addKeyboardShortcuts: function addKeyboardShortcuts() {
|
|
20084
20095
|
var _this$parent2,
|