tabulator-tables 5.0.6 → 5.0.10
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/bower.json +1 -1
- package/build/rollup.js +1 -1
- package/dist/css/tabulator.css +4 -0
- package/dist/css/tabulator.css.map +1 -1
- package/dist/css/tabulator.min.css +1 -1
- package/dist/css/tabulator.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap3.css +4 -0
- package/dist/css/tabulator_bootstrap3.css.map +1 -1
- package/dist/css/tabulator_bootstrap3.min.css +1 -1
- package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap4.css +4 -0
- package/dist/css/tabulator_bootstrap4.css.map +1 -1
- package/dist/css/tabulator_bootstrap4.min.css +1 -1
- package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
- package/dist/css/tabulator_bulma.css +4 -0
- package/dist/css/tabulator_bulma.css.map +1 -1
- package/dist/css/tabulator_bulma.min.css +1 -1
- package/dist/css/tabulator_bulma.min.css.map +1 -1
- package/dist/css/tabulator_materialize.css +4 -0
- package/dist/css/tabulator_materialize.css.map +1 -1
- package/dist/css/tabulator_materialize.min.css +1 -1
- package/dist/css/tabulator_materialize.min.css.map +1 -1
- package/dist/css/tabulator_midnight.css +4 -0
- package/dist/css/tabulator_midnight.css.map +1 -1
- package/dist/css/tabulator_midnight.min.css +1 -1
- package/dist/css/tabulator_midnight.min.css.map +1 -1
- package/dist/css/tabulator_modern.css +4 -0
- package/dist/css/tabulator_modern.css.map +1 -1
- package/dist/css/tabulator_modern.min.css +1 -1
- package/dist/css/tabulator_modern.min.css.map +1 -1
- package/dist/css/tabulator_semanticui.css +4 -0
- package/dist/css/tabulator_semanticui.css.map +1 -1
- package/dist/css/tabulator_semanticui.min.css +1 -1
- package/dist/css/tabulator_semanticui.min.css.map +1 -1
- package/dist/css/tabulator_simple.css +4 -0
- package/dist/css/tabulator_simple.css.map +1 -1
- package/dist/css/tabulator_simple.min.css +1 -1
- package/dist/css/tabulator_simple.min.css.map +1 -1
- package/dist/css/tabulator_site.css +4 -0
- package/dist/css/tabulator_site.css.map +1 -1
- package/dist/css/tabulator_site.min.css +1 -1
- package/dist/css/tabulator_site.min.css.map +1 -1
- package/dist/js/tabulator.js +450 -278
- package/dist/js/tabulator.js.map +1 -1
- package/dist/js/tabulator.min.js +2 -2
- package/dist/js/tabulator.min.js.map +1 -1
- package/dist/js/tabulator_esm.js +672 -505
- package/dist/js/tabulator_esm.js.map +1 -1
- package/dist/js/tabulator_esm.min.js +2 -2
- package/dist/js/tabulator_esm.min.js.map +1 -1
- package/package.json +1 -1
- package/src/js/core/ColumnManager.js +8 -7
- package/src/js/core/CoreFeature.js +1 -5
- package/src/js/core/RowManager.js +8 -2
- package/src/js/core/Tabulator.js +126 -100
- package/src/js/core/column/Column.js +2 -2
- package/src/js/core/defaults/options.js +1 -1
- package/src/js/core/rendering/Renderer.js +3 -2
- package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +150 -145
- package/src/js/core/rendering/renderers/VirtualDomVertical.js +1 -1
- package/src/js/core/tools/{ComponentFuctionBinder.js → ComponentFunctionBinder.js} +1 -1
- package/src/js/core/tools/DataLoader.js +2 -2
- package/src/js/core/tools/InteractionMonitor.js +143 -48
- package/src/js/core/tools/OptionsList.js +2 -2
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +14 -1
- package/src/js/modules/DataTree/DataTree.js +18 -9
- package/src/js/modules/Download/defaults/downloaders/pdf.js +0 -2
- package/src/js/modules/Download/defaults/downloaders/xlsx.js +3 -2
- package/src/js/modules/Edit/Edit.js +6 -10
- package/src/js/modules/Edit/defaults/editors/progress.js +2 -2
- package/src/js/modules/Export/Export.js +1 -1
- package/src/js/modules/Filter/Filter.js +9 -4
- package/src/js/modules/Format/defaults/formatters/datetime.js +2 -2
- package/src/js/modules/Format/defaults/formatters/datetimediff.js +1 -1
- package/src/js/modules/FrozenColumns/FrozenColumns.js +1 -1
- package/src/js/modules/FrozenRows/FrozenRows.js +4 -1
- package/src/js/modules/GroupRows/Group.js +16 -6
- package/src/js/modules/GroupRows/GroupRows.js +41 -29
- package/src/js/modules/History/History.js +3 -1
- package/src/js/modules/HtmlTableImport/HtmlTableImport.js +4 -7
- package/src/js/modules/MoveColumns/MoveColumns.js +64 -61
- package/src/js/modules/Page/Page.js +8 -10
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -5
- package/src/js/modules/SelectRow/SelectRow.js +5 -10
- package/src/js/modules/Sort/Sort.js +1 -1
- package/src/js/modules/Sort/defaults/sorters/datetime.js +3 -2
- package/src/scss/tabulator.scss +4 -0
package/dist/js/tabulator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Tabulator v5.0.
|
|
1
|
+
/* Tabulator v5.0.10 (c) Oliver Folkerd 2021 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
//build columns from data row structure
|
|
240
240
|
autoColumnsDefinitions: false,
|
|
241
241
|
nestedFieldSeparator: ".",
|
|
242
|
-
//
|
|
242
|
+
//separator for nested data
|
|
243
243
|
tooltipGenerationMode: "load",
|
|
244
244
|
//when to generate tooltips
|
|
245
245
|
footerElement: false,
|
|
@@ -414,11 +414,7 @@
|
|
|
414
414
|
|
|
415
415
|
}, {
|
|
416
416
|
key: "options",
|
|
417
|
-
value: function options(key
|
|
418
|
-
if (typeof value !== "undefined") {
|
|
419
|
-
this.table.options[key] = value;
|
|
420
|
-
}
|
|
421
|
-
|
|
417
|
+
value: function options(key) {
|
|
422
418
|
return this.table.options[key];
|
|
423
419
|
}
|
|
424
420
|
}, {
|
|
@@ -616,7 +612,7 @@
|
|
|
616
612
|
return ColumnComponent;
|
|
617
613
|
}();
|
|
618
614
|
|
|
619
|
-
var
|
|
615
|
+
var defaultColumnOptions = {
|
|
620
616
|
"title": undefined,
|
|
621
617
|
"field": undefined,
|
|
622
618
|
"columns": undefined,
|
|
@@ -731,7 +727,7 @@
|
|
|
731
727
|
return CellComponent;
|
|
732
728
|
}();
|
|
733
729
|
|
|
734
|
-
var Cell
|
|
730
|
+
var Cell = /*#__PURE__*/function (_CoreFeature) {
|
|
735
731
|
_inherits(Cell, _CoreFeature);
|
|
736
732
|
|
|
737
733
|
var _super = _createSuper(Cell);
|
|
@@ -1257,7 +1253,7 @@
|
|
|
1257
1253
|
|
|
1258
1254
|
var def = this.definition; //set header tooltips
|
|
1259
1255
|
|
|
1260
|
-
var tooltip =
|
|
1256
|
+
var tooltip = def.headerTooltip;
|
|
1261
1257
|
|
|
1262
1258
|
if (tooltip) {
|
|
1263
1259
|
if (tooltip === true) {
|
|
@@ -1818,7 +1814,7 @@
|
|
|
1818
1814
|
this.cells.forEach(function (cell) {
|
|
1819
1815
|
cell.hide();
|
|
1820
1816
|
});
|
|
1821
|
-
this.dispatch("column-hide", this);
|
|
1817
|
+
this.dispatch("column-hide", this, responsiveToggle);
|
|
1822
1818
|
|
|
1823
1819
|
if (!silent) {
|
|
1824
1820
|
this.dispatchExternal("columnVisibilityChanged", this.getComponent(), false);
|
|
@@ -2015,7 +2011,7 @@
|
|
|
2015
2011
|
}, {
|
|
2016
2012
|
key: "generateCell",
|
|
2017
2013
|
value: function generateCell(row) {
|
|
2018
|
-
var cell = new Cell
|
|
2014
|
+
var cell = new Cell(this, row);
|
|
2019
2015
|
this.cells.push(cell);
|
|
2020
2016
|
return cell;
|
|
2021
2017
|
}
|
|
@@ -2140,7 +2136,7 @@
|
|
|
2140
2136
|
return Column;
|
|
2141
2137
|
}(CoreFeature);
|
|
2142
2138
|
|
|
2143
|
-
Column$1.defaultOptionList =
|
|
2139
|
+
Column$1.defaultOptionList = defaultColumnOptions;
|
|
2144
2140
|
|
|
2145
2141
|
var Helpers = /*#__PURE__*/function () {
|
|
2146
2142
|
function Helpers() {
|
|
@@ -2210,11 +2206,13 @@
|
|
|
2210
2206
|
|
|
2211
2207
|
var OptionsList = /*#__PURE__*/function () {
|
|
2212
2208
|
function OptionsList(table, msgType) {
|
|
2209
|
+
var defaults = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2210
|
+
|
|
2213
2211
|
_classCallCheck(this, OptionsList);
|
|
2214
2212
|
|
|
2215
2213
|
this.table = table;
|
|
2216
2214
|
this.msgType = msgType;
|
|
2217
|
-
this.registeredDefaults = {};
|
|
2215
|
+
this.registeredDefaults = Object.assign({}, defaults);
|
|
2218
2216
|
}
|
|
2219
2217
|
|
|
2220
2218
|
_createClass(OptionsList, [{
|
|
@@ -2342,7 +2340,7 @@
|
|
|
2342
2340
|
}
|
|
2343
2341
|
}, {
|
|
2344
2342
|
key: "scrollToRowNearestTop",
|
|
2345
|
-
value: function scrollToRowNearestTop(row) {//
|
|
2343
|
+
value: function scrollToRowNearestTop(row) {//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom
|
|
2346
2344
|
}
|
|
2347
2345
|
}, {
|
|
2348
2346
|
key: "visibleRows",
|
|
@@ -2416,6 +2414,7 @@
|
|
|
2416
2414
|
offset = Helpers.elOffset(rowEl).top - Helpers.elOffset(_this2.elementVertical).top;
|
|
2417
2415
|
|
|
2418
2416
|
if (offset > 0 && offset < _this2.elementVertical.clientHeight - rowEl.offsetHeight) {
|
|
2417
|
+
resolve();
|
|
2419
2418
|
return false;
|
|
2420
2419
|
}
|
|
2421
2420
|
}
|
|
@@ -2536,17 +2535,17 @@
|
|
|
2536
2535
|
ok = true;
|
|
2537
2536
|
|
|
2538
2537
|
if (this.options("layout") == "fitDataTable") {
|
|
2539
|
-
console.warn("Horizontal
|
|
2538
|
+
console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode");
|
|
2540
2539
|
ok = false;
|
|
2541
2540
|
}
|
|
2542
2541
|
|
|
2543
2542
|
if (this.options("responsiveLayout")) {
|
|
2544
|
-
console.warn("Horizontal
|
|
2543
|
+
console.warn("Horizontal Virtual DOM is not compatible with responsive columns");
|
|
2545
2544
|
ok = false;
|
|
2546
2545
|
}
|
|
2547
2546
|
|
|
2548
2547
|
if (this.options("rtl")) {
|
|
2549
|
-
console.warn("Horizontal
|
|
2548
|
+
console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction");
|
|
2550
2549
|
ok = false;
|
|
2551
2550
|
}
|
|
2552
2551
|
|
|
@@ -2556,7 +2555,7 @@
|
|
|
2556
2555
|
});
|
|
2557
2556
|
|
|
2558
2557
|
if (frozen) {
|
|
2559
|
-
console.warn("Horizontal
|
|
2558
|
+
console.warn("Horizontal Virtual DOM is not compatible with frozen columns");
|
|
2560
2559
|
ok = false;
|
|
2561
2560
|
}
|
|
2562
2561
|
} // if(!ok){
|
|
@@ -2642,7 +2641,7 @@
|
|
|
2642
2641
|
|
|
2643
2642
|
if (!blockRedraw) {
|
|
2644
2643
|
if (!update || this.reinitChanged(old)) {
|
|
2645
|
-
this.
|
|
2644
|
+
this.reinitializeRows();
|
|
2646
2645
|
}
|
|
2647
2646
|
}
|
|
2648
2647
|
|
|
@@ -2769,8 +2768,8 @@
|
|
|
2769
2768
|
return !match;
|
|
2770
2769
|
}
|
|
2771
2770
|
}, {
|
|
2772
|
-
key: "
|
|
2773
|
-
value: function
|
|
2771
|
+
key: "reinitializeRows",
|
|
2772
|
+
value: function reinitializeRows() {
|
|
2774
2773
|
var _this5 = this;
|
|
2775
2774
|
|
|
2776
2775
|
var rows = this.table.rowManager.getVisibleRows();
|
|
@@ -2893,11 +2892,17 @@
|
|
|
2893
2892
|
if (column && column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft) {
|
|
2894
2893
|
rows = this.table.rowManager.getVisibleRows();
|
|
2895
2894
|
rows.forEach(function (row) {
|
|
2895
|
+
var cell, el;
|
|
2896
|
+
|
|
2896
2897
|
if (row.type !== "group") {
|
|
2897
|
-
|
|
2898
|
+
cell = row.getCell(column);
|
|
2899
|
+
|
|
2900
|
+
if (cell) {
|
|
2901
|
+
el = cell.getElement();
|
|
2898
2902
|
|
|
2899
|
-
|
|
2900
|
-
|
|
2903
|
+
if (el.parentNode) {
|
|
2904
|
+
row.getElement().removeChild(el);
|
|
2905
|
+
}
|
|
2901
2906
|
}
|
|
2902
2907
|
}
|
|
2903
2908
|
});
|
|
@@ -2988,7 +2993,7 @@
|
|
|
2988
2993
|
_this.columnsByField = {}; //columns by field
|
|
2989
2994
|
|
|
2990
2995
|
_this.scrollLeft = 0;
|
|
2991
|
-
_this.optionsList = new OptionsList(_this.table, "column definition");
|
|
2996
|
+
_this.optionsList = new OptionsList(_this.table, "column definition", defaultColumnOptions);
|
|
2992
2997
|
_this.renderer = null;
|
|
2993
2998
|
return _this;
|
|
2994
2999
|
} ////////////// Setup Functions /////////////////
|
|
@@ -3198,8 +3203,9 @@
|
|
|
3198
3203
|
index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;
|
|
3199
3204
|
|
|
3200
3205
|
if (nextToColumn && index > -1) {
|
|
3201
|
-
var
|
|
3202
|
-
var
|
|
3206
|
+
var topColumn = nextToColumn.getTopColumn();
|
|
3207
|
+
var parentIndex = this.columns.indexOf(topColumn);
|
|
3208
|
+
var nextEl = topColumn.getElement();
|
|
3203
3209
|
|
|
3204
3210
|
if (before) {
|
|
3205
3211
|
this.columns.splice(parentIndex, 0, column);
|
|
@@ -3314,8 +3320,8 @@
|
|
|
3314
3320
|
return this.columnsByIndex[index];
|
|
3315
3321
|
}
|
|
3316
3322
|
}, {
|
|
3317
|
-
key: "
|
|
3318
|
-
value: function
|
|
3323
|
+
key: "getFirstVisibleColumn",
|
|
3324
|
+
value: function getFirstVisibleColumn(index) {
|
|
3319
3325
|
var index = this.columnsByIndex.findIndex(function (col) {
|
|
3320
3326
|
return col.visible;
|
|
3321
3327
|
});
|
|
@@ -3565,13 +3571,11 @@
|
|
|
3565
3571
|
|
|
3566
3572
|
_this6.dispatch("column-add", definition, before, nextToColumn);
|
|
3567
3573
|
|
|
3568
|
-
_this6.redraw(true);
|
|
3569
|
-
|
|
3570
3574
|
if (_this6.layoutMode() != "fitColumns") {
|
|
3571
3575
|
column.reinitializeWidth();
|
|
3572
3576
|
}
|
|
3573
3577
|
|
|
3574
|
-
_this6.
|
|
3578
|
+
_this6.redraw(true);
|
|
3575
3579
|
|
|
3576
3580
|
_this6.table.rowManager.reinitialize();
|
|
3577
3581
|
|
|
@@ -3747,7 +3751,7 @@
|
|
|
3747
3751
|
return RowComponent;
|
|
3748
3752
|
}();
|
|
3749
3753
|
|
|
3750
|
-
var Row
|
|
3754
|
+
var Row = /*#__PURE__*/function (_CoreFeature) {
|
|
3751
3755
|
_inherits(Row, _CoreFeature);
|
|
3752
3756
|
|
|
3753
3757
|
var _super = _createSuper(Row);
|
|
@@ -4349,8 +4353,8 @@
|
|
|
4349
4353
|
}
|
|
4350
4354
|
|
|
4351
4355
|
element.style.paddingTop = "";
|
|
4352
|
-
element.style.paddingBottom = "";
|
|
4353
|
-
|
|
4356
|
+
element.style.paddingBottom = ""; // element.style.minWidth = "";
|
|
4357
|
+
|
|
4354
4358
|
element.style.minHeight = "";
|
|
4355
4359
|
element.style.display = "";
|
|
4356
4360
|
element.style.visibility = "";
|
|
@@ -5033,7 +5037,7 @@
|
|
|
5033
5037
|
var _this3 = this;
|
|
5034
5038
|
|
|
5035
5039
|
if (_typeof(subject) == "object") {
|
|
5036
|
-
if (subject instanceof Row
|
|
5040
|
+
if (subject instanceof Row) {
|
|
5037
5041
|
//subject is row element
|
|
5038
5042
|
return subject;
|
|
5039
5043
|
} else if (subject instanceof RowComponent$1) {
|
|
@@ -5123,7 +5127,7 @@
|
|
|
5123
5127
|
this.dispatch("data-processing", data);
|
|
5124
5128
|
data.forEach(function (def, i) {
|
|
5125
5129
|
if (def && _typeof(def) === "object") {
|
|
5126
|
-
var row = new Row
|
|
5130
|
+
var row = new Row(def, _this5);
|
|
5127
5131
|
|
|
5128
5132
|
_this5.rows.push(row);
|
|
5129
5133
|
} else {
|
|
@@ -5256,7 +5260,7 @@
|
|
|
5256
5260
|
}, {
|
|
5257
5261
|
key: "addRowActual",
|
|
5258
5262
|
value: function addRowActual(data, pos, index, blockRedraw) {
|
|
5259
|
-
var row = data instanceof Row
|
|
5263
|
+
var row = data instanceof Row ? data : new Row(data || {}, this),
|
|
5260
5264
|
top = this.findAddRowPos(pos),
|
|
5261
5265
|
allIndex = -1,
|
|
5262
5266
|
activeIndex,
|
|
@@ -5408,7 +5412,7 @@
|
|
|
5408
5412
|
nextRow = this.getDisplayRows()[index + 1];
|
|
5409
5413
|
}
|
|
5410
5414
|
|
|
5411
|
-
if (nextRow && (!(nextRow instanceof Row
|
|
5415
|
+
if (nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")) {
|
|
5412
5416
|
return this.nextDisplayRow(nextRow, rowOnly);
|
|
5413
5417
|
}
|
|
5414
5418
|
|
|
@@ -5424,7 +5428,7 @@
|
|
|
5424
5428
|
prevRow = this.getDisplayRows()[index - 1];
|
|
5425
5429
|
}
|
|
5426
5430
|
|
|
5427
|
-
if (rowOnly && prevRow && (!(prevRow instanceof Row
|
|
5431
|
+
if (rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")) {
|
|
5428
5432
|
return this.prevDisplayRow(prevRow, rowOnly);
|
|
5429
5433
|
}
|
|
5430
5434
|
|
|
@@ -5690,8 +5694,14 @@
|
|
|
5690
5694
|
}
|
|
5691
5695
|
}, {
|
|
5692
5696
|
key: "getVisibleRows",
|
|
5693
|
-
value: function getVisibleRows(viewable) {
|
|
5694
|
-
|
|
5697
|
+
value: function getVisibleRows(chain, viewable) {
|
|
5698
|
+
var rows = Object.assign([], this.renderer.visibleRows(!viewable));
|
|
5699
|
+
|
|
5700
|
+
if (chain) {
|
|
5701
|
+
rows = this.chain("rows-visible", [viewable], rows, rows);
|
|
5702
|
+
}
|
|
5703
|
+
|
|
5704
|
+
return rows;
|
|
5695
5705
|
} //repeat action accross display rows
|
|
5696
5706
|
|
|
5697
5707
|
}, {
|
|
@@ -6096,7 +6106,7 @@
|
|
|
6096
6106
|
_classCallCheck(this, InteractionManager);
|
|
6097
6107
|
|
|
6098
6108
|
_this = _super.call(this, table);
|
|
6099
|
-
_this.el =
|
|
6109
|
+
_this.el = null;
|
|
6100
6110
|
_this.abortClasses = ["tabulator-headers", "tabulator-table"];
|
|
6101
6111
|
_this.previousTargets = {};
|
|
6102
6112
|
_this.listeners = ["click", "dblclick", "contextmenu", "mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove", "touchstart", "touchend"];
|
|
@@ -6106,15 +6116,36 @@
|
|
|
6106
6116
|
"tabulator-group": "group",
|
|
6107
6117
|
"tabulator-col": "column"
|
|
6108
6118
|
};
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6119
|
+
_this.pseudoTrackers = {
|
|
6120
|
+
"row": {
|
|
6121
|
+
subscriber: null,
|
|
6122
|
+
target: null
|
|
6123
|
+
},
|
|
6124
|
+
"cell": {
|
|
6125
|
+
subscriber: null,
|
|
6126
|
+
target: null
|
|
6127
|
+
},
|
|
6128
|
+
"group": {
|
|
6129
|
+
subscriber: null,
|
|
6130
|
+
target: null
|
|
6131
|
+
},
|
|
6132
|
+
"column": {
|
|
6133
|
+
subscriber: null,
|
|
6134
|
+
target: null
|
|
6135
|
+
}
|
|
6136
|
+
};
|
|
6137
|
+
_this.pseudoTracking = false;
|
|
6114
6138
|
return _this;
|
|
6115
6139
|
}
|
|
6116
6140
|
|
|
6117
6141
|
_createClass(InteractionManager, [{
|
|
6142
|
+
key: "initialize",
|
|
6143
|
+
value: function initialize() {
|
|
6144
|
+
this.el = this.table.element;
|
|
6145
|
+
this.buildListenerMap();
|
|
6146
|
+
this.bindSubscriptionWatchers();
|
|
6147
|
+
}
|
|
6148
|
+
}, {
|
|
6118
6149
|
key: "buildListenerMap",
|
|
6119
6150
|
value: function buildListenerMap() {
|
|
6120
6151
|
var listenerMap = {};
|
|
@@ -6126,6 +6157,55 @@
|
|
|
6126
6157
|
});
|
|
6127
6158
|
this.listeners = listenerMap;
|
|
6128
6159
|
}
|
|
6160
|
+
}, {
|
|
6161
|
+
key: "bindPseudoEvents",
|
|
6162
|
+
value: function bindPseudoEvents() {
|
|
6163
|
+
var _this2 = this;
|
|
6164
|
+
|
|
6165
|
+
Object.keys(this.pseudoTrackers).forEach(function (key) {
|
|
6166
|
+
_this2.pseudoTrackers[key].subscriber = _this2.pseudoMouseEnter.bind(_this2, key);
|
|
6167
|
+
|
|
6168
|
+
_this2.subscribe(key + "-mouseover", _this2.pseudoTrackers[key].subscriber);
|
|
6169
|
+
});
|
|
6170
|
+
this.pseudoTracking = true;
|
|
6171
|
+
}
|
|
6172
|
+
}, {
|
|
6173
|
+
key: "pseudoMouseEnter",
|
|
6174
|
+
value: function pseudoMouseEnter(key, e, target) {
|
|
6175
|
+
if (this.pseudoTrackers[key].target !== target) {
|
|
6176
|
+
if (this.pseudoTrackers[key].target) {
|
|
6177
|
+
this.dispatch(key + "-mouseleave", e, target);
|
|
6178
|
+
}
|
|
6179
|
+
|
|
6180
|
+
this.pseudoMouseLeave(key, e);
|
|
6181
|
+
this.pseudoTrackers[key].target = target;
|
|
6182
|
+
this.dispatch(key + "-mouseenter", e, target);
|
|
6183
|
+
}
|
|
6184
|
+
}
|
|
6185
|
+
}, {
|
|
6186
|
+
key: "pseudoMouseLeave",
|
|
6187
|
+
value: function pseudoMouseLeave(key, e) {
|
|
6188
|
+
var _this3 = this;
|
|
6189
|
+
|
|
6190
|
+
var leaveList = Object.keys(this.pseudoTrackers),
|
|
6191
|
+
linkedKeys = {
|
|
6192
|
+
"row": ["cell"],
|
|
6193
|
+
"cell": ["row"]
|
|
6194
|
+
};
|
|
6195
|
+
leaveList = leaveList.filter(function (item) {
|
|
6196
|
+
var links = linkedKeys[key];
|
|
6197
|
+
return item !== key && (!links || links && !links.includes(item));
|
|
6198
|
+
});
|
|
6199
|
+
leaveList.forEach(function (key) {
|
|
6200
|
+
var target = _this3.pseudoTrackers[key].target;
|
|
6201
|
+
|
|
6202
|
+
if (_this3.pseudoTrackers[key].target) {
|
|
6203
|
+
_this3.dispatch(key + "-mouseleave", e, target);
|
|
6204
|
+
|
|
6205
|
+
_this3.pseudoTrackers[key].target = null;
|
|
6206
|
+
}
|
|
6207
|
+
});
|
|
6208
|
+
}
|
|
6129
6209
|
}, {
|
|
6130
6210
|
key: "bindSubscriptionWatchers",
|
|
6131
6211
|
value: function bindSubscriptionWatchers() {
|
|
@@ -6150,6 +6230,8 @@
|
|
|
6150
6230
|
_iterator.f();
|
|
6151
6231
|
}
|
|
6152
6232
|
}
|
|
6233
|
+
|
|
6234
|
+
this.subscribe("table-destroy", this.clearWatchers.bind(this));
|
|
6153
6235
|
}
|
|
6154
6236
|
}, {
|
|
6155
6237
|
key: "subscriptionChanged",
|
|
@@ -6172,6 +6254,10 @@
|
|
|
6172
6254
|
}
|
|
6173
6255
|
}
|
|
6174
6256
|
|
|
6257
|
+
if ((key === "mouseenter" || key === "mouseleave") && !this.pseudoTracking) {
|
|
6258
|
+
this.bindPseudoEvents();
|
|
6259
|
+
}
|
|
6260
|
+
|
|
6175
6261
|
if (changed) {
|
|
6176
6262
|
this.updateEventListeners();
|
|
6177
6263
|
}
|
|
@@ -6185,8 +6271,7 @@
|
|
|
6185
6271
|
if (listener.components.length) {
|
|
6186
6272
|
if (!listener.handler) {
|
|
6187
6273
|
listener.handler = this.track.bind(this, key);
|
|
6188
|
-
this.el.addEventListener(key, listener.handler);
|
|
6189
|
-
console.log("add", key); // this.el.addEventListener(key, listener.handler, {passive: true})
|
|
6274
|
+
this.el.addEventListener(key, listener.handler); // this.el.addEventListener(key, listener.handler, {passive: true})
|
|
6190
6275
|
}
|
|
6191
6276
|
} else {
|
|
6192
6277
|
if (listener.handler) {
|
|
@@ -6203,11 +6288,15 @@
|
|
|
6203
6288
|
var targets = this.findTargets(path);
|
|
6204
6289
|
targets = this.bindComponents(type, targets);
|
|
6205
6290
|
this.triggerEvents(type, e, targets);
|
|
6291
|
+
|
|
6292
|
+
if (this.pseudoTracking && (type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length) {
|
|
6293
|
+
this.pseudoMouseLeave("none", e);
|
|
6294
|
+
}
|
|
6206
6295
|
}
|
|
6207
6296
|
}, {
|
|
6208
6297
|
key: "findTargets",
|
|
6209
6298
|
value: function findTargets(path) {
|
|
6210
|
-
var
|
|
6299
|
+
var _this4 = this;
|
|
6211
6300
|
|
|
6212
6301
|
var targets = {};
|
|
6213
6302
|
var componentMap = Object.keys(this.componentMap);
|
|
@@ -6220,7 +6309,7 @@
|
|
|
6220
6309
|
var el = _step2.value;
|
|
6221
6310
|
var classList = el.classList ? _toConsumableArray(el.classList) : [];
|
|
6222
6311
|
var abort = classList.filter(function (item) {
|
|
6223
|
-
return
|
|
6312
|
+
return _this4.abortClasses.includes(item);
|
|
6224
6313
|
});
|
|
6225
6314
|
|
|
6226
6315
|
if (abort.length) {
|
|
@@ -6260,7 +6349,7 @@
|
|
|
6260
6349
|
}, {
|
|
6261
6350
|
key: "bindComponents",
|
|
6262
6351
|
value: function bindComponents(type, targets) {
|
|
6263
|
-
var
|
|
6352
|
+
var _this5 = this;
|
|
6264
6353
|
|
|
6265
6354
|
//ensure row component is looked up before cell
|
|
6266
6355
|
var keys = Object.keys(targets).reverse(),
|
|
@@ -6275,7 +6364,7 @@
|
|
|
6275
6364
|
var key = _step4.value;
|
|
6276
6365
|
var component = void 0;
|
|
6277
6366
|
var target = targets[key];
|
|
6278
|
-
var previousTarget =
|
|
6367
|
+
var previousTarget = _this5.previousTargets[key];
|
|
6279
6368
|
|
|
6280
6369
|
if (previousTarget && previousTarget.target === target) {
|
|
6281
6370
|
component = previousTarget.component;
|
|
@@ -6284,7 +6373,7 @@
|
|
|
6284
6373
|
case "row":
|
|
6285
6374
|
case "group":
|
|
6286
6375
|
if (listener.components.includes("row") || listener.components.includes("cell")) {
|
|
6287
|
-
var rows =
|
|
6376
|
+
var rows = _this5.table.rowManager.getVisibleRows(true);
|
|
6288
6377
|
|
|
6289
6378
|
component = rows.find(function (row) {
|
|
6290
6379
|
return row.getElement() === target;
|
|
@@ -6295,7 +6384,7 @@
|
|
|
6295
6384
|
|
|
6296
6385
|
case "column":
|
|
6297
6386
|
if (listener.components.includes("column")) {
|
|
6298
|
-
component =
|
|
6387
|
+
component = _this5.table.columnManager.findColumn(target);
|
|
6299
6388
|
}
|
|
6300
6389
|
|
|
6301
6390
|
break;
|
|
@@ -6341,20 +6430,32 @@
|
|
|
6341
6430
|
}
|
|
6342
6431
|
}
|
|
6343
6432
|
}
|
|
6433
|
+
}, {
|
|
6434
|
+
key: "clearWatchers",
|
|
6435
|
+
value: function clearWatchers() {
|
|
6436
|
+
for (var key in this.listeners) {
|
|
6437
|
+
var listener = this.listeners[key];
|
|
6438
|
+
|
|
6439
|
+
if (listener.handler) {
|
|
6440
|
+
this.el.removeEventListener(key, listener.handler);
|
|
6441
|
+
listener.handler = null;
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6444
|
+
}
|
|
6344
6445
|
}]);
|
|
6345
6446
|
|
|
6346
6447
|
return InteractionManager;
|
|
6347
6448
|
}(CoreFeature);
|
|
6348
6449
|
|
|
6349
|
-
var
|
|
6350
|
-
function
|
|
6351
|
-
_classCallCheck(this,
|
|
6450
|
+
var ComponentFunctionBinder = /*#__PURE__*/function () {
|
|
6451
|
+
function ComponentFunctionBinder(table) {
|
|
6452
|
+
_classCallCheck(this, ComponentFunctionBinder);
|
|
6352
6453
|
|
|
6353
6454
|
this.table = table;
|
|
6354
6455
|
this.bindings = {};
|
|
6355
6456
|
}
|
|
6356
6457
|
|
|
6357
|
-
_createClass(
|
|
6458
|
+
_createClass(ComponentFunctionBinder, [{
|
|
6358
6459
|
key: "bind",
|
|
6359
6460
|
value: function bind(type, funcName, handler) {
|
|
6360
6461
|
if (!this.bindings[type]) {
|
|
@@ -6380,7 +6481,7 @@
|
|
|
6380
6481
|
}
|
|
6381
6482
|
}]);
|
|
6382
6483
|
|
|
6383
|
-
return
|
|
6484
|
+
return ComponentFunctionBinder;
|
|
6384
6485
|
}();
|
|
6385
6486
|
|
|
6386
6487
|
var DataLoader = /*#__PURE__*/function (_CoreFeature) {
|
|
@@ -6459,7 +6560,7 @@
|
|
|
6459
6560
|
data = JSON.parse(data);
|
|
6460
6561
|
}
|
|
6461
6562
|
|
|
6462
|
-
if (this.confirm("data-loading", data, params, config, silent)) {
|
|
6563
|
+
if (this.confirm("data-loading", [data, params, config, silent])) {
|
|
6463
6564
|
this.loading = true;
|
|
6464
6565
|
|
|
6465
6566
|
if (!silent) {
|
|
@@ -6467,7 +6568,7 @@
|
|
|
6467
6568
|
} //get params for request
|
|
6468
6569
|
|
|
6469
6570
|
|
|
6470
|
-
|
|
6571
|
+
params = this.chain("data-params", [data, config, silent], params || {}, params || {});
|
|
6471
6572
|
params = this.mapParams(params, this.table.options.dataSendParams);
|
|
6472
6573
|
var result = this.chain("data-load", [data, params, config, silent], Promise.resolve([]));
|
|
6473
6574
|
return result.then(function (response) {
|
|
@@ -7787,13 +7888,13 @@
|
|
|
7787
7888
|
|
|
7788
7889
|
this.browserSlow = false; //handle reduced functionality for slower browsers
|
|
7789
7890
|
|
|
7790
|
-
this.browserMobile = false; //check if running on
|
|
7891
|
+
this.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance
|
|
7791
7892
|
|
|
7792
7893
|
this.rtl = false; //check if the table is in RTL mode
|
|
7793
7894
|
|
|
7794
7895
|
this.originalElement = null; //hold original table element if it has been replaced
|
|
7795
7896
|
|
|
7796
|
-
this.componentFunctionBinder = new
|
|
7897
|
+
this.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions
|
|
7797
7898
|
|
|
7798
7899
|
this.dataLoader = false; //bind component functions
|
|
7799
7900
|
|
|
@@ -7807,14 +7908,14 @@
|
|
|
7807
7908
|
this.initialized = false;
|
|
7808
7909
|
|
|
7809
7910
|
if (this.initializeElement(element)) {
|
|
7810
|
-
this.initialzeCoreSystems(options); //delay table creation to allow event bindings
|
|
7911
|
+
this.initialzeCoreSystems(options); //delay table creation to allow event bindings immediately after the constructor
|
|
7811
7912
|
|
|
7812
7913
|
setTimeout(function () {
|
|
7813
7914
|
_this._create();
|
|
7814
7915
|
});
|
|
7815
7916
|
}
|
|
7816
7917
|
|
|
7817
|
-
TableRegistry.register(this); //register table for
|
|
7918
|
+
TableRegistry.register(this); //register table for inter-device communication
|
|
7818
7919
|
}
|
|
7819
7920
|
|
|
7820
7921
|
_createClass(Tabulator, [{
|
|
@@ -7849,7 +7950,7 @@
|
|
|
7849
7950
|
|
|
7850
7951
|
this._clearObjectPointers();
|
|
7851
7952
|
|
|
7852
|
-
this.
|
|
7953
|
+
this._mapDeprecatedFunctionality();
|
|
7853
7954
|
|
|
7854
7955
|
this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
|
|
7855
7956
|
this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
|
|
@@ -7858,11 +7959,11 @@
|
|
|
7858
7959
|
this.columnManager.initialize();
|
|
7859
7960
|
this.rowManager.initialize();
|
|
7860
7961
|
this.footerManager.initialize();
|
|
7861
|
-
} //convert
|
|
7962
|
+
} //convert deprecated functionality to new functions
|
|
7862
7963
|
|
|
7863
7964
|
}, {
|
|
7864
|
-
key: "
|
|
7865
|
-
value: function
|
|
7965
|
+
key: "_mapDeprecatedFunctionality",
|
|
7966
|
+
value: function _mapDeprecatedFunctionality() {//all previously deprecated functionality removed in the 5.0 release
|
|
7866
7967
|
}
|
|
7867
7968
|
}, {
|
|
7868
7969
|
key: "_clearSelection",
|
|
@@ -7883,7 +7984,7 @@
|
|
|
7883
7984
|
}
|
|
7884
7985
|
|
|
7885
7986
|
this.element.classList.remove("tabulator-block-select");
|
|
7886
|
-
} //
|
|
7987
|
+
} //create table
|
|
7887
7988
|
|
|
7888
7989
|
}, {
|
|
7889
7990
|
key: "_create",
|
|
@@ -7991,6 +8092,7 @@
|
|
|
7991
8092
|
value: function _initializeTable() {
|
|
7992
8093
|
var element = this.element,
|
|
7993
8094
|
options = this.options;
|
|
8095
|
+
this.interactionMonitor.initialize();
|
|
7994
8096
|
this.columnManager.initialize();
|
|
7995
8097
|
this.rowManager.initialize();
|
|
7996
8098
|
|
|
@@ -8044,7 +8146,7 @@
|
|
|
8044
8146
|
key: "destroy",
|
|
8045
8147
|
value: function destroy() {
|
|
8046
8148
|
var element = this.element;
|
|
8047
|
-
TableRegistry.deregister(this); //deregister table from
|
|
8149
|
+
TableRegistry.deregister(this); //deregister table from inter-device communication
|
|
8048
8150
|
|
|
8049
8151
|
this.eventBus.dispatch("table-destroy"); //clear row data
|
|
8050
8152
|
|
|
@@ -8168,7 +8270,11 @@
|
|
|
8168
8270
|
}, {
|
|
8169
8271
|
key: "replaceData",
|
|
8170
8272
|
value: function replaceData(data, params, config) {
|
|
8171
|
-
|
|
8273
|
+
if (this.initialized) {
|
|
8274
|
+
return this.dataLoader.load(data, params, config, true, true);
|
|
8275
|
+
} else {
|
|
8276
|
+
console.warn("replaceData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8277
|
+
}
|
|
8172
8278
|
} //update table data
|
|
8173
8279
|
|
|
8174
8280
|
}, {
|
|
@@ -8177,59 +8283,68 @@
|
|
|
8177
8283
|
var _this3 = this;
|
|
8178
8284
|
|
|
8179
8285
|
var responses = 0;
|
|
8180
|
-
return new Promise(function (resolve, reject) {
|
|
8181
|
-
_this3.dataLoader.blockActiveLoad();
|
|
8182
8286
|
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8287
|
+
if (this.initialized) {
|
|
8288
|
+
return new Promise(function (resolve, reject) {
|
|
8289
|
+
_this3.dataLoader.blockActiveLoad();
|
|
8186
8290
|
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8291
|
+
if (typeof data === "string") {
|
|
8292
|
+
data = JSON.parse(data);
|
|
8293
|
+
}
|
|
8190
8294
|
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
row.
|
|
8194
|
-
responses--;
|
|
8295
|
+
if (data) {
|
|
8296
|
+
data.forEach(function (item) {
|
|
8297
|
+
var row = _this3.rowManager.findRow(item[_this3.options.index]);
|
|
8195
8298
|
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8299
|
+
if (row) {
|
|
8300
|
+
responses++;
|
|
8301
|
+
row.updateData(item).then(function () {
|
|
8302
|
+
responses--;
|
|
8303
|
+
|
|
8304
|
+
if (!responses) {
|
|
8305
|
+
resolve();
|
|
8306
|
+
}
|
|
8307
|
+
});
|
|
8308
|
+
}
|
|
8309
|
+
});
|
|
8310
|
+
} else {
|
|
8311
|
+
console.warn("Update Error - No data provided");
|
|
8312
|
+
reject("Update Error - No data provided");
|
|
8313
|
+
}
|
|
8314
|
+
});
|
|
8315
|
+
} else {
|
|
8316
|
+
console.warn("updateData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8317
|
+
}
|
|
8207
8318
|
}
|
|
8208
8319
|
}, {
|
|
8209
8320
|
key: "addData",
|
|
8210
8321
|
value: function addData(data, pos, index) {
|
|
8211
8322
|
var _this4 = this;
|
|
8212
8323
|
|
|
8213
|
-
|
|
8214
|
-
|
|
8324
|
+
if (this.initialized) {
|
|
8325
|
+
return new Promise(function (resolve, reject) {
|
|
8326
|
+
_this4.dataLoader.blockActiveLoad();
|
|
8215
8327
|
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8328
|
+
if (typeof data === "string") {
|
|
8329
|
+
data = JSON.parse(data);
|
|
8330
|
+
}
|
|
8219
8331
|
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8332
|
+
if (data) {
|
|
8333
|
+
_this4.rowManager.addRows(data, pos, index).then(function (rows) {
|
|
8334
|
+
var output = [];
|
|
8335
|
+
rows.forEach(function (row) {
|
|
8336
|
+
output.push(row.getComponent());
|
|
8337
|
+
});
|
|
8338
|
+
resolve(output);
|
|
8225
8339
|
});
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8340
|
+
} else {
|
|
8341
|
+
console.warn("Update Error - No data provided");
|
|
8342
|
+
reject("Update Error - No data provided");
|
|
8343
|
+
}
|
|
8344
|
+
});
|
|
8345
|
+
} else {
|
|
8346
|
+
console.warn("addData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8347
|
+
}
|
|
8233
8348
|
} //update table data
|
|
8234
8349
|
|
|
8235
8350
|
}, {
|
|
@@ -8239,44 +8354,49 @@
|
|
|
8239
8354
|
|
|
8240
8355
|
var rows = [],
|
|
8241
8356
|
responses = 0;
|
|
8242
|
-
return new Promise(function (resolve, reject) {
|
|
8243
|
-
_this5.dataLoader.blockActiveLoad();
|
|
8244
8357
|
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8358
|
+
if (this.initialized) {
|
|
8359
|
+
return new Promise(function (resolve, reject) {
|
|
8360
|
+
_this5.dataLoader.blockActiveLoad();
|
|
8248
8361
|
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8362
|
+
if (typeof data === "string") {
|
|
8363
|
+
data = JSON.parse(data);
|
|
8364
|
+
}
|
|
8252
8365
|
|
|
8253
|
-
|
|
8366
|
+
if (data) {
|
|
8367
|
+
data.forEach(function (item) {
|
|
8368
|
+
var row = _this5.rowManager.findRow(item[_this5.options.index]);
|
|
8254
8369
|
|
|
8255
|
-
|
|
8256
|
-
row.updateData(item).then(function () {
|
|
8257
|
-
responses--;
|
|
8258
|
-
rows.push(row.getComponent());
|
|
8370
|
+
responses++;
|
|
8259
8371
|
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
} else {
|
|
8265
|
-
_this5.rowManager.addRows(item).then(function (newRows) {
|
|
8266
|
-
responses--;
|
|
8267
|
-
rows.push(newRows[0].getComponent());
|
|
8372
|
+
if (row) {
|
|
8373
|
+
row.updateData(item).then(function () {
|
|
8374
|
+
responses--;
|
|
8375
|
+
rows.push(row.getComponent());
|
|
8268
8376
|
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8377
|
+
if (!responses) {
|
|
8378
|
+
resolve(rows);
|
|
8379
|
+
}
|
|
8380
|
+
});
|
|
8381
|
+
} else {
|
|
8382
|
+
_this5.rowManager.addRows(item).then(function (newRows) {
|
|
8383
|
+
responses--;
|
|
8384
|
+
rows.push(newRows[0].getComponent());
|
|
8385
|
+
|
|
8386
|
+
if (!responses) {
|
|
8387
|
+
resolve(rows);
|
|
8388
|
+
}
|
|
8389
|
+
});
|
|
8390
|
+
}
|
|
8391
|
+
});
|
|
8392
|
+
} else {
|
|
8393
|
+
console.warn("Update Error - No data provided");
|
|
8394
|
+
reject("Update Error - No data provided");
|
|
8395
|
+
}
|
|
8396
|
+
});
|
|
8397
|
+
} else {
|
|
8398
|
+
console.warn("updateOrAddData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8399
|
+
}
|
|
8280
8400
|
} //get row object
|
|
8281
8401
|
|
|
8282
8402
|
}, {
|
|
@@ -8354,13 +8474,17 @@
|
|
|
8354
8474
|
}, {
|
|
8355
8475
|
key: "addRow",
|
|
8356
8476
|
value: function addRow(data, pos, index) {
|
|
8357
|
-
if (
|
|
8358
|
-
data
|
|
8359
|
-
|
|
8477
|
+
if (this.initialized) {
|
|
8478
|
+
if (typeof data === "string") {
|
|
8479
|
+
data = JSON.parse(data);
|
|
8480
|
+
}
|
|
8360
8481
|
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8482
|
+
return this.rowManager.addRows(data, pos, index).then(function (rows) {
|
|
8483
|
+
return rows[0].getComponent();
|
|
8484
|
+
});
|
|
8485
|
+
} else {
|
|
8486
|
+
console.warn("addRow failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8487
|
+
}
|
|
8364
8488
|
} //update a row if it exitsts otherwise create it
|
|
8365
8489
|
|
|
8366
8490
|
}, {
|
|
@@ -8394,7 +8518,7 @@
|
|
|
8394
8518
|
|
|
8395
8519
|
if (row) {
|
|
8396
8520
|
return row.updateData(data).then(function () {
|
|
8397
|
-
resolve(row.getComponent());
|
|
8521
|
+
return Promise.resolve(row.getComponent());
|
|
8398
8522
|
});
|
|
8399
8523
|
} else {
|
|
8400
8524
|
console.warn("Update Error - No matching row found:", index);
|
|
@@ -8585,8 +8709,12 @@
|
|
|
8585
8709
|
}, {
|
|
8586
8710
|
key: "redraw",
|
|
8587
8711
|
value: function redraw(force) {
|
|
8588
|
-
this.
|
|
8589
|
-
|
|
8712
|
+
if (this.initialized) {
|
|
8713
|
+
this.columnManager.redraw(force);
|
|
8714
|
+
this.rowManager.redraw(force);
|
|
8715
|
+
} else {
|
|
8716
|
+
console.warn("redraw failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8717
|
+
}
|
|
8590
8718
|
}
|
|
8591
8719
|
}, {
|
|
8592
8720
|
key: "setHeight",
|
|
@@ -9735,6 +9863,7 @@
|
|
|
9735
9863
|
this.subscribe("column-add", this.recalcActiveRows.bind(this));
|
|
9736
9864
|
this.subscribe("data-refeshed", this.recalcActiveRows.bind(this));
|
|
9737
9865
|
this.subscribe("table-redraw", this.tableRedraw.bind(this));
|
|
9866
|
+
this.subscribe("rows-visible", this.visibleRows.bind(this));
|
|
9738
9867
|
this.registerTableFunction("getCalcResults", this.getResults.bind(this));
|
|
9739
9868
|
this.registerTableFunction("recalc", this.userRecalc.bind(this));
|
|
9740
9869
|
}
|
|
@@ -9758,6 +9887,19 @@
|
|
|
9758
9887
|
///////// Internal Logic //////////
|
|
9759
9888
|
///////////////////////////////////
|
|
9760
9889
|
|
|
9890
|
+
}, {
|
|
9891
|
+
key: "visibleRows",
|
|
9892
|
+
value: function visibleRows(viewable, rows) {
|
|
9893
|
+
if (this.topRow) {
|
|
9894
|
+
rows.unshift(this.topRow);
|
|
9895
|
+
}
|
|
9896
|
+
|
|
9897
|
+
if (this.botRow) {
|
|
9898
|
+
rows.push(this.botRow);
|
|
9899
|
+
}
|
|
9900
|
+
|
|
9901
|
+
return rows;
|
|
9902
|
+
}
|
|
9761
9903
|
}, {
|
|
9762
9904
|
key: "rowsUpdated",
|
|
9763
9905
|
value: function rowsUpdated(row) {
|
|
@@ -10043,7 +10185,7 @@
|
|
|
10043
10185
|
this.table.modules.mutator.disable();
|
|
10044
10186
|
}
|
|
10045
10187
|
|
|
10046
|
-
row = new Row
|
|
10188
|
+
row = new Row(rowData, this, "calc");
|
|
10047
10189
|
|
|
10048
10190
|
if (this.table.modExists("mutator")) {
|
|
10049
10191
|
this.table.modules.mutator.enable();
|
|
@@ -10054,7 +10196,7 @@
|
|
|
10054
10196
|
|
|
10055
10197
|
row.getComponent = function () {
|
|
10056
10198
|
if (!row.component) {
|
|
10057
|
-
row.component = new CalcComponent(
|
|
10199
|
+
row.component = new CalcComponent(row);
|
|
10058
10200
|
}
|
|
10059
10201
|
|
|
10060
10202
|
return row.component;
|
|
@@ -10084,7 +10226,7 @@
|
|
|
10084
10226
|
|
|
10085
10227
|
_this4.genColumn.definition.cssClass = column.definition.cssClass; //generate cell and assign to correct column
|
|
10086
10228
|
|
|
10087
|
-
var cell = new Cell
|
|
10229
|
+
var cell = new Cell(_this4.genColumn, row);
|
|
10088
10230
|
cell.getElement();
|
|
10089
10231
|
cell.column = column;
|
|
10090
10232
|
cell.setWidth();
|
|
@@ -10276,11 +10418,9 @@
|
|
|
10276
10418
|
value: function initialize() {
|
|
10277
10419
|
if (this.table.options.dataTree) {
|
|
10278
10420
|
var dummyEl = null,
|
|
10279
|
-
firstCol = this.table.columnManager.getFirstVisibileColumn(),
|
|
10280
10421
|
options = this.table.options;
|
|
10281
10422
|
this.field = options.dataTreeChildField;
|
|
10282
10423
|
this.indent = options.dataTreeChildIndent;
|
|
10283
|
-
this.elementField = options.dataTreeElementColumn || (firstCol ? firstCol.field : false);
|
|
10284
10424
|
|
|
10285
10425
|
if (options.dataTreeBranchElement) {
|
|
10286
10426
|
if (options.dataTreeBranchElement === true) {
|
|
@@ -10349,13 +10489,21 @@
|
|
|
10349
10489
|
|
|
10350
10490
|
this.subscribe("row-init", this.initializeRow.bind(this));
|
|
10351
10491
|
this.subscribe("row-layout-after", this.layoutRow.bind(this));
|
|
10352
|
-
this.subscribe("row-relayout", this.layoutRow.bind(this));
|
|
10353
10492
|
this.subscribe("row-deleted", this.rowDelete.bind(this), 0);
|
|
10354
10493
|
this.subscribe("row-data-changed", this.rowDataChanged.bind(this), 10);
|
|
10494
|
+
this.subscribe("cell-value-updated", this.cellValueChanged.bind(this));
|
|
10495
|
+
this.subscribe("edit-cancelled", this.cellValueChanged.bind(this));
|
|
10355
10496
|
this.subscribe("column-moving-rows", this.columnMoving.bind(this));
|
|
10497
|
+
this.subscribe("table-built", this.initializeElementField.bind(this));
|
|
10356
10498
|
this.registerDisplayHandler(this.getRows.bind(this), 30);
|
|
10357
10499
|
}
|
|
10358
10500
|
}
|
|
10501
|
+
}, {
|
|
10502
|
+
key: "initializeElementField",
|
|
10503
|
+
value: function initializeElementField() {
|
|
10504
|
+
var firstCol = this.table.columnManager.getFirstVisibleColumn();
|
|
10505
|
+
this.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);
|
|
10506
|
+
}
|
|
10359
10507
|
}, {
|
|
10360
10508
|
key: "getRowChildren",
|
|
10361
10509
|
value: function getRowChildren(row) {
|
|
@@ -10384,6 +10532,15 @@
|
|
|
10384
10532
|
}
|
|
10385
10533
|
}
|
|
10386
10534
|
}
|
|
10535
|
+
}, {
|
|
10536
|
+
key: "cellValueChanged",
|
|
10537
|
+
value: function cellValueChanged(cell) {
|
|
10538
|
+
var field = cell.column.getField();
|
|
10539
|
+
|
|
10540
|
+
if (field === this.elementField) {
|
|
10541
|
+
this.layoutRow(cell.row);
|
|
10542
|
+
}
|
|
10543
|
+
}
|
|
10387
10544
|
}, {
|
|
10388
10545
|
key: "initializeRow",
|
|
10389
10546
|
value: function initializeRow(row) {
|
|
@@ -10518,7 +10675,7 @@
|
|
|
10518
10675
|
var config, children;
|
|
10519
10676
|
output.push(row);
|
|
10520
10677
|
|
|
10521
|
-
if (row instanceof Row
|
|
10678
|
+
if (row instanceof Row) {
|
|
10522
10679
|
row.create();
|
|
10523
10680
|
config = row.modules.dataTree.children;
|
|
10524
10681
|
|
|
@@ -10583,7 +10740,7 @@
|
|
|
10583
10740
|
}
|
|
10584
10741
|
|
|
10585
10742
|
childArray.forEach(function (childData) {
|
|
10586
|
-
var childRow = new Row
|
|
10743
|
+
var childRow = new Row(childData || {}, _this6.table.rowManager);
|
|
10587
10744
|
childRow.create();
|
|
10588
10745
|
childRow.modules.dataTree.index = row.modules.dataTree.index + 1;
|
|
10589
10746
|
childRow.modules.dataTree.parent = row;
|
|
@@ -10657,7 +10814,7 @@
|
|
|
10657
10814
|
}
|
|
10658
10815
|
|
|
10659
10816
|
children.forEach(function (childRow) {
|
|
10660
|
-
if (childRow instanceof Row
|
|
10817
|
+
if (childRow instanceof Row) {
|
|
10661
10818
|
output.push(childRow);
|
|
10662
10819
|
}
|
|
10663
10820
|
});
|
|
@@ -10730,7 +10887,7 @@
|
|
|
10730
10887
|
var match = false;
|
|
10731
10888
|
|
|
10732
10889
|
if (_typeof(subject) == "object") {
|
|
10733
|
-
if (subject instanceof Row
|
|
10890
|
+
if (subject instanceof Row) {
|
|
10734
10891
|
//subject is row element
|
|
10735
10892
|
match = subject.data;
|
|
10736
10893
|
} else if (subject instanceof RowComponent) {
|
|
@@ -10739,7 +10896,7 @@
|
|
|
10739
10896
|
} else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) {
|
|
10740
10897
|
if (parent.modules.dataTree) {
|
|
10741
10898
|
match = parent.modules.dataTree.children.find(function (childRow) {
|
|
10742
|
-
return childRow instanceof Row
|
|
10899
|
+
return childRow instanceof Row ? childRow.element === subject : false;
|
|
10743
10900
|
});
|
|
10744
10901
|
|
|
10745
10902
|
if (match) {
|
|
@@ -10783,7 +10940,7 @@
|
|
|
10783
10940
|
}
|
|
10784
10941
|
|
|
10785
10942
|
config.children.forEach(function (childRow) {
|
|
10786
|
-
if (childRow instanceof Row
|
|
10943
|
+
if (childRow instanceof Row) {
|
|
10787
10944
|
output.push(component ? childRow.getComponent() : childRow);
|
|
10788
10945
|
|
|
10789
10946
|
if (recurse) {
|
|
@@ -10795,13 +10952,6 @@
|
|
|
10795
10952
|
|
|
10796
10953
|
return output;
|
|
10797
10954
|
}
|
|
10798
|
-
}, {
|
|
10799
|
-
key: "checkForRestyle",
|
|
10800
|
-
value: function checkForRestyle(cell) {
|
|
10801
|
-
if (!cell.row.cells.indexOf(cell)) {
|
|
10802
|
-
this.layoutRow(cell.row);
|
|
10803
|
-
}
|
|
10804
|
-
}
|
|
10805
10955
|
}, {
|
|
10806
10956
|
key: "getChildField",
|
|
10807
10957
|
value: function getChildField() {
|
|
@@ -10810,6 +10960,7 @@
|
|
|
10810
10960
|
}, {
|
|
10811
10961
|
key: "redrawNeeded",
|
|
10812
10962
|
value: function redrawNeeded(data) {
|
|
10963
|
+
console.log("needed?", data);
|
|
10813
10964
|
return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false);
|
|
10814
10965
|
}
|
|
10815
10966
|
}]);
|
|
@@ -10986,8 +11137,6 @@
|
|
|
10986
11137
|
}
|
|
10987
11138
|
|
|
10988
11139
|
rowData.push(cell);
|
|
10989
|
-
} else {
|
|
10990
|
-
rowData.push("");
|
|
10991
11140
|
}
|
|
10992
11141
|
});
|
|
10993
11142
|
return rowData;
|
|
@@ -11054,16 +11203,18 @@
|
|
|
11054
11203
|
rowData.push(!(col.value instanceof Date) && _typeof(col.value) === "object" ? JSON.stringify(col.value) : col.value);
|
|
11055
11204
|
|
|
11056
11205
|
if (col.width > 1 || col.height > -1) {
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11206
|
+
if (col.height > 1 || col.width > 1) {
|
|
11207
|
+
merges.push({
|
|
11208
|
+
s: {
|
|
11209
|
+
r: i,
|
|
11210
|
+
c: j
|
|
11211
|
+
},
|
|
11212
|
+
e: {
|
|
11213
|
+
r: i + col.height - 1,
|
|
11214
|
+
c: j + col.width - 1
|
|
11215
|
+
}
|
|
11216
|
+
});
|
|
11217
|
+
}
|
|
11067
11218
|
}
|
|
11068
11219
|
} else {
|
|
11069
11220
|
rowData.push("");
|
|
@@ -12862,11 +13013,9 @@
|
|
|
12862
13013
|
|
|
12863
13014
|
//draggable progress bar
|
|
12864
13015
|
function progress (cell, onRendered, success, cancel, editorParams) {
|
|
12865
|
-
var _element$getElementsB, _element$getElementsB2;
|
|
12866
|
-
|
|
12867
13016
|
var element = cell.getElement(),
|
|
12868
|
-
max = typeof editorParams.max === "undefined" ? (
|
|
12869
|
-
min = typeof editorParams.min === "undefined" ? (
|
|
13017
|
+
max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("max") || 100 : editorParams.max,
|
|
13018
|
+
min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("min") || 0 : editorParams.min,
|
|
12870
13019
|
percent = (max - min) / 100,
|
|
12871
13020
|
value = cell.getValue() || 0,
|
|
12872
13021
|
handle = document.createElement("div"),
|
|
@@ -13523,14 +13672,15 @@
|
|
|
13523
13672
|
var cell = this.currentCell,
|
|
13524
13673
|
cellEl;
|
|
13525
13674
|
this.invalidEdit = false;
|
|
13675
|
+
console.log("clear", cancel, cell, cell.validate);
|
|
13526
13676
|
|
|
13527
13677
|
if (cell) {
|
|
13528
13678
|
this.currentCell = false;
|
|
13529
13679
|
cellEl = cell.getElement();
|
|
13530
13680
|
|
|
13531
13681
|
if (cancel) {
|
|
13532
|
-
if (cell.validate) {
|
|
13533
|
-
|
|
13682
|
+
if (cell.column.modules.validate && this.table.modExists("validate")) {
|
|
13683
|
+
this.table.modules.validate.cellValidate(cell);
|
|
13534
13684
|
}
|
|
13535
13685
|
} else {
|
|
13536
13686
|
cellEl.classList.remove("tabulator-validation-fail");
|
|
@@ -13563,6 +13713,7 @@
|
|
|
13563
13713
|
cell.column.definition.cellEditCancelled.call(this.table, component);
|
|
13564
13714
|
}
|
|
13565
13715
|
|
|
13716
|
+
this.dispatch("edit-cancelled", cell);
|
|
13566
13717
|
this.dispatchExternal("cellEditCancelled", component);
|
|
13567
13718
|
}
|
|
13568
13719
|
} //return a formatted value for a cell
|
|
@@ -13699,10 +13850,6 @@
|
|
|
13699
13850
|
|
|
13700
13851
|
cell.setValue(value, true);
|
|
13701
13852
|
|
|
13702
|
-
if (self.table.options.dataTree && self.table.modExists("dataTree")) {
|
|
13703
|
-
self.table.modules.dataTree.checkForRestyle(cell);
|
|
13704
|
-
}
|
|
13705
|
-
|
|
13706
13853
|
if (valid !== true) {
|
|
13707
13854
|
element.classList.add("tabulator-validation-fail");
|
|
13708
13855
|
self.table.externalEvents.dispatch("validationFailed", cell.getComponent(), value, valid);
|
|
@@ -13725,10 +13872,6 @@
|
|
|
13725
13872
|
function cancel() {
|
|
13726
13873
|
if (self.currentCell === cell) {
|
|
13727
13874
|
self.cancelEdit();
|
|
13728
|
-
|
|
13729
|
-
if (self.table.options.dataTree && self.table.modExists("dataTree")) {
|
|
13730
|
-
self.table.modules.dataTree.checkForRestyle(cell);
|
|
13731
|
-
}
|
|
13732
13875
|
}
|
|
13733
13876
|
}
|
|
13734
13877
|
|
|
@@ -13942,7 +14085,7 @@
|
|
|
13942
14085
|
switch (range) {
|
|
13943
14086
|
case true:
|
|
13944
14087
|
case "visible":
|
|
13945
|
-
rows = this.table.rowManager.getVisibleRows(true);
|
|
14088
|
+
rows = this.table.rowManager.getVisibleRows(false, true);
|
|
13946
14089
|
break;
|
|
13947
14090
|
|
|
13948
14091
|
case "all":
|
|
@@ -14586,6 +14729,8 @@
|
|
|
14586
14729
|
_this.prevHeaderFilterChangeCheck = "{}";
|
|
14587
14730
|
_this.changed = false; //has filtering changed since last render
|
|
14588
14731
|
|
|
14732
|
+
_this.tableInitialized = false;
|
|
14733
|
+
|
|
14589
14734
|
_this.registerTableOption("filterMode", "local"); //local or remote filtering
|
|
14590
14735
|
|
|
14591
14736
|
|
|
@@ -14684,6 +14829,8 @@
|
|
|
14684
14829
|
}
|
|
14685
14830
|
});
|
|
14686
14831
|
}
|
|
14832
|
+
|
|
14833
|
+
this.tableInitialized = true;
|
|
14687
14834
|
}
|
|
14688
14835
|
}, {
|
|
14689
14836
|
key: "remoteFilterParams",
|
|
@@ -15152,10 +15299,12 @@
|
|
|
15152
15299
|
}, {
|
|
15153
15300
|
key: "refreshFilter",
|
|
15154
15301
|
value: function refreshFilter() {
|
|
15155
|
-
if (this.
|
|
15156
|
-
this.
|
|
15157
|
-
|
|
15158
|
-
|
|
15302
|
+
if (this.tableInitialized) {
|
|
15303
|
+
if (this.table.options.filterMode === "remote") {
|
|
15304
|
+
this.reloadData();
|
|
15305
|
+
} else {
|
|
15306
|
+
this.refreshData(true);
|
|
15307
|
+
}
|
|
15159
15308
|
} //TODO - Persist left position of row manager
|
|
15160
15309
|
// left = this.scrollLeft;
|
|
15161
15310
|
// this.scrollHorizontal(left);
|
|
@@ -15707,7 +15856,7 @@
|
|
|
15707
15856
|
var value = cell.getValue();
|
|
15708
15857
|
|
|
15709
15858
|
if (typeof DT != "undefined") {
|
|
15710
|
-
var newDatetime =
|
|
15859
|
+
var newDatetime = DT.fromFormat(String(value), inputFormat);
|
|
15711
15860
|
|
|
15712
15861
|
if (newDatetime.isValid) {
|
|
15713
15862
|
if (formatterParams.timezone) {
|
|
@@ -15716,7 +15865,7 @@
|
|
|
15716
15865
|
|
|
15717
15866
|
return newDatetime.toFormat(outputFormat);
|
|
15718
15867
|
} else {
|
|
15719
|
-
if (invalid === true) {
|
|
15868
|
+
if (invalid === true || !value) {
|
|
15720
15869
|
return value;
|
|
15721
15870
|
} else if (typeof invalid === "function") {
|
|
15722
15871
|
return invalid(value);
|
|
@@ -15740,7 +15889,7 @@
|
|
|
15740
15889
|
var value = cell.getValue();
|
|
15741
15890
|
|
|
15742
15891
|
if (typeof DT != "undefined") {
|
|
15743
|
-
var newDatetime = DT.fromFormat(value, inputFormat);
|
|
15892
|
+
var newDatetime = DT.fromFormat(String(value), inputFormat);
|
|
15744
15893
|
|
|
15745
15894
|
if (newDatetime.isValid) {
|
|
15746
15895
|
if (humanize) ; else {
|
|
@@ -16375,7 +16524,7 @@
|
|
|
16375
16524
|
this.subscribe("cell-layout", this.layoutCell.bind(this));
|
|
16376
16525
|
this.subscribe("column-init", this.initializeColumn.bind(this));
|
|
16377
16526
|
this.subscribe("column-width", this.layout.bind(this));
|
|
16378
|
-
this.subscribe("row-layout-
|
|
16527
|
+
this.subscribe("row-layout-after", this.layoutRow.bind(this));
|
|
16379
16528
|
this.subscribe("table-layout", this.layout.bind(this));
|
|
16380
16529
|
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
16381
16530
|
this.subscribe("columns-loading", this.reset.bind(this));
|
|
@@ -16739,7 +16888,11 @@
|
|
|
16739
16888
|
|
|
16740
16889
|
if (index > -1) {
|
|
16741
16890
|
var rowEl = row.getElement();
|
|
16742
|
-
|
|
16891
|
+
|
|
16892
|
+
if (rowEl.parentNode) {
|
|
16893
|
+
rowEl.parentNode.removeChild(rowEl);
|
|
16894
|
+
}
|
|
16895
|
+
|
|
16743
16896
|
this.rows.splice(index, 1);
|
|
16744
16897
|
}
|
|
16745
16898
|
}
|
|
@@ -16883,10 +17036,16 @@
|
|
|
16883
17036
|
group.wipe();
|
|
16884
17037
|
});
|
|
16885
17038
|
} else {
|
|
16886
|
-
this.
|
|
16887
|
-
|
|
16888
|
-
|
|
17039
|
+
this.rows.forEach(function (row) {
|
|
17040
|
+
if (row.modules) {
|
|
17041
|
+
delete row.modules.group;
|
|
17042
|
+
}
|
|
17043
|
+
});
|
|
16889
17044
|
}
|
|
17045
|
+
|
|
17046
|
+
this.element = false;
|
|
17047
|
+
this.arrowElement = false;
|
|
17048
|
+
this.elementContents = false;
|
|
16890
17049
|
}
|
|
16891
17050
|
}, {
|
|
16892
17051
|
key: "createElements",
|
|
@@ -17283,7 +17442,7 @@
|
|
|
17283
17442
|
|
|
17284
17443
|
if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) {
|
|
17285
17444
|
this.element.classList.add("tabulator-group-visible");
|
|
17286
|
-
var prev = this.
|
|
17445
|
+
var prev = this.generateElement();
|
|
17287
17446
|
|
|
17288
17447
|
if (this.groupList.length) {
|
|
17289
17448
|
this.groupList.forEach(function (group) {
|
|
@@ -17402,7 +17561,12 @@
|
|
|
17402
17561
|
}, {
|
|
17403
17562
|
key: "getElement",
|
|
17404
17563
|
value: function getElement() {
|
|
17405
|
-
this.
|
|
17564
|
+
return this.elementContents ? this.element : this.generateElement();
|
|
17565
|
+
}
|
|
17566
|
+
}, {
|
|
17567
|
+
key: "generateElement",
|
|
17568
|
+
value: function generateElement() {
|
|
17569
|
+
this.addBindings = false;
|
|
17406
17570
|
|
|
17407
17571
|
this._visSet();
|
|
17408
17572
|
|
|
@@ -17577,6 +17741,30 @@
|
|
|
17577
17741
|
_createClass(GroupRows, [{
|
|
17578
17742
|
key: "initialize",
|
|
17579
17743
|
value: function initialize() {
|
|
17744
|
+
if (this.table.options.groupBy) {
|
|
17745
|
+
this.configureGroupSetup();
|
|
17746
|
+
|
|
17747
|
+
if (this.table.options.groupUpdateOnCellEdit) {
|
|
17748
|
+
this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
|
|
17749
|
+
this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
|
|
17750
|
+
}
|
|
17751
|
+
|
|
17752
|
+
this.subscribe("row-deleting", this.rowDeleting.bind(this));
|
|
17753
|
+
this.subscribe("row-deleted", this.rowsUpdated.bind(this));
|
|
17754
|
+
this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
|
|
17755
|
+
this.subscribe("rows-wipe", this.wipe.bind(this));
|
|
17756
|
+
this.subscribe("rows-added", this.rowsUpdated.bind(this));
|
|
17757
|
+
this.subscribe("row-moving", this.rowMoving.bind(this));
|
|
17758
|
+
this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
|
|
17759
|
+
this.subscribe("rows-sample", this.rowSample.bind(this));
|
|
17760
|
+
this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
|
|
17761
|
+
this.registerDisplayHandler(this.displayHandler, 20);
|
|
17762
|
+
this.initialized = true;
|
|
17763
|
+
}
|
|
17764
|
+
}
|
|
17765
|
+
}, {
|
|
17766
|
+
key: "configureGroupSetup",
|
|
17767
|
+
value: function configureGroupSetup() {
|
|
17580
17768
|
var _this2 = this;
|
|
17581
17769
|
|
|
17582
17770
|
if (this.table.options.groupBy) {
|
|
@@ -17666,23 +17854,6 @@
|
|
|
17666
17854
|
if (groupHeader) {
|
|
17667
17855
|
this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
|
|
17668
17856
|
}
|
|
17669
|
-
|
|
17670
|
-
if (this.table.options.groupUpdateOnCellEdit) {
|
|
17671
|
-
this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
|
|
17672
|
-
this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
|
|
17673
|
-
}
|
|
17674
|
-
|
|
17675
|
-
this.subscribe("row-deleting", this.rowDeleting.bind(this));
|
|
17676
|
-
this.subscribe("row-deleted", this.rowsUpdated.bind(this));
|
|
17677
|
-
this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
|
|
17678
|
-
this.subscribe("rows-wipe", this.wipe.bind(this));
|
|
17679
|
-
this.subscribe("rows-added", this.rowsUpdated.bind(this));
|
|
17680
|
-
this.subscribe("row-moving", this.rowMoving.bind(this));
|
|
17681
|
-
this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
|
|
17682
|
-
this.subscribe("rows-sample", this.rowSample.bind(this));
|
|
17683
|
-
this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
|
|
17684
|
-
this.registerDisplayHandler(this.displayHandler, 20);
|
|
17685
|
-
this.initialized = true;
|
|
17686
17857
|
}
|
|
17687
17858
|
}
|
|
17688
17859
|
}, {
|
|
@@ -17744,23 +17915,29 @@
|
|
|
17744
17915
|
key: "setGroupBy",
|
|
17745
17916
|
value: function setGroupBy(groups) {
|
|
17746
17917
|
this.table.options.groupBy = groups;
|
|
17747
|
-
|
|
17748
|
-
this.
|
|
17918
|
+
|
|
17919
|
+
if (!this.initialized) {
|
|
17920
|
+
this.initialize();
|
|
17921
|
+
} else {
|
|
17922
|
+
this.configureGroupSetup();
|
|
17923
|
+
}
|
|
17924
|
+
|
|
17925
|
+
this.refreshData();
|
|
17749
17926
|
this.trackChanges();
|
|
17750
17927
|
}
|
|
17751
17928
|
}, {
|
|
17752
17929
|
key: "setGroupValues",
|
|
17753
17930
|
value: function setGroupValues(groupValues) {
|
|
17754
17931
|
this.table.options.groupValues = groupValues;
|
|
17755
|
-
this.
|
|
17756
|
-
this.refreshData(
|
|
17932
|
+
this.configureGroupSetup();
|
|
17933
|
+
this.refreshData();
|
|
17757
17934
|
this.trackChanges();
|
|
17758
17935
|
}
|
|
17759
17936
|
}, {
|
|
17760
17937
|
key: "setGroupStartOpen",
|
|
17761
17938
|
value: function setGroupStartOpen(values) {
|
|
17762
17939
|
this.table.options.groupStartOpen = values;
|
|
17763
|
-
this.
|
|
17940
|
+
this.configureGroupSetup();
|
|
17764
17941
|
|
|
17765
17942
|
if (this.table.options.groupBy) {
|
|
17766
17943
|
this.refreshData();
|
|
@@ -17773,7 +17950,7 @@
|
|
|
17773
17950
|
key: "setGroupHeader",
|
|
17774
17951
|
value: function setGroupHeader(values) {
|
|
17775
17952
|
this.table.options.groupHeader = values;
|
|
17776
|
-
this.
|
|
17953
|
+
this.configureGroupSetup();
|
|
17777
17954
|
|
|
17778
17955
|
if (this.table.options.groupBy) {
|
|
17779
17956
|
this.refreshData();
|
|
@@ -17856,7 +18033,7 @@
|
|
|
17856
18033
|
}, {
|
|
17857
18034
|
key: "getRows",
|
|
17858
18035
|
value: function getRows(rows) {
|
|
17859
|
-
if (this.groupIDLookups.length) {
|
|
18036
|
+
if (this.table.options.groupBy && this.groupIDLookups.length) {
|
|
17860
18037
|
this.dispatchExternal("dataGrouping");
|
|
17861
18038
|
this.generateGroups(rows);
|
|
17862
18039
|
|
|
@@ -18217,7 +18394,7 @@
|
|
|
18217
18394
|
}
|
|
18218
18395
|
}
|
|
18219
18396
|
|
|
18220
|
-
this.
|
|
18397
|
+
this.action("rowDelete", row, {
|
|
18221
18398
|
data: row.getData(),
|
|
18222
18399
|
pos: !index,
|
|
18223
18400
|
index: index
|
|
@@ -18372,7 +18549,7 @@
|
|
|
18372
18549
|
data = [];
|
|
18373
18550
|
this.hasIndex = false;
|
|
18374
18551
|
this.dispatchExternal("htmlImporting");
|
|
18375
|
-
rows = rows ? rows.getElementsByTagName("tr") : []; //check for
|
|
18552
|
+
rows = rows ? rows.getElementsByTagName("tr") : []; //check for Tabulator inline options
|
|
18376
18553
|
|
|
18377
18554
|
this._extractOptions(element, options);
|
|
18378
18555
|
|
|
@@ -18412,7 +18589,7 @@
|
|
|
18412
18589
|
key: "_extractOptions",
|
|
18413
18590
|
value: function _extractOptions(element, options, defaultOptions) {
|
|
18414
18591
|
var attributes = element.attributes;
|
|
18415
|
-
var optionsArr = defaultOptions ? Object.
|
|
18592
|
+
var optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);
|
|
18416
18593
|
var optionsList = {};
|
|
18417
18594
|
optionsArr.forEach(function (item) {
|
|
18418
18595
|
optionsList[item.toLowerCase()] = item;
|
|
@@ -18480,12 +18657,10 @@
|
|
|
18480
18657
|
|
|
18481
18658
|
if (width && !col.width) {
|
|
18482
18659
|
col.width = width;
|
|
18483
|
-
} //check for
|
|
18484
|
-
|
|
18660
|
+
} //check for Tabulator inline options
|
|
18485
18661
|
|
|
18486
|
-
header.attributes; // //check for tablator inline options
|
|
18487
18662
|
|
|
18488
|
-
this._extractOptions(header, col,
|
|
18663
|
+
this._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);
|
|
18489
18664
|
|
|
18490
18665
|
this.fieldIndex[index] = col.field;
|
|
18491
18666
|
|
|
@@ -18833,7 +19008,7 @@
|
|
|
18833
19008
|
callback;
|
|
18834
19009
|
|
|
18835
19010
|
if (this.columnSubscribers[action]) {
|
|
18836
|
-
if (component instanceof Cell
|
|
19011
|
+
if (component instanceof Cell) {
|
|
18837
19012
|
callback = component.column.definition[action];
|
|
18838
19013
|
} else if (component instanceof Column$1) {
|
|
18839
19014
|
callback = component.definition[action];
|
|
@@ -19583,7 +19758,9 @@
|
|
|
19583
19758
|
}, {
|
|
19584
19759
|
key: "initialize",
|
|
19585
19760
|
value: function initialize() {
|
|
19586
|
-
|
|
19761
|
+
if (this.table.options.movableColumns) {
|
|
19762
|
+
this.subscribe("column-init", this.initializeColumn.bind(this));
|
|
19763
|
+
}
|
|
19587
19764
|
}
|
|
19588
19765
|
}, {
|
|
19589
19766
|
key: "initializeColumn",
|
|
@@ -19722,7 +19899,9 @@
|
|
|
19722
19899
|
}, {
|
|
19723
19900
|
key: "startMove",
|
|
19724
19901
|
value: function startMove(e, column) {
|
|
19725
|
-
var element = column.getElement()
|
|
19902
|
+
var element = column.getElement(),
|
|
19903
|
+
headerElement = this.table.columnManager.getElement(),
|
|
19904
|
+
headersElement = this.table.columnManager.getHeadersElement();
|
|
19726
19905
|
this.moving = column;
|
|
19727
19906
|
this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
|
|
19728
19907
|
this.table.element.classList.add("tabulator-block-select"); //create placeholder
|
|
@@ -19736,7 +19915,7 @@
|
|
|
19736
19915
|
this.hoverElement.classList.add("tabulator-moving");
|
|
19737
19916
|
this.table.columnManager.getElement().appendChild(this.hoverElement);
|
|
19738
19917
|
this.hoverElement.style.left = "0";
|
|
19739
|
-
this.hoverElement.style.bottom = "
|
|
19918
|
+
this.hoverElement.style.bottom = headerElement.clientHeight - headersElement.offsetHeight + "px";
|
|
19740
19919
|
|
|
19741
19920
|
if (!this.touchMove) {
|
|
19742
19921
|
this._bindMouseMove();
|
|
@@ -19776,7 +19955,7 @@
|
|
|
19776
19955
|
column.getCells().forEach(function (cell, i) {
|
|
19777
19956
|
var cellEl = cell.getElement(true);
|
|
19778
19957
|
|
|
19779
|
-
if (cellEl.parentNode) {
|
|
19958
|
+
if (cellEl.parentNode && movingCells[i]) {
|
|
19780
19959
|
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
|
|
19781
19960
|
}
|
|
19782
19961
|
});
|
|
@@ -19784,7 +19963,7 @@
|
|
|
19784
19963
|
column.getCells().forEach(function (cell, i) {
|
|
19785
19964
|
var cellEl = cell.getElement(true);
|
|
19786
19965
|
|
|
19787
|
-
if (cellEl.parentNode) {
|
|
19966
|
+
if (cellEl.parentNode && movingCells[i]) {
|
|
19788
19967
|
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
|
|
19789
19968
|
}
|
|
19790
19969
|
});
|
|
@@ -20682,9 +20861,6 @@
|
|
|
20682
20861
|
_this.dataChanging = false; //flag to check if data is being changed by this module
|
|
20683
20862
|
|
|
20684
20863
|
_this.pageSizes = [];
|
|
20685
|
-
_this.dataReceivedNames = {}; //TODO - remove once pagimation update is complete
|
|
20686
|
-
|
|
20687
|
-
_this.dataSentNames = {}; //TODO - remove once pagimation update is complete
|
|
20688
20864
|
|
|
20689
20865
|
_this.registerTableOption("pagination", false); //set pagination type
|
|
20690
20866
|
|
|
@@ -20695,7 +20871,7 @@
|
|
|
20695
20871
|
_this.registerTableOption("paginationSize", false); //set number of rows to a page
|
|
20696
20872
|
|
|
20697
20873
|
|
|
20698
|
-
_this.registerTableOption("paginationInitialPage", 1); //
|
|
20874
|
+
_this.registerTableOption("paginationInitialPage", 1); //initial page to show on load
|
|
20699
20875
|
|
|
20700
20876
|
|
|
20701
20877
|
_this.registerTableOption("paginationButtonCount", 5); // set count of page button
|
|
@@ -20772,6 +20948,7 @@
|
|
|
20772
20948
|
this.subscribe("data-params", this.remotePageParams.bind(this));
|
|
20773
20949
|
this.subscribe("data-loaded", this._parseRemoteData.bind(this));
|
|
20774
20950
|
this.subscribe("table-built", this.calculatePageSizes.bind(this));
|
|
20951
|
+
this.subscribe("data-processed", this.initialLoadComplete.bind(this));
|
|
20775
20952
|
this.initializeProgressive(this.table.options.progressiveLoad);
|
|
20776
20953
|
|
|
20777
20954
|
if (this.table.options.progressiveLoad === "scroll") {
|
|
@@ -20892,7 +21069,7 @@
|
|
|
20892
21069
|
margin = this.table.options.progressiveLoadScrollMargin || element.clientHeight * 2;
|
|
20893
21070
|
|
|
20894
21071
|
if (diff < margin) {
|
|
20895
|
-
this.nextPage();
|
|
21072
|
+
this.nextPage()["catch"](function () {}); //consume the exception thrown when on the last page
|
|
20896
21073
|
}
|
|
20897
21074
|
}
|
|
20898
21075
|
}
|
|
@@ -21132,7 +21309,7 @@
|
|
|
21132
21309
|
this.page = 1;
|
|
21133
21310
|
}
|
|
21134
21311
|
}
|
|
21135
|
-
} //set the
|
|
21312
|
+
} //set the maximum page
|
|
21136
21313
|
|
|
21137
21314
|
}, {
|
|
21138
21315
|
key: "setMaxPage",
|
|
@@ -21390,7 +21567,7 @@
|
|
|
21390
21567
|
var data, margin;
|
|
21391
21568
|
|
|
21392
21569
|
if (typeof data.last_page === "undefined") {
|
|
21393
|
-
console.warn("Remote Pagination Error - Server response missing '" + this.
|
|
21570
|
+
console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").last_page || "last_page") + "' property");
|
|
21394
21571
|
}
|
|
21395
21572
|
|
|
21396
21573
|
if (data.data) {
|
|
@@ -21414,7 +21591,7 @@
|
|
|
21414
21591
|
break;
|
|
21415
21592
|
|
|
21416
21593
|
case "progressive_scroll":
|
|
21417
|
-
data = this.table.rowManager.getData().concat(data.data);
|
|
21594
|
+
data = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);
|
|
21418
21595
|
this.table.rowManager.setData(data, this.page !== 1, this.page == 1);
|
|
21419
21596
|
margin = this.table.options.progressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2;
|
|
21420
21597
|
|
|
@@ -21434,7 +21611,7 @@
|
|
|
21434
21611
|
// this.table.columnManager.scrollHorizontal(left);
|
|
21435
21612
|
}
|
|
21436
21613
|
} else {
|
|
21437
|
-
console.warn("Remote Pagination Error - Server response missing '" + this.
|
|
21614
|
+
console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").data || "data") + "' property");
|
|
21438
21615
|
}
|
|
21439
21616
|
|
|
21440
21617
|
return data.data;
|
|
@@ -22924,7 +23101,7 @@
|
|
|
22924
23101
|
_this.registerColumnOption("responsive");
|
|
22925
23102
|
|
|
22926
23103
|
return _this;
|
|
22927
|
-
} //generate
|
|
23104
|
+
} //generate responsive columns list
|
|
22928
23105
|
|
|
22929
23106
|
|
|
22930
23107
|
_createClass(ResponsiveLayout, [{
|
|
@@ -22963,7 +23140,7 @@
|
|
|
22963
23140
|
this.mode = this.table.options.responsiveLayout;
|
|
22964
23141
|
this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;
|
|
22965
23142
|
this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;
|
|
22966
|
-
this.hiddenColumns = []; //
|
|
23143
|
+
this.hiddenColumns = []; //determine level of responsivity for each column
|
|
22967
23144
|
|
|
22968
23145
|
this.table.columnManager.columnsByIndex.forEach(function (column, i) {
|
|
22969
23146
|
if (column.modules.responsive) {
|
|
@@ -23060,9 +23237,8 @@
|
|
|
23060
23237
|
value: function updateColumnVisibility(column, responsiveToggle) {
|
|
23061
23238
|
if (!responsiveToggle && column.modules.responsive) {
|
|
23062
23239
|
column.modules.responsive.visible = column.visible;
|
|
23063
|
-
this.
|
|
23064
|
-
}
|
|
23065
|
-
|
|
23240
|
+
this.initializeResponsivity();
|
|
23241
|
+
}
|
|
23066
23242
|
}
|
|
23067
23243
|
}, {
|
|
23068
23244
|
key: "hideColumn",
|
|
@@ -23329,9 +23505,9 @@
|
|
|
23329
23505
|
this.subscribe("row-init", this.initializeRow.bind(this));
|
|
23330
23506
|
this.subscribe("row-deleting", this.rowDeleted.bind(this));
|
|
23331
23507
|
this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
|
|
23332
|
-
this.subscribe("rows-retrieve", this.
|
|
23508
|
+
this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
|
|
23333
23509
|
|
|
23334
|
-
if (this.table.options.selectable && this.table.options.selectablePersistence) {
|
|
23510
|
+
if (this.table.options.selectable && !this.table.options.selectablePersistence) {
|
|
23335
23511
|
this.subscribe("data-refeshing", this.deselectRows.bind(this));
|
|
23336
23512
|
}
|
|
23337
23513
|
}
|
|
@@ -23571,9 +23747,7 @@
|
|
|
23571
23747
|
this.childRowSelection(row, true);
|
|
23572
23748
|
}
|
|
23573
23749
|
|
|
23574
|
-
|
|
23575
|
-
this.dispatchExternal("rowSelected", row.getComponent());
|
|
23576
|
-
}
|
|
23750
|
+
this.dispatchExternal("rowSelected", row.getComponent());
|
|
23577
23751
|
|
|
23578
23752
|
this._rowSelectionChanged(silent);
|
|
23579
23753
|
}
|
|
@@ -23647,9 +23821,7 @@
|
|
|
23647
23821
|
this.childRowSelection(row, false);
|
|
23648
23822
|
}
|
|
23649
23823
|
|
|
23650
|
-
|
|
23651
|
-
this.dispatchExternal("rowDeselected", row.getComponent());
|
|
23652
|
-
}
|
|
23824
|
+
this.dispatchExternal("rowDeselected", row.getComponent());
|
|
23653
23825
|
|
|
23654
23826
|
self._rowSelectionChanged(silent);
|
|
23655
23827
|
}
|
|
@@ -23838,8 +24010,8 @@
|
|
|
23838
24010
|
emptyAlign = 0;
|
|
23839
24011
|
|
|
23840
24012
|
if (typeof DT != "undefined") {
|
|
23841
|
-
a = DT.fromFormat(a, format);
|
|
23842
|
-
b = DT.fromFormat(b, format);
|
|
24013
|
+
a = DT.fromFormat(String(a), format);
|
|
24014
|
+
b = DT.fromFormat(String(b), format);
|
|
23843
24015
|
|
|
23844
24016
|
if (!a.isValid) {
|
|
23845
24017
|
emptyAlign = !b.isValid ? 0 : -1;
|
|
@@ -24227,7 +24399,7 @@
|
|
|
24227
24399
|
if (this.table.options.sortMode === "remote") {
|
|
24228
24400
|
this.reloadData();
|
|
24229
24401
|
} else {
|
|
24230
|
-
this.refreshData();
|
|
24402
|
+
this.refreshData(true);
|
|
24231
24403
|
} //TODO - Persist left position of row manager
|
|
24232
24404
|
// left = this.scrollLeft;
|
|
24233
24405
|
// this.scrollHorizontal(left);
|