@dangl/angular-material-shared 1.2.1-beta0003 → 1.2.1-beta0013
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/package.json +1 -1
- package/tinymce-assets/plugins/advlist/plugin.js +1 -1
- package/tinymce-assets/plugins/advlist/plugin.min.js +1 -1
- package/tinymce-assets/plugins/anchor/plugin.js +1 -1
- package/tinymce-assets/plugins/anchor/plugin.min.js +1 -1
- package/tinymce-assets/plugins/autolink/plugin.js +1 -1
- package/tinymce-assets/plugins/autolink/plugin.min.js +1 -1
- package/tinymce-assets/plugins/autoresize/plugin.js +15 -7
- package/tinymce-assets/plugins/autoresize/plugin.min.js +2 -2
- package/tinymce-assets/plugins/autosave/plugin.js +1 -1
- package/tinymce-assets/plugins/autosave/plugin.min.js +1 -1
- package/tinymce-assets/plugins/bbcode/plugin.js +1 -2
- package/tinymce-assets/plugins/bbcode/plugin.min.js +2 -2
- package/tinymce-assets/plugins/charmap/plugin.js +1 -1
- package/tinymce-assets/plugins/charmap/plugin.min.js +1 -1
- package/tinymce-assets/plugins/code/plugin.js +1 -1
- package/tinymce-assets/plugins/code/plugin.min.js +1 -1
- package/tinymce-assets/plugins/codesample/plugin.js +1887 -2006
- package/tinymce-assets/plugins/codesample/plugin.min.js +2 -2
- package/tinymce-assets/plugins/colorpicker/plugin.js +1 -2
- package/tinymce-assets/plugins/colorpicker/plugin.min.js +2 -2
- package/tinymce-assets/plugins/contextmenu/plugin.js +1 -2
- package/tinymce-assets/plugins/contextmenu/plugin.min.js +2 -2
- package/tinymce-assets/plugins/directionality/plugin.js +1 -1
- package/tinymce-assets/plugins/directionality/plugin.min.js +1 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +1 -1
- package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -1
- package/tinymce-assets/plugins/fullpage/plugin.js +1 -2
- package/tinymce-assets/plugins/fullpage/plugin.min.js +2 -2
- package/tinymce-assets/plugins/fullscreen/plugin.js +385 -2
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
- package/tinymce-assets/plugins/help/plugin.js +68 -75
- package/tinymce-assets/plugins/help/plugin.min.js +2 -2
- package/tinymce-assets/plugins/hr/plugin.js +1 -1
- package/tinymce-assets/plugins/hr/plugin.min.js +1 -1
- package/tinymce-assets/plugins/image/plugin.js +38 -20
- package/tinymce-assets/plugins/image/plugin.min.js +2 -2
- package/tinymce-assets/plugins/imagetools/plugin.js +229 -195
- package/tinymce-assets/plugins/imagetools/plugin.min.js +2 -2
- package/tinymce-assets/plugins/importcss/plugin.js +1 -1
- package/tinymce-assets/plugins/importcss/plugin.min.js +1 -1
- package/tinymce-assets/plugins/insertdatetime/plugin.js +11 -8
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +2 -2
- package/tinymce-assets/plugins/legacyoutput/plugin.js +1 -2
- package/tinymce-assets/plugins/legacyoutput/plugin.min.js +2 -2
- package/tinymce-assets/plugins/link/plugin.js +20 -13
- package/tinymce-assets/plugins/link/plugin.min.js +2 -2
- package/tinymce-assets/plugins/lists/plugin.js +2 -2
- package/tinymce-assets/plugins/lists/plugin.min.js +2 -2
- package/tinymce-assets/plugins/media/plugin.js +43 -48
- package/tinymce-assets/plugins/media/plugin.min.js +2 -2
- package/tinymce-assets/plugins/nonbreaking/plugin.js +1 -1
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +1 -1
- package/tinymce-assets/plugins/noneditable/plugin.js +1 -1
- package/tinymce-assets/plugins/noneditable/plugin.min.js +1 -1
- package/tinymce-assets/plugins/pagebreak/plugin.js +1 -1
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +1 -1
- package/tinymce-assets/plugins/paste/plugin.js +35 -3
- package/tinymce-assets/plugins/paste/plugin.min.js +2 -2
- package/tinymce-assets/plugins/preview/plugin.js +1 -1
- package/tinymce-assets/plugins/preview/plugin.min.js +1 -1
- package/tinymce-assets/plugins/print/plugin.js +1 -1
- package/tinymce-assets/plugins/print/plugin.min.js +1 -1
- package/tinymce-assets/plugins/quickbars/plugin.js +1 -1
- package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -1
- package/tinymce-assets/plugins/save/plugin.js +1 -1
- package/tinymce-assets/plugins/save/plugin.min.js +1 -1
- package/tinymce-assets/plugins/searchreplace/plugin.js +1 -1
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -1
- package/tinymce-assets/plugins/spellchecker/plugin.js +1 -2
- package/tinymce-assets/plugins/spellchecker/plugin.min.js +2 -2
- package/tinymce-assets/plugins/tabfocus/plugin.js +1 -1
- package/tinymce-assets/plugins/tabfocus/plugin.min.js +1 -1
- package/tinymce-assets/plugins/table/plugin.js +456 -381
- package/tinymce-assets/plugins/table/plugin.min.js +2 -2
- package/tinymce-assets/plugins/template/plugin.js +1 -1
- package/tinymce-assets/plugins/template/plugin.min.js +1 -1
- package/tinymce-assets/plugins/textcolor/plugin.js +1 -2
- package/tinymce-assets/plugins/textcolor/plugin.min.js +2 -2
- package/tinymce-assets/plugins/textpattern/plugin.js +2 -2
- package/tinymce-assets/plugins/textpattern/plugin.min.js +2 -2
- package/tinymce-assets/plugins/toc/plugin.js +1 -1
- package/tinymce-assets/plugins/toc/plugin.min.js +1 -1
- package/tinymce-assets/plugins/visualblocks/plugin.js +1 -1
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -1
- package/tinymce-assets/plugins/visualchars/plugin.js +1 -1
- package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -1
- package/tinymce-assets/plugins/wordcount/plugin.js +1 -1
- package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -1
- package/tinymce-assets/skins/ui/oxide/content.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.css +7 -7
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.css +7 -7
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +7 -7
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.css +7 -7
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
- package/tinymce-assets/themes/mobile/theme.js +225 -700
- package/tinymce-assets/themes/mobile/theme.min.js +2 -2
- package/tinymce-assets/themes/silver/theme.js +3224 -3686
- package/tinymce-assets/themes/silver/theme.min.js +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
|
6
6
|
*
|
|
7
|
-
* Version: 5.
|
|
7
|
+
* Version: 5.10.0 (2021-10-11)
|
|
8
8
|
*/
|
|
9
9
|
(function () {
|
|
10
10
|
'use strict';
|
|
@@ -537,6 +537,10 @@
|
|
|
537
537
|
var isEmpty$1 = function (s) {
|
|
538
538
|
return !isNotEmpty(s);
|
|
539
539
|
};
|
|
540
|
+
var toFloat = function (value) {
|
|
541
|
+
var num = parseFloat(value);
|
|
542
|
+
return isNaN(num) ? Optional.none() : Optional.some(num);
|
|
543
|
+
};
|
|
540
544
|
|
|
541
545
|
var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
|
|
542
546
|
var checkContains = function (target) {
|
|
@@ -1076,6 +1080,9 @@
|
|
|
1076
1080
|
var parent = function (element) {
|
|
1077
1081
|
return Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
|
|
1078
1082
|
};
|
|
1083
|
+
var parentElement = function (element) {
|
|
1084
|
+
return Optional.from(element.dom.parentElement).map(SugarElement.fromDom);
|
|
1085
|
+
};
|
|
1079
1086
|
var parents = function (element, isRoot) {
|
|
1080
1087
|
var stop = isFunction(isRoot) ? isRoot : never;
|
|
1081
1088
|
var dom = element.dom;
|
|
@@ -1092,9 +1099,6 @@
|
|
|
1092
1099
|
}
|
|
1093
1100
|
return ret;
|
|
1094
1101
|
};
|
|
1095
|
-
var offsetParent = function (element) {
|
|
1096
|
-
return Optional.from(element.dom.offsetParent).map(SugarElement.fromDom);
|
|
1097
|
-
};
|
|
1098
1102
|
var prevSibling = function (element) {
|
|
1099
1103
|
return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom);
|
|
1100
1104
|
};
|
|
@@ -1288,6 +1292,15 @@
|
|
|
1288
1292
|
rawSet(dom, k, v);
|
|
1289
1293
|
});
|
|
1290
1294
|
};
|
|
1295
|
+
var setOptions = function (element, attrs) {
|
|
1296
|
+
each$1(attrs, function (v, k) {
|
|
1297
|
+
v.fold(function () {
|
|
1298
|
+
remove$7(element, k);
|
|
1299
|
+
}, function (value) {
|
|
1300
|
+
rawSet(element.dom, k, value);
|
|
1301
|
+
});
|
|
1302
|
+
});
|
|
1303
|
+
};
|
|
1291
1304
|
var get$b = function (element, key) {
|
|
1292
1305
|
var v = element.dom.getAttribute(key);
|
|
1293
1306
|
return v === null ? undefined : v;
|
|
@@ -1406,8 +1419,12 @@
|
|
|
1406
1419
|
var getSpan = function (cell, type) {
|
|
1407
1420
|
return getAttrValue(cell, type, 1);
|
|
1408
1421
|
};
|
|
1409
|
-
var hasColspan = function (
|
|
1410
|
-
|
|
1422
|
+
var hasColspan = function (cellOrCol) {
|
|
1423
|
+
if (isTag('col')(cellOrCol)) {
|
|
1424
|
+
return getAttrValue(cellOrCol, 'span', 1) > 1;
|
|
1425
|
+
} else {
|
|
1426
|
+
return getSpan(cellOrCol, 'colspan') > 1;
|
|
1427
|
+
}
|
|
1411
1428
|
};
|
|
1412
1429
|
var hasRowspan = function (cell) {
|
|
1413
1430
|
return getSpan(cell, 'rowspan') > 1;
|
|
@@ -1503,7 +1520,7 @@
|
|
|
1503
1520
|
var fromTable$1 = function (table) {
|
|
1504
1521
|
var rows = rows$1(table);
|
|
1505
1522
|
var columnGroups$1 = columnGroups(table);
|
|
1506
|
-
var elems = __spreadArray(__spreadArray([], columnGroups$1), rows);
|
|
1523
|
+
var elems = __spreadArray(__spreadArray([], columnGroups$1, true), rows, true);
|
|
1507
1524
|
return fromRowsOrColGroups(elems, getParentSection);
|
|
1508
1525
|
};
|
|
1509
1526
|
var fromPastedRows = function (elems, section) {
|
|
@@ -1614,8 +1631,6 @@
|
|
|
1614
1631
|
var generate$1 = function (list) {
|
|
1615
1632
|
var access = {};
|
|
1616
1633
|
var cells = [];
|
|
1617
|
-
var columns = {};
|
|
1618
|
-
var colgroups = [];
|
|
1619
1634
|
var tableOpt = head(list).map(function (rowData) {
|
|
1620
1635
|
return rowData.element;
|
|
1621
1636
|
}).bind(table);
|
|
@@ -1623,35 +1638,46 @@
|
|
|
1623
1638
|
var maxRows = 0;
|
|
1624
1639
|
var maxColumns = 0;
|
|
1625
1640
|
var rowCount = 0;
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
for (var
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
maxColumns = Math.max(maxColumns, columnPosition + 1);
|
|
1646
|
-
}
|
|
1641
|
+
var _a = partition(list, function (rowData) {
|
|
1642
|
+
return rowData.section === 'colgroup';
|
|
1643
|
+
}), colgroupRows = _a.pass, rows = _a.fail;
|
|
1644
|
+
each$2(rows, function (rowData) {
|
|
1645
|
+
var currentRow = [];
|
|
1646
|
+
each$2(rowData.cells, function (rowCell) {
|
|
1647
|
+
var start = 0;
|
|
1648
|
+
while (access[key(rowCount, start)] !== undefined) {
|
|
1649
|
+
start++;
|
|
1650
|
+
}
|
|
1651
|
+
var isLocked = hasNonNullableKey(lockedColumns, start.toString());
|
|
1652
|
+
var current = extended(rowCell.element, rowCell.rowspan, rowCell.colspan, rowCount, start, isLocked);
|
|
1653
|
+
for (var occupiedColumnPosition = 0; occupiedColumnPosition < rowCell.colspan; occupiedColumnPosition++) {
|
|
1654
|
+
for (var occupiedRowPosition = 0; occupiedRowPosition < rowCell.rowspan; occupiedRowPosition++) {
|
|
1655
|
+
var rowPosition = rowCount + occupiedRowPosition;
|
|
1656
|
+
var columnPosition = start + occupiedColumnPosition;
|
|
1657
|
+
var newpos = key(rowPosition, columnPosition);
|
|
1658
|
+
access[newpos] = current;
|
|
1659
|
+
maxColumns = Math.max(maxColumns, columnPosition + 1);
|
|
1647
1660
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1661
|
+
}
|
|
1662
|
+
currentRow.push(current);
|
|
1663
|
+
});
|
|
1664
|
+
maxRows++;
|
|
1665
|
+
cells.push(rowdetail(rowData.element, currentRow, rowData.section));
|
|
1666
|
+
rowCount++;
|
|
1654
1667
|
});
|
|
1668
|
+
var _b = last$2(colgroupRows).map(function (rowData) {
|
|
1669
|
+
var columns = generateColumns(rowData);
|
|
1670
|
+
var colgroup$1 = colgroup(rowData.element, values(columns));
|
|
1671
|
+
return {
|
|
1672
|
+
colgroups: [colgroup$1],
|
|
1673
|
+
columns: columns
|
|
1674
|
+
};
|
|
1675
|
+
}).getOrThunk(function () {
|
|
1676
|
+
return {
|
|
1677
|
+
colgroups: [],
|
|
1678
|
+
columns: {}
|
|
1679
|
+
};
|
|
1680
|
+
}), columns = _b.columns, colgroups = _b.colgroups;
|
|
1655
1681
|
var grid$1 = grid(maxRows, maxColumns);
|
|
1656
1682
|
return {
|
|
1657
1683
|
grid: grid$1,
|
|
@@ -2406,6 +2432,46 @@
|
|
|
2406
2432
|
};
|
|
2407
2433
|
};
|
|
2408
2434
|
|
|
2435
|
+
var needManualCalc = function () {
|
|
2436
|
+
var browser = detect$3().browser;
|
|
2437
|
+
return browser.isIE() || browser.isEdge();
|
|
2438
|
+
};
|
|
2439
|
+
var toNumber = function (px, fallback) {
|
|
2440
|
+
return toFloat(px).getOr(fallback);
|
|
2441
|
+
};
|
|
2442
|
+
var getProp = function (element, name, fallback) {
|
|
2443
|
+
return toNumber(get$a(element, name), fallback);
|
|
2444
|
+
};
|
|
2445
|
+
var getBoxSizing = function (element) {
|
|
2446
|
+
return get$a(element, 'box-sizing');
|
|
2447
|
+
};
|
|
2448
|
+
var calcContentBoxSize = function (element, size, upper, lower) {
|
|
2449
|
+
var paddingUpper = getProp(element, 'padding-' + upper, 0);
|
|
2450
|
+
var paddingLower = getProp(element, 'padding-' + lower, 0);
|
|
2451
|
+
var borderUpper = getProp(element, 'border-' + upper + '-width', 0);
|
|
2452
|
+
var borderLower = getProp(element, 'border-' + lower + '-width', 0);
|
|
2453
|
+
return size - paddingUpper - paddingLower - borderUpper - borderLower;
|
|
2454
|
+
};
|
|
2455
|
+
var getCalculatedHeight = function (element, boxSizing) {
|
|
2456
|
+
var dom = element.dom;
|
|
2457
|
+
var height = dom.getBoundingClientRect().height || dom.offsetHeight;
|
|
2458
|
+
return boxSizing === 'border-box' ? height : calcContentBoxSize(element, height, 'top', 'bottom');
|
|
2459
|
+
};
|
|
2460
|
+
var getCalculatedWidth = function (element, boxSizing) {
|
|
2461
|
+
var dom = element.dom;
|
|
2462
|
+
var width = dom.getBoundingClientRect().width || dom.offsetWidth;
|
|
2463
|
+
return boxSizing === 'border-box' ? width : calcContentBoxSize(element, width, 'left', 'right');
|
|
2464
|
+
};
|
|
2465
|
+
var getHeight$1 = function (element) {
|
|
2466
|
+
return needManualCalc() ? getCalculatedHeight(element, getBoxSizing(element)) : getProp(element, 'height', element.dom.offsetHeight);
|
|
2467
|
+
};
|
|
2468
|
+
var getWidth = function (element) {
|
|
2469
|
+
return needManualCalc() ? getCalculatedWidth(element, getBoxSizing(element)) : getProp(element, 'width', element.dom.offsetWidth);
|
|
2470
|
+
};
|
|
2471
|
+
var getInnerWidth = function (element) {
|
|
2472
|
+
return getCalculatedWidth(element, 'content-box');
|
|
2473
|
+
};
|
|
2474
|
+
|
|
2409
2475
|
var api$1 = Dimension('width', function (element) {
|
|
2410
2476
|
return element.dom.offsetWidth;
|
|
2411
2477
|
});
|
|
@@ -2415,6 +2481,8 @@
|
|
|
2415
2481
|
var getOuter$2 = function (element) {
|
|
2416
2482
|
return api$1.getOuter(element);
|
|
2417
2483
|
};
|
|
2484
|
+
var getInner = getInnerWidth;
|
|
2485
|
+
var getRuntime$1 = getWidth;
|
|
2418
2486
|
|
|
2419
2487
|
var columns = function (warehouse, isValidCell) {
|
|
2420
2488
|
if (isValidCell === void 0) {
|
|
@@ -2537,6 +2605,7 @@
|
|
|
2537
2605
|
var getOuter$1 = function (element) {
|
|
2538
2606
|
return api.getOuter(element);
|
|
2539
2607
|
};
|
|
2608
|
+
var getRuntime = getHeight$1;
|
|
2540
2609
|
|
|
2541
2610
|
var r = function (left, top) {
|
|
2542
2611
|
var translate = function (x, y) {
|
|
@@ -2744,57 +2813,14 @@
|
|
|
2744
2813
|
});
|
|
2745
2814
|
};
|
|
2746
2815
|
|
|
2747
|
-
var needManualCalc = function () {
|
|
2748
|
-
var browser = detect$3().browser;
|
|
2749
|
-
return browser.isIE() || browser.isEdge();
|
|
2750
|
-
};
|
|
2751
|
-
var toNumber = function (px, fallback) {
|
|
2752
|
-
var num = parseFloat(px);
|
|
2753
|
-
return isNaN(num) ? fallback : num;
|
|
2754
|
-
};
|
|
2755
|
-
var getProp = function (elm, name, fallback) {
|
|
2756
|
-
return toNumber(get$a(elm, name), fallback);
|
|
2757
|
-
};
|
|
2758
|
-
var getCalculatedHeight = function (cell) {
|
|
2759
|
-
var height = cell.dom.getBoundingClientRect().height;
|
|
2760
|
-
var boxSizing = get$a(cell, 'box-sizing');
|
|
2761
|
-
if (boxSizing === 'border-box') {
|
|
2762
|
-
return height;
|
|
2763
|
-
} else {
|
|
2764
|
-
var paddingTop = getProp(cell, 'padding-top', 0);
|
|
2765
|
-
var paddingBottom = getProp(cell, 'padding-bottom', 0);
|
|
2766
|
-
var borderTop = getProp(cell, 'border-top-width', 0);
|
|
2767
|
-
var borderBottom = getProp(cell, 'border-bottom-width', 0);
|
|
2768
|
-
var borders = borderTop + borderBottom;
|
|
2769
|
-
return height - paddingTop - paddingBottom - borders;
|
|
2770
|
-
}
|
|
2771
|
-
};
|
|
2772
|
-
var getCalculatedWidth = function (cell) {
|
|
2773
|
-
var width = cell.dom.getBoundingClientRect().width;
|
|
2774
|
-
var boxSizing = get$a(cell, 'box-sizing');
|
|
2775
|
-
if (boxSizing === 'border-box') {
|
|
2776
|
-
return width;
|
|
2777
|
-
} else {
|
|
2778
|
-
var paddingLeft = getProp(cell, 'padding-left', 0);
|
|
2779
|
-
var paddingRight = getProp(cell, 'padding-right', 0);
|
|
2780
|
-
var borderLeft = getProp(cell, 'border-left-width', 0);
|
|
2781
|
-
var borderRight = getProp(cell, 'border-right-width', 0);
|
|
2782
|
-
var borders = borderLeft + borderRight;
|
|
2783
|
-
return width - paddingLeft - paddingRight - borders;
|
|
2784
|
-
}
|
|
2785
|
-
};
|
|
2786
|
-
var getHeight$1 = function (cell) {
|
|
2787
|
-
return needManualCalc() ? getCalculatedHeight(cell) : getProp(cell, 'height', get$7(cell));
|
|
2788
|
-
};
|
|
2789
|
-
var getWidth = function (cell) {
|
|
2790
|
-
return needManualCalc() ? getCalculatedWidth(cell) : getProp(cell, 'width', get$8(cell));
|
|
2791
|
-
};
|
|
2792
|
-
|
|
2793
2816
|
var rPercentageBasedSizeRegex = /(\d+(\.\d+)?)%/;
|
|
2794
2817
|
var rPixelBasedSizeRegex = /(\d+(\.\d+)?)px|em/;
|
|
2795
|
-
var
|
|
2796
|
-
|
|
2797
|
-
|
|
2818
|
+
var isCol$2 = isTag('col');
|
|
2819
|
+
var getPercentSize = function (elm, outerGetter, innerGetter) {
|
|
2820
|
+
var relativeParent = parentElement(elm).getOrThunk(function () {
|
|
2821
|
+
return getBody$1(owner(elm));
|
|
2822
|
+
});
|
|
2823
|
+
return outerGetter(elm) / innerGetter(relativeParent) * 100;
|
|
2798
2824
|
};
|
|
2799
2825
|
var setPixelWidth = function (cell, amount) {
|
|
2800
2826
|
set$1(cell, 'width', amount + 'px');
|
|
@@ -2806,9 +2832,7 @@
|
|
|
2806
2832
|
set$1(cell, 'height', amount + 'px');
|
|
2807
2833
|
};
|
|
2808
2834
|
var getHeightValue = function (cell) {
|
|
2809
|
-
return
|
|
2810
|
-
return getHeight$1(cell) + 'px';
|
|
2811
|
-
});
|
|
2835
|
+
return getRuntime(cell) + 'px';
|
|
2812
2836
|
};
|
|
2813
2837
|
var convert = function (cell, number, getter, setter) {
|
|
2814
2838
|
var newSize = table(cell).map(function (table) {
|
|
@@ -2819,7 +2843,7 @@
|
|
|
2819
2843
|
return newSize;
|
|
2820
2844
|
};
|
|
2821
2845
|
var normalizePixelSize = function (value, cell, getter, setter) {
|
|
2822
|
-
var number =
|
|
2846
|
+
var number = parseFloat(value);
|
|
2823
2847
|
return endsWith(value, '%') && name(cell) !== 'table' ? convert(cell, number, getter, setter) : number;
|
|
2824
2848
|
};
|
|
2825
2849
|
var getTotalHeight = function (cell) {
|
|
@@ -2834,57 +2858,24 @@
|
|
|
2834
2858
|
var span = getSpan(cell, type);
|
|
2835
2859
|
return v / span;
|
|
2836
2860
|
};
|
|
2837
|
-
var
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
return Optional.some(width);
|
|
2861
|
+
var getRaw$1 = function (element, prop) {
|
|
2862
|
+
return getRaw$2(element, prop).orThunk(function () {
|
|
2863
|
+
return getOpt(element, prop).map(function (val) {
|
|
2864
|
+
return val + 'px';
|
|
2865
|
+
});
|
|
2843
2866
|
});
|
|
2844
2867
|
};
|
|
2845
|
-
var
|
|
2846
|
-
return
|
|
2847
|
-
};
|
|
2848
|
-
var choosePercentageSize = function (element, width, tableSize) {
|
|
2849
|
-
var percentMatch = rPercentageBasedSizeRegex.exec(width);
|
|
2850
|
-
if (percentMatch !== null) {
|
|
2851
|
-
return parseFloat(percentMatch[1]);
|
|
2852
|
-
} else {
|
|
2853
|
-
var intWidth = getWidth(element);
|
|
2854
|
-
return normalizePercentageWidth(intWidth, tableSize);
|
|
2855
|
-
}
|
|
2856
|
-
};
|
|
2857
|
-
var getPercentageWidth = function (cell, tableSize) {
|
|
2858
|
-
var width = getRawWidth$1(cell);
|
|
2859
|
-
return width.fold(function () {
|
|
2860
|
-
var intWidth = get$8(cell);
|
|
2861
|
-
return normalizePercentageWidth(intWidth, tableSize);
|
|
2862
|
-
}, function (w) {
|
|
2863
|
-
return choosePercentageSize(cell, w, tableSize);
|
|
2864
|
-
});
|
|
2868
|
+
var getRawWidth$1 = function (element) {
|
|
2869
|
+
return getRaw$1(element, 'width');
|
|
2865
2870
|
};
|
|
2866
|
-
var
|
|
2867
|
-
return
|
|
2871
|
+
var getRawHeight = function (element) {
|
|
2872
|
+
return getRaw$1(element, 'height');
|
|
2868
2873
|
};
|
|
2869
|
-
var
|
|
2870
|
-
|
|
2871
|
-
if (pixelMatch !== null) {
|
|
2872
|
-
return parseInt(pixelMatch[1], 10);
|
|
2873
|
-
}
|
|
2874
|
-
var percentMatch = rPercentageBasedSizeRegex.exec(width);
|
|
2875
|
-
if (percentMatch !== null) {
|
|
2876
|
-
var floatWidth = parseFloat(percentMatch[1]);
|
|
2877
|
-
return normalizePixelWidth(floatWidth, tableSize);
|
|
2878
|
-
}
|
|
2879
|
-
return getWidth(element);
|
|
2874
|
+
var getPercentageWidth = function (cell) {
|
|
2875
|
+
return getPercentSize(cell, get$8, getInner);
|
|
2880
2876
|
};
|
|
2881
|
-
var getPixelWidth$1 = function (cell
|
|
2882
|
-
|
|
2883
|
-
return width.fold(function () {
|
|
2884
|
-
return getWidth(cell);
|
|
2885
|
-
}, function (w) {
|
|
2886
|
-
return choosePixelSize(cell, w, tableSize);
|
|
2887
|
-
});
|
|
2877
|
+
var getPixelWidth$1 = function (cell) {
|
|
2878
|
+
return isCol$2(cell) ? get$8(cell) : getRuntime$1(cell);
|
|
2888
2879
|
};
|
|
2889
2880
|
var getHeight = function (cell) {
|
|
2890
2881
|
return get$6(cell, 'rowspan', getTotalHeight);
|
|
@@ -2905,8 +2896,8 @@
|
|
|
2905
2896
|
var getPixelTableWidth = function (table) {
|
|
2906
2897
|
return get$8(table) + 'px';
|
|
2907
2898
|
};
|
|
2908
|
-
var getPercentTableWidth
|
|
2909
|
-
return getPercentSize(table, get$8) + '%';
|
|
2899
|
+
var getPercentTableWidth = function (table) {
|
|
2900
|
+
return getPercentSize(table, get$8, getInner) + '%';
|
|
2910
2901
|
};
|
|
2911
2902
|
var isPercentSizing$1 = function (table) {
|
|
2912
2903
|
return getRawWidth$1(table).exists(function (size) {
|
|
@@ -2922,33 +2913,27 @@
|
|
|
2922
2913
|
return getRawWidth$1(table).isNone();
|
|
2923
2914
|
};
|
|
2924
2915
|
var percentageBasedSizeRegex = constant(rPercentageBasedSizeRegex);
|
|
2925
|
-
var pixelBasedSizeRegex = constant(rPixelBasedSizeRegex);
|
|
2926
2916
|
|
|
2927
2917
|
var isCol$1 = isTag('col');
|
|
2928
|
-
var
|
|
2929
|
-
return
|
|
2930
|
-
return
|
|
2918
|
+
var getRawW = function (cell) {
|
|
2919
|
+
return getRawWidth$1(cell).getOrThunk(function () {
|
|
2920
|
+
return getPixelWidth$1(cell) + 'px';
|
|
2931
2921
|
});
|
|
2932
2922
|
};
|
|
2933
|
-
var getRawW = function (cell, tableSize) {
|
|
2934
|
-
var fallback = function (e) {
|
|
2935
|
-
return isCol$1(e) ? get$8(e) : getPixelWidth$1(e, tableSize);
|
|
2936
|
-
};
|
|
2937
|
-
return getRaw$1(cell, 'width', fallback);
|
|
2938
|
-
};
|
|
2939
2923
|
var getRawH = function (cell) {
|
|
2940
|
-
return
|
|
2924
|
+
return getRawHeight(cell).getOrThunk(function () {
|
|
2925
|
+
return getHeight(cell) + 'px';
|
|
2926
|
+
});
|
|
2941
2927
|
};
|
|
2942
2928
|
var justCols = function (warehouse) {
|
|
2943
2929
|
return map$1(Warehouse.justColumns(warehouse), function (column) {
|
|
2944
2930
|
return Optional.from(column.element);
|
|
2945
2931
|
});
|
|
2946
2932
|
};
|
|
2947
|
-
var hasRawStyle = function (cell, prop) {
|
|
2948
|
-
return getRaw$2(cell, prop).isSome();
|
|
2949
|
-
};
|
|
2950
2933
|
var isValidColumn = function (cell) {
|
|
2951
|
-
|
|
2934
|
+
var browser = detect$3().browser;
|
|
2935
|
+
var supportsColWidths = browser.isChrome() || browser.isFirefox();
|
|
2936
|
+
return isCol$1(cell) ? supportsColWidths : true;
|
|
2952
2937
|
};
|
|
2953
2938
|
var getDimension = function (cellOpt, index, backups, filter, getter, fallback) {
|
|
2954
2939
|
return cellOpt.filter(filter).fold(function () {
|
|
@@ -2957,10 +2942,8 @@
|
|
|
2957
2942
|
return getter(cell);
|
|
2958
2943
|
});
|
|
2959
2944
|
};
|
|
2960
|
-
var getWidthFrom = function (warehouse, table, getWidth, fallback
|
|
2961
|
-
var columnCells = columns(warehouse
|
|
2962
|
-
return hasRawStyle(cell, 'width');
|
|
2963
|
-
});
|
|
2945
|
+
var getWidthFrom = function (warehouse, table, getWidth, fallback) {
|
|
2946
|
+
var columnCells = columns(warehouse);
|
|
2964
2947
|
var columns$1 = Warehouse.hasColumns(warehouse) ? justCols(warehouse) : columnCells;
|
|
2965
2948
|
var backups = [Optional.some(width.edge(table))].concat(map$1(width.positions(columnCells, table), function (pos) {
|
|
2966
2949
|
return pos.map(function (p) {
|
|
@@ -2971,7 +2954,7 @@
|
|
|
2971
2954
|
return map$1(columns$1, function (cellOption, c) {
|
|
2972
2955
|
return getDimension(cellOption, c, backups, colFilter, function (column) {
|
|
2973
2956
|
if (isValidColumn(column)) {
|
|
2974
|
-
return getWidth(column
|
|
2957
|
+
return getWidth(column);
|
|
2975
2958
|
} else {
|
|
2976
2959
|
var cell = bindFrom(columnCells[c], identity);
|
|
2977
2960
|
return getDimension(cell, c, backups, colFilter, function (cell) {
|
|
@@ -2986,8 +2969,8 @@
|
|
|
2986
2969
|
return d + 'px';
|
|
2987
2970
|
}).getOr('');
|
|
2988
2971
|
};
|
|
2989
|
-
var getRawWidths = function (warehouse, table
|
|
2990
|
-
return getWidthFrom(warehouse, table, getRawW, getDeduced
|
|
2972
|
+
var getRawWidths = function (warehouse, table) {
|
|
2973
|
+
return getWidthFrom(warehouse, table, getRawW, getDeduced);
|
|
2991
2974
|
};
|
|
2992
2975
|
var getPercentageWidths = function (warehouse, table, tableSize) {
|
|
2993
2976
|
return getWidthFrom(warehouse, table, getPercentageWidth, function (deduced) {
|
|
@@ -2996,12 +2979,12 @@
|
|
|
2996
2979
|
}, function (cellWidth) {
|
|
2997
2980
|
return cellWidth / tableSize.pixelWidth() * 100;
|
|
2998
2981
|
});
|
|
2999
|
-
}
|
|
2982
|
+
});
|
|
3000
2983
|
};
|
|
3001
2984
|
var getPixelWidths = function (warehouse, table, tableSize) {
|
|
3002
2985
|
return getWidthFrom(warehouse, table, getPixelWidth$1, function (deduced) {
|
|
3003
2986
|
return deduced.getOrThunk(tableSize.minCellWidth);
|
|
3004
|
-
}
|
|
2987
|
+
});
|
|
3005
2988
|
};
|
|
3006
2989
|
var getHeightFrom = function (warehouse, table, direction, getHeight, fallback) {
|
|
3007
2990
|
var rows$1 = rows(warehouse);
|
|
@@ -3023,24 +3006,17 @@
|
|
|
3023
3006
|
return getHeightFrom(warehouse, table, direction, getRawH, getDeduced);
|
|
3024
3007
|
};
|
|
3025
3008
|
|
|
3026
|
-
var
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
};
|
|
3034
|
-
return {
|
|
3035
|
-
get: get,
|
|
3036
|
-
set: set
|
|
3009
|
+
var widthLookup = function (table, getter) {
|
|
3010
|
+
return function () {
|
|
3011
|
+
if (inBody(table)) {
|
|
3012
|
+
return getter(table);
|
|
3013
|
+
} else {
|
|
3014
|
+
return parseFloat(getRaw$2(table, 'width').getOr('0'));
|
|
3015
|
+
}
|
|
3037
3016
|
};
|
|
3038
3017
|
};
|
|
3039
|
-
|
|
3040
3018
|
var noneSize = function (table) {
|
|
3041
|
-
var getWidth =
|
|
3042
|
-
return get$8(table);
|
|
3043
|
-
};
|
|
3019
|
+
var getWidth = widthLookup(table, get$8);
|
|
3044
3020
|
var zero = constant(0);
|
|
3045
3021
|
var getWidths = function (warehouse, tableSize) {
|
|
3046
3022
|
return getPixelWidths(warehouse, table, tableSize);
|
|
@@ -3058,32 +3034,32 @@
|
|
|
3058
3034
|
label: 'none'
|
|
3059
3035
|
};
|
|
3060
3036
|
};
|
|
3061
|
-
var percentageSize = function (
|
|
3062
|
-
var
|
|
3063
|
-
|
|
3037
|
+
var percentageSize = function (table) {
|
|
3038
|
+
var getFloatWidth = widthLookup(table, function (elem) {
|
|
3039
|
+
return parseFloat(getPercentTableWidth(elem));
|
|
3040
|
+
});
|
|
3041
|
+
var getWidth = widthLookup(table, get$8);
|
|
3064
3042
|
var getCellDelta = function (delta) {
|
|
3065
|
-
return delta /
|
|
3043
|
+
return delta / getWidth() * 100;
|
|
3066
3044
|
};
|
|
3067
3045
|
var singleColumnWidth = function (w, _delta) {
|
|
3068
3046
|
return [100 - w];
|
|
3069
3047
|
};
|
|
3070
3048
|
var minCellWidth = function () {
|
|
3071
|
-
return minWidth() /
|
|
3049
|
+
return minWidth() / getWidth() * 100;
|
|
3072
3050
|
};
|
|
3073
3051
|
var adjustTableWidth = function (delta) {
|
|
3074
|
-
var currentWidth =
|
|
3052
|
+
var currentWidth = getFloatWidth();
|
|
3075
3053
|
var change = delta / 100 * currentWidth;
|
|
3076
3054
|
var newWidth = currentWidth + change;
|
|
3077
3055
|
setPercentageWidth(table, newWidth);
|
|
3078
|
-
floatWidth.set(newWidth);
|
|
3079
|
-
pixelWidth.set(get$8(table));
|
|
3080
3056
|
};
|
|
3081
3057
|
var getWidths = function (warehouse, tableSize) {
|
|
3082
3058
|
return getPercentageWidths(warehouse, table, tableSize);
|
|
3083
3059
|
};
|
|
3084
3060
|
return {
|
|
3085
|
-
width:
|
|
3086
|
-
pixelWidth:
|
|
3061
|
+
width: getFloatWidth,
|
|
3062
|
+
pixelWidth: getWidth,
|
|
3087
3063
|
getWidths: getWidths,
|
|
3088
3064
|
getCellDelta: getCellDelta,
|
|
3089
3065
|
singleColumnWidth: singleColumnWidth,
|
|
@@ -3094,9 +3070,8 @@
|
|
|
3094
3070
|
label: 'percent'
|
|
3095
3071
|
};
|
|
3096
3072
|
};
|
|
3097
|
-
var pixelSize = function (
|
|
3098
|
-
var
|
|
3099
|
-
var getWidth = width.get;
|
|
3073
|
+
var pixelSize = function (table) {
|
|
3074
|
+
var getWidth = widthLookup(table, get$8);
|
|
3100
3075
|
var getCellDelta = identity;
|
|
3101
3076
|
var singleColumnWidth = function (w, delta) {
|
|
3102
3077
|
var newNext = Math.max(minWidth(), w + delta);
|
|
@@ -3105,7 +3080,6 @@
|
|
|
3105
3080
|
var adjustTableWidth = function (delta) {
|
|
3106
3081
|
var newWidth = getWidth() + delta;
|
|
3107
3082
|
setPixelWidth(table, newWidth);
|
|
3108
|
-
width.set(newWidth);
|
|
3109
3083
|
};
|
|
3110
3084
|
var getWidths = function (warehouse, tableSize) {
|
|
3111
3085
|
return getPixelWidths(warehouse, table, tableSize);
|
|
@@ -3126,15 +3100,10 @@
|
|
|
3126
3100
|
var chooseSize = function (element, width) {
|
|
3127
3101
|
var percentMatch = percentageBasedSizeRegex().exec(width);
|
|
3128
3102
|
if (percentMatch !== null) {
|
|
3129
|
-
return percentageSize(
|
|
3130
|
-
}
|
|
3131
|
-
|
|
3132
|
-
if (pixelMatch !== null) {
|
|
3133
|
-
var intWidth = parseInt(pixelMatch[1], 10);
|
|
3134
|
-
return pixelSize(intWidth, element);
|
|
3103
|
+
return percentageSize(element);
|
|
3104
|
+
} else {
|
|
3105
|
+
return pixelSize(element);
|
|
3135
3106
|
}
|
|
3136
|
-
var fallbackWidth = get$8(element);
|
|
3137
|
-
return pixelSize(fallbackWidth, element);
|
|
3138
3107
|
};
|
|
3139
3108
|
var getTableSize = function (table) {
|
|
3140
3109
|
var width = getRawWidth$1(table);
|
|
@@ -3431,6 +3400,7 @@
|
|
|
3431
3400
|
row: createRow$1(doc),
|
|
3432
3401
|
cell: newCell,
|
|
3433
3402
|
replace: replace$1,
|
|
3403
|
+
colGap: createCol(doc),
|
|
3434
3404
|
gap: createCell(doc)
|
|
3435
3405
|
};
|
|
3436
3406
|
};
|
|
@@ -3441,6 +3411,7 @@
|
|
|
3441
3411
|
row: createRow$1(doc),
|
|
3442
3412
|
cell: createCell(doc),
|
|
3443
3413
|
replace: pasteReplace,
|
|
3414
|
+
colGap: createCol(doc),
|
|
3444
3415
|
gap: createCell(doc)
|
|
3445
3416
|
};
|
|
3446
3417
|
};
|
|
@@ -3455,55 +3426,6 @@
|
|
|
3455
3426
|
return map$1(nodes, SugarElement.fromDom);
|
|
3456
3427
|
};
|
|
3457
3428
|
|
|
3458
|
-
var fireNewRow = function (editor, row) {
|
|
3459
|
-
return editor.fire('newrow', { node: row });
|
|
3460
|
-
};
|
|
3461
|
-
var fireNewCell = function (editor, cell) {
|
|
3462
|
-
return editor.fire('newcell', { node: cell });
|
|
3463
|
-
};
|
|
3464
|
-
var fireObjectResizeStart = function (editor, target, width, height, origin) {
|
|
3465
|
-
editor.fire('ObjectResizeStart', {
|
|
3466
|
-
target: target,
|
|
3467
|
-
width: width,
|
|
3468
|
-
height: height,
|
|
3469
|
-
origin: origin
|
|
3470
|
-
});
|
|
3471
|
-
};
|
|
3472
|
-
var fireObjectResized = function (editor, target, width, height, origin) {
|
|
3473
|
-
editor.fire('ObjectResized', {
|
|
3474
|
-
target: target,
|
|
3475
|
-
width: width,
|
|
3476
|
-
height: height,
|
|
3477
|
-
origin: origin
|
|
3478
|
-
});
|
|
3479
|
-
};
|
|
3480
|
-
var fireTableSelectionChange = function (editor, cells, start, finish, otherCells) {
|
|
3481
|
-
editor.fire('TableSelectionChange', {
|
|
3482
|
-
cells: cells,
|
|
3483
|
-
start: start,
|
|
3484
|
-
finish: finish,
|
|
3485
|
-
otherCells: otherCells
|
|
3486
|
-
});
|
|
3487
|
-
};
|
|
3488
|
-
var fireTableSelectionClear = function (editor) {
|
|
3489
|
-
editor.fire('TableSelectionClear');
|
|
3490
|
-
};
|
|
3491
|
-
var fireTableModified = function (editor, table, data) {
|
|
3492
|
-
editor.fire('TableModified', __assign(__assign({}, data), { table: table }));
|
|
3493
|
-
};
|
|
3494
|
-
var styleModified = {
|
|
3495
|
-
structure: false,
|
|
3496
|
-
style: true
|
|
3497
|
-
};
|
|
3498
|
-
var structureModified = {
|
|
3499
|
-
structure: true,
|
|
3500
|
-
style: false
|
|
3501
|
-
};
|
|
3502
|
-
var styleAndStructureModified = {
|
|
3503
|
-
structure: true,
|
|
3504
|
-
style: true
|
|
3505
|
-
};
|
|
3506
|
-
|
|
3507
3429
|
var getNodeName = function (elm) {
|
|
3508
3430
|
return elm.nodeName.toLowerCase();
|
|
3509
3431
|
};
|
|
@@ -3682,7 +3604,7 @@
|
|
|
3682
3604
|
return element.dom.innerText;
|
|
3683
3605
|
}).join('');
|
|
3684
3606
|
};
|
|
3685
|
-
var registerEvents = function (editor, selections, actions
|
|
3607
|
+
var registerEvents = function (editor, selections, actions) {
|
|
3686
3608
|
editor.on('BeforeGetContent', function (e) {
|
|
3687
3609
|
var multiCellContext = function (cells) {
|
|
3688
3610
|
e.preventDefault();
|
|
@@ -3708,11 +3630,8 @@
|
|
|
3708
3630
|
var doc = SugarElement.fromDom(editor.getDoc());
|
|
3709
3631
|
var generators = paste$1(doc);
|
|
3710
3632
|
var targets = paste(cell, elements[0], generators);
|
|
3711
|
-
actions.pasteCells(table, targets).each(function (
|
|
3712
|
-
editor.selection.setRng(data.rng);
|
|
3633
|
+
actions.pasteCells(table, targets).each(function () {
|
|
3713
3634
|
editor.focus();
|
|
3714
|
-
cellSelection.clear(table);
|
|
3715
|
-
fireTableModified(editor, table.dom, data.effect);
|
|
3716
3635
|
});
|
|
3717
3636
|
}
|
|
3718
3637
|
});
|
|
@@ -4221,7 +4140,7 @@
|
|
|
4221
4140
|
var getUnit = function (newSize) {
|
|
4222
4141
|
return validate(newSize).fold(constant('px'), constant('px'), constant('%'));
|
|
4223
4142
|
};
|
|
4224
|
-
var redistribute = function (table, optWidth, optHeight
|
|
4143
|
+
var redistribute = function (table, optWidth, optHeight) {
|
|
4225
4144
|
var warehouse = Warehouse.fromTable(table);
|
|
4226
4145
|
var rows = warehouse.all;
|
|
4227
4146
|
var cells = Warehouse.justCells(warehouse);
|
|
@@ -4229,7 +4148,7 @@
|
|
|
4229
4148
|
optWidth.each(function (newWidth) {
|
|
4230
4149
|
var widthUnit = getUnit(newWidth);
|
|
4231
4150
|
var totalWidth = get$8(table);
|
|
4232
|
-
var oldWidths = getRawWidths(warehouse, table
|
|
4151
|
+
var oldWidths = getRawWidths(warehouse, table);
|
|
4233
4152
|
var nuWidths = redistribute$1(oldWidths, totalWidth, newWidth);
|
|
4234
4153
|
if (Warehouse.hasColumns(warehouse)) {
|
|
4235
4154
|
redistributeToColumns(nuWidths, columns, widthUnit);
|
|
@@ -4250,7 +4169,6 @@
|
|
|
4250
4169
|
var isPercentSizing = isPercentSizing$1;
|
|
4251
4170
|
var isPixelSizing = isPixelSizing$1;
|
|
4252
4171
|
var isNoneSizing = isNoneSizing$1;
|
|
4253
|
-
var getPercentTableWidth = getPercentTableWidth$1;
|
|
4254
4172
|
|
|
4255
4173
|
var getGridSize = function (table) {
|
|
4256
4174
|
var warehouse = Warehouse.fromTable(table);
|
|
@@ -5097,6 +5015,55 @@
|
|
|
5097
5015
|
};
|
|
5098
5016
|
var TableResize = { create: create$3 };
|
|
5099
5017
|
|
|
5018
|
+
var fireNewRow = function (editor, row) {
|
|
5019
|
+
return editor.fire('newrow', { node: row });
|
|
5020
|
+
};
|
|
5021
|
+
var fireNewCell = function (editor, cell) {
|
|
5022
|
+
return editor.fire('newcell', { node: cell });
|
|
5023
|
+
};
|
|
5024
|
+
var fireObjectResizeStart = function (editor, target, width, height, origin) {
|
|
5025
|
+
editor.fire('ObjectResizeStart', {
|
|
5026
|
+
target: target,
|
|
5027
|
+
width: width,
|
|
5028
|
+
height: height,
|
|
5029
|
+
origin: origin
|
|
5030
|
+
});
|
|
5031
|
+
};
|
|
5032
|
+
var fireObjectResized = function (editor, target, width, height, origin) {
|
|
5033
|
+
editor.fire('ObjectResized', {
|
|
5034
|
+
target: target,
|
|
5035
|
+
width: width,
|
|
5036
|
+
height: height,
|
|
5037
|
+
origin: origin
|
|
5038
|
+
});
|
|
5039
|
+
};
|
|
5040
|
+
var fireTableSelectionChange = function (editor, cells, start, finish, otherCells) {
|
|
5041
|
+
editor.fire('TableSelectionChange', {
|
|
5042
|
+
cells: cells,
|
|
5043
|
+
start: start,
|
|
5044
|
+
finish: finish,
|
|
5045
|
+
otherCells: otherCells
|
|
5046
|
+
});
|
|
5047
|
+
};
|
|
5048
|
+
var fireTableSelectionClear = function (editor) {
|
|
5049
|
+
editor.fire('TableSelectionClear');
|
|
5050
|
+
};
|
|
5051
|
+
var fireTableModified = function (editor, table, data) {
|
|
5052
|
+
editor.fire('TableModified', __assign(__assign({}, data), { table: table }));
|
|
5053
|
+
};
|
|
5054
|
+
var styleModified = {
|
|
5055
|
+
structure: false,
|
|
5056
|
+
style: true
|
|
5057
|
+
};
|
|
5058
|
+
var structureModified = {
|
|
5059
|
+
structure: true,
|
|
5060
|
+
style: false
|
|
5061
|
+
};
|
|
5062
|
+
var styleAndStructureModified = {
|
|
5063
|
+
structure: true,
|
|
5064
|
+
style: true
|
|
5065
|
+
};
|
|
5066
|
+
|
|
5100
5067
|
var defaultTableToolbar = 'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol';
|
|
5101
5068
|
var defaultStyles = {
|
|
5102
5069
|
'border-collapse': 'collapse',
|
|
@@ -5127,9 +5094,12 @@
|
|
|
5127
5094
|
};
|
|
5128
5095
|
});
|
|
5129
5096
|
var determineDefaultStyles = function (editor) {
|
|
5097
|
+
var _a;
|
|
5130
5098
|
if (isPixelsForced(editor)) {
|
|
5131
|
-
var
|
|
5132
|
-
|
|
5099
|
+
var dom = editor.dom;
|
|
5100
|
+
var parentBlock = (_a = dom.getParent(editor.selection.getStart(), dom.isBlock)) !== null && _a !== void 0 ? _a : editor.getBody();
|
|
5101
|
+
var contentWidth = getInner(SugarElement.fromDom(parentBlock));
|
|
5102
|
+
return __assign(__assign({}, defaultStyles), { width: contentWidth + 'px' });
|
|
5133
5103
|
} else if (isResponsiveForced(editor)) {
|
|
5134
5104
|
return filter$1(defaultStyles, function (_value, key) {
|
|
5135
5105
|
return key !== 'width';
|
|
@@ -5260,12 +5230,9 @@
|
|
|
5260
5230
|
|
|
5261
5231
|
var get$4 = function (editor, table) {
|
|
5262
5232
|
if (isPercentagesForced(editor)) {
|
|
5263
|
-
|
|
5264
|
-
return getPercentTableWidth(table);
|
|
5265
|
-
});
|
|
5266
|
-
return TableSize.percentageSize(width, table);
|
|
5233
|
+
return TableSize.percentageSize(table);
|
|
5267
5234
|
} else if (isPixelsForced(editor)) {
|
|
5268
|
-
return TableSize.pixelSize(
|
|
5235
|
+
return TableSize.pixelSize(table);
|
|
5269
5236
|
} else {
|
|
5270
5237
|
return TableSize.getTableSize(table);
|
|
5271
5238
|
}
|
|
@@ -5274,14 +5241,14 @@
|
|
|
5274
5241
|
var cleanupLegacyAttributes = function (element) {
|
|
5275
5242
|
remove$7(element, 'width');
|
|
5276
5243
|
};
|
|
5277
|
-
var convertToPercentSize = function (table
|
|
5278
|
-
var newWidth = getPercentTableWidth
|
|
5279
|
-
redistribute(table, Optional.some(newWidth), Optional.none()
|
|
5244
|
+
var convertToPercentSize = function (table) {
|
|
5245
|
+
var newWidth = getPercentTableWidth(table);
|
|
5246
|
+
redistribute(table, Optional.some(newWidth), Optional.none());
|
|
5280
5247
|
cleanupLegacyAttributes(table);
|
|
5281
5248
|
};
|
|
5282
|
-
var convertToPixelSize = function (table
|
|
5249
|
+
var convertToPixelSize = function (table) {
|
|
5283
5250
|
var newWidth = getPixelTableWidth(table);
|
|
5284
|
-
redistribute(table, Optional.some(newWidth), Optional.none()
|
|
5251
|
+
redistribute(table, Optional.some(newWidth), Optional.none());
|
|
5285
5252
|
cleanupLegacyAttributes(table);
|
|
5286
5253
|
};
|
|
5287
5254
|
var convertToNoneSize = function (table) {
|
|
@@ -5295,14 +5262,8 @@
|
|
|
5295
5262
|
cleanupLegacyAttributes(table);
|
|
5296
5263
|
};
|
|
5297
5264
|
|
|
5298
|
-
var enforcePercentage =
|
|
5299
|
-
|
|
5300
|
-
convertToPercentSize(table, tableSizing);
|
|
5301
|
-
};
|
|
5302
|
-
var enforcePixels = function (editor, table) {
|
|
5303
|
-
var tableSizing = get$4(editor, table);
|
|
5304
|
-
convertToPixelSize(table, tableSizing);
|
|
5305
|
-
};
|
|
5265
|
+
var enforcePercentage = convertToPercentSize;
|
|
5266
|
+
var enforcePixels = convertToPixelSize;
|
|
5306
5267
|
var enforceNone = convertToNoneSize;
|
|
5307
5268
|
var syncPixels = function (table) {
|
|
5308
5269
|
var warehouse = Warehouse.fromTable(table);
|
|
@@ -5368,7 +5329,7 @@
|
|
|
5368
5329
|
var afterCornerResize = function (table, origin, width) {
|
|
5369
5330
|
var isRightEdgeResize = endsWith(origin, 'e');
|
|
5370
5331
|
if (startRawW === '') {
|
|
5371
|
-
enforcePercentage(
|
|
5332
|
+
enforcePercentage(table);
|
|
5372
5333
|
}
|
|
5373
5334
|
if (width !== startW && startRawW !== '') {
|
|
5374
5335
|
set$1(table, 'width', startRawW);
|
|
@@ -5429,12 +5390,12 @@
|
|
|
5429
5390
|
editor.dom.addClass(clone, 'mce-' + getColumnResizingBehaviour(editor) + '-columns');
|
|
5430
5391
|
});
|
|
5431
5392
|
if (!isPixelSizing(table) && isPixelsForced(editor)) {
|
|
5432
|
-
enforcePixels(
|
|
5393
|
+
enforcePixels(table);
|
|
5433
5394
|
} else if (!isPercentSizing(table) && isPercentagesForced(editor)) {
|
|
5434
|
-
enforcePercentage(
|
|
5395
|
+
enforcePercentage(table);
|
|
5435
5396
|
}
|
|
5436
5397
|
if (isNoneSizing(table) && startsWith(e.origin, barResizerPrefix)) {
|
|
5437
|
-
enforcePercentage(
|
|
5398
|
+
enforcePercentage(table);
|
|
5438
5399
|
}
|
|
5439
5400
|
startW = e.width;
|
|
5440
5401
|
startRawW = isResponsiveForced(editor) ? '' : getRawWidth(editor, targetElm).getOr('');
|
|
@@ -5521,7 +5482,12 @@
|
|
|
5521
5482
|
}
|
|
5522
5483
|
};
|
|
5523
5484
|
|
|
5524
|
-
var
|
|
5485
|
+
var isHeaderCell = isTag('th');
|
|
5486
|
+
var isHeaderCells = function (cells) {
|
|
5487
|
+
return forall(cells, function (cell) {
|
|
5488
|
+
return isHeaderCell(cell.element);
|
|
5489
|
+
});
|
|
5490
|
+
};
|
|
5525
5491
|
var getRowHeaderType = function (isHeaderRow, isHeaderCells) {
|
|
5526
5492
|
if (isHeaderRow && isHeaderCells) {
|
|
5527
5493
|
return 'sectionCells';
|
|
@@ -5547,7 +5513,7 @@
|
|
|
5547
5513
|
};
|
|
5548
5514
|
var findCommonCellType = function (cells) {
|
|
5549
5515
|
var headerCells = filter$2(cells, function (cell) {
|
|
5550
|
-
return
|
|
5516
|
+
return isHeaderCell(cell.element);
|
|
5551
5517
|
});
|
|
5552
5518
|
if (headerCells.length === 0) {
|
|
5553
5519
|
return Optional.some('td');
|
|
@@ -5775,13 +5741,13 @@
|
|
|
5775
5741
|
return index.getOr(xs.length);
|
|
5776
5742
|
};
|
|
5777
5743
|
var subgrid = function (grid, row, column, comparator) {
|
|
5778
|
-
var
|
|
5779
|
-
var
|
|
5780
|
-
var
|
|
5781
|
-
var
|
|
5744
|
+
var gridRow = getRow(grid, row);
|
|
5745
|
+
var isColRow = gridRow.section === 'colgroup';
|
|
5746
|
+
var colspan = findDiff(gridRow.cells.slice(column), comparator);
|
|
5747
|
+
var rowspan = isColRow ? 1 : findDiff(getColumn(grid.slice(row), column), comparator);
|
|
5782
5748
|
return {
|
|
5783
|
-
colspan:
|
|
5784
|
-
rowspan:
|
|
5749
|
+
colspan: colspan,
|
|
5750
|
+
rowspan: rowspan
|
|
5785
5751
|
};
|
|
5786
5752
|
};
|
|
5787
5753
|
|
|
@@ -5812,10 +5778,16 @@
|
|
|
5812
5778
|
var toGrid = function (warehouse, generators, isNew) {
|
|
5813
5779
|
var grid = [];
|
|
5814
5780
|
each$2(warehouse.colgroups, function (colgroup) {
|
|
5815
|
-
var
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5781
|
+
var colgroupCols = [];
|
|
5782
|
+
for (var columnIndex = 0; columnIndex < warehouse.grid.columns; columnIndex++) {
|
|
5783
|
+
var element = Warehouse.getColumnAt(warehouse, columnIndex).map(function (column) {
|
|
5784
|
+
return elementnew(column.element, isNew, false);
|
|
5785
|
+
}).getOrThunk(function () {
|
|
5786
|
+
return elementnew(generators.colGap(), true, false);
|
|
5787
|
+
});
|
|
5788
|
+
colgroupCols.push(element);
|
|
5789
|
+
}
|
|
5790
|
+
grid.push(rowcells(colgroup.element, colgroupCols, 'colgroup', isNew));
|
|
5819
5791
|
});
|
|
5820
5792
|
for (var rowIndex = 0; rowIndex < warehouse.grid.rows; rowIndex++) {
|
|
5821
5793
|
var rowCells = [];
|
|
@@ -6346,51 +6318,125 @@
|
|
|
6346
6318
|
return cols.concat(rows.slice(0, start)).concat(rows.slice(finish + 1));
|
|
6347
6319
|
};
|
|
6348
6320
|
|
|
6321
|
+
var notInStartRow = function (grid, rowIndex, colIndex, comparator) {
|
|
6322
|
+
return getCellElement(grid[rowIndex], colIndex) !== undefined && (rowIndex > 0 && comparator(getCellElement(grid[rowIndex - 1], colIndex), getCellElement(grid[rowIndex], colIndex)));
|
|
6323
|
+
};
|
|
6324
|
+
var notInStartColumn = function (row, index, comparator) {
|
|
6325
|
+
return index > 0 && comparator(getCellElement(row, index - 1), getCellElement(row, index));
|
|
6326
|
+
};
|
|
6327
|
+
var isDuplicatedCell = function (grid, rowIndex, colIndex, comparator) {
|
|
6328
|
+
return notInStartRow(grid, rowIndex, colIndex, comparator) || notInStartColumn(grid[rowIndex], colIndex, comparator);
|
|
6329
|
+
};
|
|
6330
|
+
var rowReplacerPredicate = function (targetRow, columnHeaders) {
|
|
6331
|
+
var entireTableIsHeader = forall(columnHeaders, identity) && isHeaderCells(targetRow.cells);
|
|
6332
|
+
return entireTableIsHeader ? always : function (cell, _rowIndex, colIndex) {
|
|
6333
|
+
var type = name(cell.element);
|
|
6334
|
+
return !(type === 'th' && columnHeaders[colIndex]);
|
|
6335
|
+
};
|
|
6336
|
+
};
|
|
6337
|
+
var columnReplacePredicate = function (targetColumn, rowHeaders) {
|
|
6338
|
+
var entireTableIsHeader = forall(rowHeaders, identity) && isHeaderCells(targetColumn);
|
|
6339
|
+
return entireTableIsHeader ? always : function (cell, rowIndex, _colIndex) {
|
|
6340
|
+
var type = name(cell.element);
|
|
6341
|
+
return !(type === 'th' && rowHeaders[rowIndex]);
|
|
6342
|
+
};
|
|
6343
|
+
};
|
|
6344
|
+
var determineScope = function (applyScope, element, newScope, isInHeader) {
|
|
6345
|
+
var hasSpan = function (scope) {
|
|
6346
|
+
return scope === 'row' ? hasRowspan(element) : hasColspan(element);
|
|
6347
|
+
};
|
|
6348
|
+
var getScope = function (scope) {
|
|
6349
|
+
return hasSpan(scope) ? scope + 'group' : scope;
|
|
6350
|
+
};
|
|
6351
|
+
if (applyScope) {
|
|
6352
|
+
return isHeaderCell(element) ? getScope(newScope) : null;
|
|
6353
|
+
} else if (isInHeader && isHeaderCell(element)) {
|
|
6354
|
+
var oppositeScope = newScope === 'row' ? 'col' : 'row';
|
|
6355
|
+
return getScope(oppositeScope);
|
|
6356
|
+
} else {
|
|
6357
|
+
return null;
|
|
6358
|
+
}
|
|
6359
|
+
};
|
|
6360
|
+
var rowScopeGenerator = function (applyScope, columnHeaders) {
|
|
6361
|
+
return function (cell, rowIndex, columnIndex) {
|
|
6362
|
+
return Optional.some(determineScope(applyScope, cell.element, 'col', columnHeaders[columnIndex]));
|
|
6363
|
+
};
|
|
6364
|
+
};
|
|
6365
|
+
var columnScopeGenerator = function (applyScope, rowHeaders) {
|
|
6366
|
+
return function (cell, rowIndex) {
|
|
6367
|
+
return Optional.some(determineScope(applyScope, cell.element, 'row', rowHeaders[rowIndex]));
|
|
6368
|
+
};
|
|
6369
|
+
};
|
|
6349
6370
|
var replace = function (cell, comparator, substitute) {
|
|
6350
6371
|
return elementnew(substitute(cell.element, comparator), true, cell.isLocked);
|
|
6351
6372
|
};
|
|
6352
|
-
var replaceIn = function (grid, targets, comparator, substitute, replacer) {
|
|
6373
|
+
var replaceIn = function (grid, targets, comparator, substitute, replacer, genScope, shouldReplace) {
|
|
6353
6374
|
var isTarget = function (cell) {
|
|
6354
6375
|
return exists(targets, function (target) {
|
|
6355
6376
|
return comparator(cell.element, target.element);
|
|
6356
6377
|
});
|
|
6357
6378
|
};
|
|
6358
|
-
return map$1(grid, function (row) {
|
|
6359
|
-
return mapCells(row, function (cell) {
|
|
6360
|
-
|
|
6379
|
+
return map$1(grid, function (row, rowIndex) {
|
|
6380
|
+
return mapCells(row, function (cell, colIndex) {
|
|
6381
|
+
if (isTarget(cell)) {
|
|
6382
|
+
var newCell_1 = shouldReplace(cell, rowIndex, colIndex) ? replacer(cell, comparator, substitute) : cell;
|
|
6383
|
+
genScope(newCell_1, rowIndex, colIndex).each(function (scope) {
|
|
6384
|
+
setOptions(newCell_1.element, { scope: Optional.from(scope) });
|
|
6385
|
+
});
|
|
6386
|
+
return newCell_1;
|
|
6387
|
+
} else {
|
|
6388
|
+
return cell;
|
|
6389
|
+
}
|
|
6361
6390
|
});
|
|
6362
6391
|
});
|
|
6363
6392
|
};
|
|
6364
|
-
var
|
|
6365
|
-
return
|
|
6393
|
+
var getColumnCells = function (rows, columnIndex, comparator) {
|
|
6394
|
+
return bind$2(rows, function (row, i) {
|
|
6395
|
+
return isDuplicatedCell(rows, i, columnIndex, comparator) ? [] : [getCell(row, columnIndex)];
|
|
6396
|
+
});
|
|
6366
6397
|
};
|
|
6367
|
-
var
|
|
6368
|
-
|
|
6398
|
+
var getRowCells = function (rows, rowIndex, comparator) {
|
|
6399
|
+
var targetRow = rows[rowIndex];
|
|
6400
|
+
return bind$2(targetRow.cells, function (item, i) {
|
|
6401
|
+
return isDuplicatedCell(rows, rowIndex, i, comparator) ? [] : [item];
|
|
6402
|
+
});
|
|
6369
6403
|
};
|
|
6370
|
-
var
|
|
6404
|
+
var replaceColumns = function (grid, indexes, applyScope, comparator, substitution) {
|
|
6371
6405
|
var rows = extractGridDetails(grid).rows;
|
|
6372
|
-
var targets = bind$2(
|
|
6373
|
-
|
|
6374
|
-
|
|
6406
|
+
var targets = bind$2(indexes, function (index) {
|
|
6407
|
+
return getColumnCells(rows, index, comparator);
|
|
6408
|
+
});
|
|
6409
|
+
var rowHeaders = map$1(grid, function (row) {
|
|
6410
|
+
return isHeaderCells(row.cells);
|
|
6375
6411
|
});
|
|
6376
|
-
|
|
6412
|
+
var shouldReplaceCell = columnReplacePredicate(targets, rowHeaders);
|
|
6413
|
+
var scopeGenerator = columnScopeGenerator(applyScope, rowHeaders);
|
|
6414
|
+
return replaceIn(grid, targets, comparator, substitution, replace, scopeGenerator, shouldReplaceCell);
|
|
6377
6415
|
};
|
|
6378
|
-
var
|
|
6416
|
+
var replaceRows = function (grid, indexes, section, applyScope, comparator, substitution, tableSection) {
|
|
6379
6417
|
var _a = extractGridDetails(grid), cols = _a.cols, rows = _a.rows;
|
|
6380
|
-
var targetRow = rows[
|
|
6381
|
-
var targets = bind$2(
|
|
6382
|
-
|
|
6383
|
-
|
|
6418
|
+
var targetRow = rows[indexes[0]];
|
|
6419
|
+
var targets = bind$2(indexes, function (index) {
|
|
6420
|
+
return getRowCells(rows, index, comparator);
|
|
6421
|
+
});
|
|
6422
|
+
var columnHeaders = map$1(targetRow.cells, function (_cell, index) {
|
|
6423
|
+
return isHeaderCells(getColumnCells(rows, index, comparator));
|
|
6424
|
+
});
|
|
6425
|
+
var newRows = __spreadArray([], rows, true);
|
|
6426
|
+
each$2(indexes, function (index) {
|
|
6427
|
+
newRows[index] = tableSection.transformRow(rows[index], section);
|
|
6384
6428
|
});
|
|
6385
|
-
var
|
|
6386
|
-
|
|
6387
|
-
|
|
6429
|
+
var newGrid = cols.concat(newRows);
|
|
6430
|
+
var shouldReplaceCell = rowReplacerPredicate(targetRow, columnHeaders);
|
|
6431
|
+
var scopeGenerator = rowScopeGenerator(applyScope, columnHeaders);
|
|
6432
|
+
return replaceIn(newGrid, targets, comparator, substitution, tableSection.transformCell, scopeGenerator, shouldReplaceCell);
|
|
6388
6433
|
};
|
|
6389
|
-
var
|
|
6434
|
+
var replaceCells = function (grid, details, comparator, substitution) {
|
|
6390
6435
|
var rows = extractGridDetails(grid).rows;
|
|
6391
|
-
var
|
|
6392
|
-
|
|
6393
|
-
|
|
6436
|
+
var targetCells = map$1(details, function (detail) {
|
|
6437
|
+
return getCell(rows[detail.row], detail.column);
|
|
6438
|
+
});
|
|
6439
|
+
return replaceIn(grid, targetCells, comparator, substitution, replace, Optional.none, always);
|
|
6394
6440
|
};
|
|
6395
6441
|
|
|
6396
6442
|
var uniqueColumns = function (details) {
|
|
@@ -6451,7 +6497,7 @@
|
|
|
6451
6497
|
};
|
|
6452
6498
|
return { getOrInit: getOrInit };
|
|
6453
6499
|
};
|
|
6454
|
-
var transform = function (tag
|
|
6500
|
+
var transform = function (tag) {
|
|
6455
6501
|
return function (generators) {
|
|
6456
6502
|
var list = [];
|
|
6457
6503
|
var find = function (element, comparator) {
|
|
@@ -6460,7 +6506,7 @@
|
|
|
6460
6506
|
});
|
|
6461
6507
|
};
|
|
6462
6508
|
var makeNew = function (element) {
|
|
6463
|
-
var attrs =
|
|
6509
|
+
var attrs = tag === 'td' ? { scope: null } : {};
|
|
6464
6510
|
var cell = generators.replace(element, tag, attrs);
|
|
6465
6511
|
list.push({
|
|
6466
6512
|
item: element,
|
|
@@ -6745,48 +6791,42 @@
|
|
|
6745
6791
|
return bundle(newGrid, details[0].row, targetIndex);
|
|
6746
6792
|
};
|
|
6747
6793
|
var opMakeColumnsHeader = function (initialGrid, details, comparator, genWrappers) {
|
|
6748
|
-
var replacer = function (currentGrid, column) {
|
|
6749
|
-
return replaceColumn(currentGrid, column.column, comparator, genWrappers.replaceOrInit);
|
|
6750
|
-
};
|
|
6751
6794
|
var columns = uniqueColumns(details);
|
|
6752
|
-
var
|
|
6795
|
+
var columnIndexes = map$1(columns, function (detail) {
|
|
6796
|
+
return detail.column;
|
|
6797
|
+
});
|
|
6798
|
+
var newGrid = replaceColumns(initialGrid, columnIndexes, true, comparator, genWrappers.replaceOrInit);
|
|
6753
6799
|
return bundle(newGrid, details[0].row, details[0].column);
|
|
6754
6800
|
};
|
|
6755
6801
|
var opMakeCellsHeader = function (initialGrid, details, comparator, genWrappers) {
|
|
6756
|
-
var
|
|
6757
|
-
return replaceCell(currentGrid, detail.row, detail.column, comparator, genWrappers.replaceOrInit);
|
|
6758
|
-
};
|
|
6759
|
-
var newGrid = foldl(details, replacer, initialGrid);
|
|
6802
|
+
var newGrid = replaceCells(initialGrid, details, comparator, genWrappers.replaceOrInit);
|
|
6760
6803
|
return bundle(newGrid, details[0].row, details[0].column);
|
|
6761
6804
|
};
|
|
6762
6805
|
var opUnmakeColumnsHeader = function (initialGrid, details, comparator, genWrappers) {
|
|
6763
|
-
var replacer = function (currentGrid, column) {
|
|
6764
|
-
return replaceColumn(currentGrid, column.column, comparator, genWrappers.replaceOrInit);
|
|
6765
|
-
};
|
|
6766
6806
|
var columns = uniqueColumns(details);
|
|
6767
|
-
var
|
|
6807
|
+
var columnIndexes = map$1(columns, function (detail) {
|
|
6808
|
+
return detail.column;
|
|
6809
|
+
});
|
|
6810
|
+
var newGrid = replaceColumns(initialGrid, columnIndexes, false, comparator, genWrappers.replaceOrInit);
|
|
6768
6811
|
return bundle(newGrid, details[0].row, details[0].column);
|
|
6769
6812
|
};
|
|
6770
6813
|
var opUnmakeCellsHeader = function (initialGrid, details, comparator, genWrappers) {
|
|
6771
|
-
var
|
|
6772
|
-
return replaceCell(currentGrid, detail.row, detail.column, comparator, genWrappers.replaceOrInit);
|
|
6773
|
-
};
|
|
6774
|
-
var newGrid = foldl(details, replacer, initialGrid);
|
|
6814
|
+
var newGrid = replaceCells(initialGrid, details, comparator, genWrappers.replaceOrInit);
|
|
6775
6815
|
return bundle(newGrid, details[0].row, details[0].column);
|
|
6776
6816
|
};
|
|
6777
|
-
var makeRowsSection = function (section) {
|
|
6817
|
+
var makeRowsSection = function (section, applyScope) {
|
|
6778
6818
|
return function (initialGrid, details, comparator, genWrappers, tableSection) {
|
|
6779
|
-
var replacer = function (currentGrid, detail) {
|
|
6780
|
-
return replaceRow(currentGrid, detail.row, section, comparator, genWrappers.replaceOrInit, tableSection);
|
|
6781
|
-
};
|
|
6782
6819
|
var rows = uniqueRows(details);
|
|
6783
|
-
var
|
|
6820
|
+
var rowIndexes = map$1(rows, function (detail) {
|
|
6821
|
+
return detail.row;
|
|
6822
|
+
});
|
|
6823
|
+
var newGrid = replaceRows(initialGrid, rowIndexes, section, applyScope, comparator, genWrappers.replaceOrInit, tableSection);
|
|
6784
6824
|
return bundle(newGrid, details[0].row, details[0].column);
|
|
6785
6825
|
};
|
|
6786
6826
|
};
|
|
6787
|
-
var opMakeRowsHeader = makeRowsSection('thead');
|
|
6788
|
-
var opMakeRowsBody = makeRowsSection('tbody');
|
|
6789
|
-
var opMakeRowsFooter = makeRowsSection('tfoot');
|
|
6827
|
+
var opMakeRowsHeader = makeRowsSection('thead', true);
|
|
6828
|
+
var opMakeRowsBody = makeRowsSection('tbody', false);
|
|
6829
|
+
var opMakeRowsFooter = makeRowsSection('tfoot', false);
|
|
6790
6830
|
var opEraseColumns = function (grid, extractDetail, _comparator, _genWrappers) {
|
|
6791
6831
|
var columns = uniqueColumns(extractDetail.details);
|
|
6792
6832
|
var newGrid = deleteColumnsAt(grid, map$1(columns, function (column) {
|
|
@@ -6950,19 +6990,21 @@
|
|
|
6950
6990
|
});
|
|
6951
6991
|
};
|
|
6952
6992
|
};
|
|
6993
|
+
var headerCellGenerator = Generators.transform('th');
|
|
6994
|
+
var bodyCellGenerator = Generators.transform('td');
|
|
6953
6995
|
var insertRowsBefore = run(opInsertRowsBefore, onCells, noop, noop, Generators.modification);
|
|
6954
6996
|
var insertRowsAfter = run(opInsertRowsAfter, onCells, noop, noop, Generators.modification);
|
|
6955
6997
|
var insertColumnsBefore = run(opInsertColumnsBefore, insertColumnsExtractor(true), adjustAndRedistributeWidths, noop, Generators.modification);
|
|
6956
6998
|
var insertColumnsAfter = run(opInsertColumnsAfter, insertColumnsExtractor(false), adjustAndRedistributeWidths, noop, Generators.modification);
|
|
6957
6999
|
var eraseColumns = run(opEraseColumns, eraseColumnsExtractor, adjustAndRedistributeWidths, prune, Generators.modification);
|
|
6958
7000
|
var eraseRows = run(opEraseRows, onCells, noop, prune, Generators.modification);
|
|
6959
|
-
var makeColumnsHeader = run(opMakeColumnsHeader, onUnlockedCells, noop, noop,
|
|
6960
|
-
var unmakeColumnsHeader = run(opUnmakeColumnsHeader, onUnlockedCells, noop, noop,
|
|
6961
|
-
var makeRowsHeader = run(opMakeRowsHeader, onUnlockedCells, noop, noop,
|
|
6962
|
-
var makeRowsBody = run(opMakeRowsBody, onUnlockedCells, noop, noop,
|
|
6963
|
-
var makeRowsFooter = run(opMakeRowsFooter, onUnlockedCells, noop, noop,
|
|
6964
|
-
var makeCellsHeader = run(opMakeCellsHeader, onUnlockedCells, noop, noop,
|
|
6965
|
-
var unmakeCellsHeader = run(opUnmakeCellsHeader, onUnlockedCells, noop, noop,
|
|
7001
|
+
var makeColumnsHeader = run(opMakeColumnsHeader, onUnlockedCells, noop, noop, headerCellGenerator);
|
|
7002
|
+
var unmakeColumnsHeader = run(opUnmakeColumnsHeader, onUnlockedCells, noop, noop, bodyCellGenerator);
|
|
7003
|
+
var makeRowsHeader = run(opMakeRowsHeader, onUnlockedCells, noop, noop, headerCellGenerator);
|
|
7004
|
+
var makeRowsBody = run(opMakeRowsBody, onUnlockedCells, noop, noop, bodyCellGenerator);
|
|
7005
|
+
var makeRowsFooter = run(opMakeRowsFooter, onUnlockedCells, noop, noop, bodyCellGenerator);
|
|
7006
|
+
var makeCellsHeader = run(opMakeCellsHeader, onUnlockedCells, noop, noop, headerCellGenerator);
|
|
7007
|
+
var unmakeCellsHeader = run(opUnmakeCellsHeader, onUnlockedCells, noop, noop, bodyCellGenerator);
|
|
6966
7008
|
var mergeCells = run(opMergeCells, onUnlockedMergable, resize, noop, Generators.merging);
|
|
6967
7009
|
var unmergeCells = run(opUnmergeCells, onUnlockedUnmergable, resize, noop, Generators.merging);
|
|
6968
7010
|
var pasteCells = run(opPasteCells, onPaste, resize, noop, Generators.modification);
|
|
@@ -6974,7 +7016,7 @@
|
|
|
6974
7016
|
var getCellsType = opGetCellsType;
|
|
6975
7017
|
var getRowsType = opGetRowsType;
|
|
6976
7018
|
|
|
6977
|
-
var TableActions = function (editor, lazyWire) {
|
|
7019
|
+
var TableActions = function (editor, cellSelection, lazyWire) {
|
|
6978
7020
|
var isTableBody = function (editor) {
|
|
6979
7021
|
return name(getBody(editor)) === 'table';
|
|
6980
7022
|
};
|
|
@@ -6998,8 +7040,32 @@
|
|
|
6998
7040
|
return TableSection.getTableSectionType(table, 'section');
|
|
6999
7041
|
}
|
|
7000
7042
|
};
|
|
7043
|
+
var setSelectionFromAction = function (table, result) {
|
|
7044
|
+
return result.cursor.fold(function () {
|
|
7045
|
+
var cells = cells$1(table);
|
|
7046
|
+
return head(cells).filter(inBody).map(function (firstCell) {
|
|
7047
|
+
cellSelection.clear(table);
|
|
7048
|
+
var rng = editor.dom.createRng();
|
|
7049
|
+
rng.selectNode(firstCell.dom);
|
|
7050
|
+
editor.selection.setRng(rng);
|
|
7051
|
+
set$2(firstCell, 'data-mce-selected', '1');
|
|
7052
|
+
return rng;
|
|
7053
|
+
});
|
|
7054
|
+
}, function (cell) {
|
|
7055
|
+
var des = freefallRtl(cell);
|
|
7056
|
+
var rng = editor.dom.createRng();
|
|
7057
|
+
rng.setStart(des.element.dom, des.offset);
|
|
7058
|
+
rng.setEnd(des.element.dom, des.offset);
|
|
7059
|
+
editor.selection.setRng(rng);
|
|
7060
|
+
cellSelection.clear(table);
|
|
7061
|
+
return Optional.some(rng);
|
|
7062
|
+
});
|
|
7063
|
+
};
|
|
7001
7064
|
var execute = function (operation, guard, mutate, lazyWire, effect) {
|
|
7002
|
-
return function (table, target) {
|
|
7065
|
+
return function (table, target, noEvents) {
|
|
7066
|
+
if (noEvents === void 0) {
|
|
7067
|
+
noEvents = false;
|
|
7068
|
+
}
|
|
7003
7069
|
removeDataStyle(table);
|
|
7004
7070
|
var wire = lazyWire();
|
|
7005
7071
|
var doc = SugarElement.fromDom(editor.getDoc());
|
|
@@ -7016,11 +7082,14 @@
|
|
|
7016
7082
|
each$2(result.newCells, function (cell) {
|
|
7017
7083
|
fireNewCell(editor, cell.dom);
|
|
7018
7084
|
});
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7085
|
+
var range = setSelectionFromAction(table, result);
|
|
7086
|
+
if (inBody(table)) {
|
|
7087
|
+
removeDataStyle(table);
|
|
7088
|
+
if (!noEvents) {
|
|
7089
|
+
fireTableModified(editor, table.dom, effect);
|
|
7090
|
+
}
|
|
7091
|
+
}
|
|
7092
|
+
return range.map(function (rng) {
|
|
7024
7093
|
return {
|
|
7025
7094
|
rng: rng,
|
|
7026
7095
|
effect: effect
|
|
@@ -7195,11 +7264,11 @@
|
|
|
7195
7264
|
});
|
|
7196
7265
|
return descendant(getBody(editor), 'table[data-mce-id="__mce"]').map(function (table) {
|
|
7197
7266
|
if (isPixelsForced(editor)) {
|
|
7198
|
-
enforcePixels(
|
|
7267
|
+
enforcePixels(table);
|
|
7199
7268
|
} else if (isResponsiveForced(editor)) {
|
|
7200
7269
|
enforceNone(table);
|
|
7201
7270
|
} else if (isPercentagesForced(editor) || isPercentage(defaultStyles.width)) {
|
|
7202
|
-
enforcePercentage(
|
|
7271
|
+
enforcePercentage(table);
|
|
7203
7272
|
}
|
|
7204
7273
|
removeDataStyle(table);
|
|
7205
7274
|
remove$7(table, 'data-mce-id');
|
|
@@ -7313,7 +7382,7 @@
|
|
|
7313
7382
|
var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan;
|
|
7314
7383
|
var fakeColGroups = generateColGroup(house, minColRange, maxColRange);
|
|
7315
7384
|
var fakeRows = generateRows(house, minColRange, maxColRange);
|
|
7316
|
-
return __spreadArray(__spreadArray([], fakeColGroups), fakeRows);
|
|
7385
|
+
return __spreadArray(__spreadArray([], fakeColGroups, true), fakeRows, true);
|
|
7317
7386
|
});
|
|
7318
7387
|
};
|
|
7319
7388
|
|
|
@@ -7472,6 +7541,20 @@
|
|
|
7472
7541
|
});
|
|
7473
7542
|
};
|
|
7474
7543
|
|
|
7544
|
+
var Cell = function (initial) {
|
|
7545
|
+
var value = initial;
|
|
7546
|
+
var get = function () {
|
|
7547
|
+
return value;
|
|
7548
|
+
};
|
|
7549
|
+
var set = function (v) {
|
|
7550
|
+
value = v;
|
|
7551
|
+
};
|
|
7552
|
+
return {
|
|
7553
|
+
get: get,
|
|
7554
|
+
set: set
|
|
7555
|
+
};
|
|
7556
|
+
};
|
|
7557
|
+
|
|
7475
7558
|
var singleton = function (doRevoke) {
|
|
7476
7559
|
var subject = Cell(Optional.none());
|
|
7477
7560
|
var revoke = function () {
|
|
@@ -8561,9 +8644,9 @@
|
|
|
8561
8644
|
if (!isForcedSizing) {
|
|
8562
8645
|
table(cellOrCaption, isRoot).each(function (table) {
|
|
8563
8646
|
if (sizing === 'relative' && !isPercentSizing(table)) {
|
|
8564
|
-
enforcePercentage(
|
|
8647
|
+
enforcePercentage(table);
|
|
8565
8648
|
} else if (sizing === 'fixed' && !isPixelSizing(table)) {
|
|
8566
|
-
enforcePixels(
|
|
8649
|
+
enforcePixels(table);
|
|
8567
8650
|
} else if (sizing === 'responsive' && !isNoneSizing(table)) {
|
|
8568
8651
|
enforceNone(table);
|
|
8569
8652
|
}
|
|
@@ -8622,19 +8705,8 @@
|
|
|
8622
8705
|
});
|
|
8623
8706
|
});
|
|
8624
8707
|
};
|
|
8625
|
-
var postExecute = function (
|
|
8626
|
-
|
|
8627
|
-
noEvents = false;
|
|
8628
|
-
}
|
|
8629
|
-
return function (data) {
|
|
8630
|
-
editor.selection.setRng(data.rng);
|
|
8631
|
-
editor.focus();
|
|
8632
|
-
cellSelection.clear(table);
|
|
8633
|
-
removeDataStyle(table);
|
|
8634
|
-
if (!noEvents) {
|
|
8635
|
-
fireTableModified(editor, table.dom, data.effect);
|
|
8636
|
-
}
|
|
8637
|
-
};
|
|
8708
|
+
var postExecute = function (_data) {
|
|
8709
|
+
editor.focus();
|
|
8638
8710
|
};
|
|
8639
8711
|
var actOnSelection = function (execute, noEvents) {
|
|
8640
8712
|
if (noEvents === void 0) {
|
|
@@ -8642,7 +8714,7 @@
|
|
|
8642
8714
|
}
|
|
8643
8715
|
return performActionOnSelection(function (table, startCell) {
|
|
8644
8716
|
var targets = forMenu(selections, table, startCell);
|
|
8645
|
-
execute(table, targets).each(postExecute
|
|
8717
|
+
execute(table, targets, noEvents).each(postExecute);
|
|
8646
8718
|
});
|
|
8647
8719
|
};
|
|
8648
8720
|
var copyRowSelection = function () {
|
|
@@ -8666,7 +8738,7 @@
|
|
|
8666
8738
|
performActionOnSelection(function (table, startCell) {
|
|
8667
8739
|
var generators = paste$1(SugarElement.fromDom(editor.getDoc()));
|
|
8668
8740
|
var targets = pasteRows(selections, startCell, clonedRows, generators);
|
|
8669
|
-
execute(table, targets).each(postExecute
|
|
8741
|
+
execute(table, targets).each(postExecute);
|
|
8670
8742
|
});
|
|
8671
8743
|
});
|
|
8672
8744
|
};
|
|
@@ -10367,6 +10439,9 @@
|
|
|
10367
10439
|
var keycode = realEvent.which;
|
|
10368
10440
|
var shiftKey = realEvent.shiftKey === true;
|
|
10369
10441
|
var handler = retrieve$1(container, annotations.selectedSelector).fold(function () {
|
|
10442
|
+
if (isNavigation(keycode) && !shiftKey) {
|
|
10443
|
+
annotations.clearBeforeUpdate(container);
|
|
10444
|
+
}
|
|
10370
10445
|
if (isDown(keycode) && shiftKey) {
|
|
10371
10446
|
return curry(select, bridge, container, isRoot, down, finish, start, annotations.selectRange);
|
|
10372
10447
|
} else if (isUp(keycode) && shiftKey) {
|
|
@@ -10410,7 +10485,7 @@
|
|
|
10410
10485
|
rc(0, +1),
|
|
10411
10486
|
rc(+1, 0)
|
|
10412
10487
|
]);
|
|
10413
|
-
} else if (isNavigation(keycode) && shiftKey
|
|
10488
|
+
} else if (isNavigation(keycode) && !shiftKey) {
|
|
10414
10489
|
return clearToNavigate;
|
|
10415
10490
|
} else {
|
|
10416
10491
|
return Optional.none;
|
|
@@ -10423,7 +10498,7 @@
|
|
|
10423
10498
|
var realEvent = event.raw;
|
|
10424
10499
|
var keycode = realEvent.which;
|
|
10425
10500
|
var shiftKey = realEvent.shiftKey === true;
|
|
10426
|
-
if (shiftKey
|
|
10501
|
+
if (!shiftKey) {
|
|
10427
10502
|
return Optional.none();
|
|
10428
10503
|
}
|
|
10429
10504
|
if (isNavigation(keycode)) {
|
|
@@ -10508,7 +10583,7 @@
|
|
|
10508
10583
|
onClear();
|
|
10509
10584
|
};
|
|
10510
10585
|
var clearBeforeUpdate = function (container) {
|
|
10511
|
-
var sels = descendants(container, ephemera.selectedSelector);
|
|
10586
|
+
var sels = descendants(container, ephemera.selectedSelector + ',' + ephemera.firstSelectedSelector + ',' + ephemera.lastSelectedSelector);
|
|
10512
10587
|
each$2(sels, removeSelectionAttributes);
|
|
10513
10588
|
};
|
|
10514
10589
|
var selectRange = function (container, cells, start, finish) {
|
|
@@ -11402,11 +11477,11 @@
|
|
|
11402
11477
|
var selectionTargets = getSelectionTargets(editor, selections);
|
|
11403
11478
|
var resizeHandler = getResizeHandler(editor);
|
|
11404
11479
|
var cellSelection = CellSelection(editor, resizeHandler.lazyResize, selectionTargets);
|
|
11405
|
-
var actions = TableActions(editor, resizeHandler.lazyWire);
|
|
11480
|
+
var actions = TableActions(editor, cellSelection, resizeHandler.lazyWire);
|
|
11406
11481
|
var clipboard = Clipboard();
|
|
11407
11482
|
registerCommands(editor, actions, cellSelection, selections, clipboard);
|
|
11408
11483
|
registerQueryCommands(editor, actions, selections);
|
|
11409
|
-
registerEvents(editor, selections, actions
|
|
11484
|
+
registerEvents(editor, selections, actions);
|
|
11410
11485
|
addMenuItems(editor, selections, selectionTargets, clipboard);
|
|
11411
11486
|
addButtons(editor, selections, selectionTargets, clipboard);
|
|
11412
11487
|
addToolbars(editor);
|