tabulator-tables 5.0.5 → 5.0.9
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 +412 -256
- 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 +501 -351
- 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 +1 -1
- package/src/js/core/defaults/options.js +1 -1
- package/src/js/core/rendering/Renderer.js +2 -1
- 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 +1 -1
- package/src/js/core/tools/InteractionMonitor.js +126 -49
- 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 +1 -8
- 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/Format/defaults/formatters/money.js +8 -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 +5 -7
- package/src/js/modules/MoveColumns/MoveColumns.js +64 -61
- package/src/js/modules/Page/Page.js +8 -10
- 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.9 (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) {
|
|
@@ -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, [{
|
|
@@ -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
|
}
|
|
@@ -2988,7 +2987,7 @@
|
|
|
2988
2987
|
_this.columnsByField = {}; //columns by field
|
|
2989
2988
|
|
|
2990
2989
|
_this.scrollLeft = 0;
|
|
2991
|
-
_this.optionsList = new OptionsList(_this.table, "column definition");
|
|
2990
|
+
_this.optionsList = new OptionsList(_this.table, "column definition", defaultColumnOptions);
|
|
2992
2991
|
_this.renderer = null;
|
|
2993
2992
|
return _this;
|
|
2994
2993
|
} ////////////// Setup Functions /////////////////
|
|
@@ -3198,8 +3197,9 @@
|
|
|
3198
3197
|
index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;
|
|
3199
3198
|
|
|
3200
3199
|
if (nextToColumn && index > -1) {
|
|
3201
|
-
var
|
|
3202
|
-
var
|
|
3200
|
+
var topColumn = nextToColumn.getTopColumn();
|
|
3201
|
+
var parentIndex = this.columns.indexOf(topColumn);
|
|
3202
|
+
var nextEl = topColumn.getElement();
|
|
3203
3203
|
|
|
3204
3204
|
if (before) {
|
|
3205
3205
|
this.columns.splice(parentIndex, 0, column);
|
|
@@ -3314,8 +3314,8 @@
|
|
|
3314
3314
|
return this.columnsByIndex[index];
|
|
3315
3315
|
}
|
|
3316
3316
|
}, {
|
|
3317
|
-
key: "
|
|
3318
|
-
value: function
|
|
3317
|
+
key: "getFirstVisibleColumn",
|
|
3318
|
+
value: function getFirstVisibleColumn(index) {
|
|
3319
3319
|
var index = this.columnsByIndex.findIndex(function (col) {
|
|
3320
3320
|
return col.visible;
|
|
3321
3321
|
});
|
|
@@ -3565,13 +3565,11 @@
|
|
|
3565
3565
|
|
|
3566
3566
|
_this6.dispatch("column-add", definition, before, nextToColumn);
|
|
3567
3567
|
|
|
3568
|
-
_this6.redraw(true);
|
|
3569
|
-
|
|
3570
3568
|
if (_this6.layoutMode() != "fitColumns") {
|
|
3571
3569
|
column.reinitializeWidth();
|
|
3572
3570
|
}
|
|
3573
3571
|
|
|
3574
|
-
_this6.
|
|
3572
|
+
_this6.redraw(true);
|
|
3575
3573
|
|
|
3576
3574
|
_this6.table.rowManager.reinitialize();
|
|
3577
3575
|
|
|
@@ -3747,7 +3745,7 @@
|
|
|
3747
3745
|
return RowComponent;
|
|
3748
3746
|
}();
|
|
3749
3747
|
|
|
3750
|
-
var Row
|
|
3748
|
+
var Row = /*#__PURE__*/function (_CoreFeature) {
|
|
3751
3749
|
_inherits(Row, _CoreFeature);
|
|
3752
3750
|
|
|
3753
3751
|
var _super = _createSuper(Row);
|
|
@@ -4349,8 +4347,8 @@
|
|
|
4349
4347
|
}
|
|
4350
4348
|
|
|
4351
4349
|
element.style.paddingTop = "";
|
|
4352
|
-
element.style.paddingBottom = "";
|
|
4353
|
-
|
|
4350
|
+
element.style.paddingBottom = ""; // element.style.minWidth = "";
|
|
4351
|
+
|
|
4354
4352
|
element.style.minHeight = "";
|
|
4355
4353
|
element.style.display = "";
|
|
4356
4354
|
element.style.visibility = "";
|
|
@@ -5033,7 +5031,7 @@
|
|
|
5033
5031
|
var _this3 = this;
|
|
5034
5032
|
|
|
5035
5033
|
if (_typeof(subject) == "object") {
|
|
5036
|
-
if (subject instanceof Row
|
|
5034
|
+
if (subject instanceof Row) {
|
|
5037
5035
|
//subject is row element
|
|
5038
5036
|
return subject;
|
|
5039
5037
|
} else if (subject instanceof RowComponent$1) {
|
|
@@ -5123,7 +5121,7 @@
|
|
|
5123
5121
|
this.dispatch("data-processing", data);
|
|
5124
5122
|
data.forEach(function (def, i) {
|
|
5125
5123
|
if (def && _typeof(def) === "object") {
|
|
5126
|
-
var row = new Row
|
|
5124
|
+
var row = new Row(def, _this5);
|
|
5127
5125
|
|
|
5128
5126
|
_this5.rows.push(row);
|
|
5129
5127
|
} else {
|
|
@@ -5256,7 +5254,7 @@
|
|
|
5256
5254
|
}, {
|
|
5257
5255
|
key: "addRowActual",
|
|
5258
5256
|
value: function addRowActual(data, pos, index, blockRedraw) {
|
|
5259
|
-
var row = data instanceof Row
|
|
5257
|
+
var row = data instanceof Row ? data : new Row(data || {}, this),
|
|
5260
5258
|
top = this.findAddRowPos(pos),
|
|
5261
5259
|
allIndex = -1,
|
|
5262
5260
|
activeIndex,
|
|
@@ -5408,7 +5406,7 @@
|
|
|
5408
5406
|
nextRow = this.getDisplayRows()[index + 1];
|
|
5409
5407
|
}
|
|
5410
5408
|
|
|
5411
|
-
if (nextRow && (!(nextRow instanceof Row
|
|
5409
|
+
if (nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")) {
|
|
5412
5410
|
return this.nextDisplayRow(nextRow, rowOnly);
|
|
5413
5411
|
}
|
|
5414
5412
|
|
|
@@ -5424,7 +5422,7 @@
|
|
|
5424
5422
|
prevRow = this.getDisplayRows()[index - 1];
|
|
5425
5423
|
}
|
|
5426
5424
|
|
|
5427
|
-
if (rowOnly && prevRow && (!(prevRow instanceof Row
|
|
5425
|
+
if (rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")) {
|
|
5428
5426
|
return this.prevDisplayRow(prevRow, rowOnly);
|
|
5429
5427
|
}
|
|
5430
5428
|
|
|
@@ -5690,8 +5688,14 @@
|
|
|
5690
5688
|
}
|
|
5691
5689
|
}, {
|
|
5692
5690
|
key: "getVisibleRows",
|
|
5693
|
-
value: function getVisibleRows(viewable) {
|
|
5694
|
-
|
|
5691
|
+
value: function getVisibleRows(chain, viewable) {
|
|
5692
|
+
var rows = Object.assign([], this.renderer.visibleRows(!viewable));
|
|
5693
|
+
|
|
5694
|
+
if (chain) {
|
|
5695
|
+
rows = this.chain("rows-visible", [viewable], rows, rows);
|
|
5696
|
+
}
|
|
5697
|
+
|
|
5698
|
+
return rows;
|
|
5695
5699
|
} //repeat action accross display rows
|
|
5696
5700
|
|
|
5697
5701
|
}, {
|
|
@@ -6096,7 +6100,7 @@
|
|
|
6096
6100
|
_classCallCheck(this, InteractionManager);
|
|
6097
6101
|
|
|
6098
6102
|
_this = _super.call(this, table);
|
|
6099
|
-
_this.el =
|
|
6103
|
+
_this.el = null;
|
|
6100
6104
|
_this.abortClasses = ["tabulator-headers", "tabulator-table"];
|
|
6101
6105
|
_this.previousTargets = {};
|
|
6102
6106
|
_this.listeners = ["click", "dblclick", "contextmenu", "mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove", "touchstart", "touchend"];
|
|
@@ -6106,15 +6110,24 @@
|
|
|
6106
6110
|
"tabulator-group": "group",
|
|
6107
6111
|
"tabulator-col": "column"
|
|
6108
6112
|
};
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6113
|
+
_this.pseudoTrackers = {
|
|
6114
|
+
"row": null,
|
|
6115
|
+
"cell": null,
|
|
6116
|
+
"group": null,
|
|
6117
|
+
"column": null
|
|
6118
|
+
};
|
|
6114
6119
|
return _this;
|
|
6115
6120
|
}
|
|
6116
6121
|
|
|
6117
6122
|
_createClass(InteractionManager, [{
|
|
6123
|
+
key: "initialize",
|
|
6124
|
+
value: function initialize() {
|
|
6125
|
+
this.el = this.table.element;
|
|
6126
|
+
this.buildListenerMap();
|
|
6127
|
+
this.bindSubscriptionWatchers();
|
|
6128
|
+
this.bindPseudoEvents();
|
|
6129
|
+
}
|
|
6130
|
+
}, {
|
|
6118
6131
|
key: "buildListenerMap",
|
|
6119
6132
|
value: function buildListenerMap() {
|
|
6120
6133
|
var listenerMap = {};
|
|
@@ -6126,6 +6139,53 @@
|
|
|
6126
6139
|
});
|
|
6127
6140
|
this.listeners = listenerMap;
|
|
6128
6141
|
}
|
|
6142
|
+
}, {
|
|
6143
|
+
key: "bindPseudoEvents",
|
|
6144
|
+
value: function bindPseudoEvents() {
|
|
6145
|
+
var _this2 = this;
|
|
6146
|
+
|
|
6147
|
+
Object.keys(this.pseudoTrackers).forEach(function (key) {
|
|
6148
|
+
_this2.subscribe(key + "-mouseover", _this2.pseudoMouseEnter.bind(_this2, key)); // this.subscribe(key + "-mouseout", this.pseudoMouseLeave.bind(this, key));
|
|
6149
|
+
|
|
6150
|
+
});
|
|
6151
|
+
}
|
|
6152
|
+
}, {
|
|
6153
|
+
key: "pseudoMouseEnter",
|
|
6154
|
+
value: function pseudoMouseEnter(key, e, target) {
|
|
6155
|
+
if (this.pseudoTrackers[key] !== target) {
|
|
6156
|
+
if (this.pseudoTrackers[key]) {
|
|
6157
|
+
this.dispatch(key + "-mouseleave", e, target);
|
|
6158
|
+
}
|
|
6159
|
+
|
|
6160
|
+
this.pseudoMouseLeave(key, e);
|
|
6161
|
+
this.pseudoTrackers[key] = target;
|
|
6162
|
+
this.dispatch(key + "-mouseenter", e, target);
|
|
6163
|
+
}
|
|
6164
|
+
}
|
|
6165
|
+
}, {
|
|
6166
|
+
key: "pseudoMouseLeave",
|
|
6167
|
+
value: function pseudoMouseLeave(key, e) {
|
|
6168
|
+
var _this3 = this;
|
|
6169
|
+
|
|
6170
|
+
var leaveList = Object.keys(this.pseudoTrackers),
|
|
6171
|
+
linkedKeys = {
|
|
6172
|
+
"row": ["cell"],
|
|
6173
|
+
"cell": ["row"]
|
|
6174
|
+
};
|
|
6175
|
+
leaveList = leaveList.filter(function (item) {
|
|
6176
|
+
var links = linkedKeys[key];
|
|
6177
|
+
return item !== key && (!links || links && !links.includes(item));
|
|
6178
|
+
});
|
|
6179
|
+
leaveList.forEach(function (key) {
|
|
6180
|
+
var target = _this3.pseudoTrackers[key];
|
|
6181
|
+
|
|
6182
|
+
if (_this3.pseudoTrackers[key]) {
|
|
6183
|
+
_this3.dispatch(key + "-mouseleave", e, target);
|
|
6184
|
+
|
|
6185
|
+
_this3.pseudoTrackers[key] = null;
|
|
6186
|
+
}
|
|
6187
|
+
});
|
|
6188
|
+
}
|
|
6129
6189
|
}, {
|
|
6130
6190
|
key: "bindSubscriptionWatchers",
|
|
6131
6191
|
value: function bindSubscriptionWatchers() {
|
|
@@ -6150,6 +6210,8 @@
|
|
|
6150
6210
|
_iterator.f();
|
|
6151
6211
|
}
|
|
6152
6212
|
}
|
|
6213
|
+
|
|
6214
|
+
this.subscribe("table-destroy", this.clearWatchers.bind(this));
|
|
6153
6215
|
}
|
|
6154
6216
|
}, {
|
|
6155
6217
|
key: "subscriptionChanged",
|
|
@@ -6202,11 +6264,15 @@
|
|
|
6202
6264
|
var targets = this.findTargets(path);
|
|
6203
6265
|
targets = this.bindComponents(type, targets);
|
|
6204
6266
|
this.triggerEvents(type, e, targets);
|
|
6267
|
+
|
|
6268
|
+
if ((type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length) {
|
|
6269
|
+
this.pseudoMouseLeave("none", e);
|
|
6270
|
+
}
|
|
6205
6271
|
}
|
|
6206
6272
|
}, {
|
|
6207
6273
|
key: "findTargets",
|
|
6208
6274
|
value: function findTargets(path) {
|
|
6209
|
-
var
|
|
6275
|
+
var _this4 = this;
|
|
6210
6276
|
|
|
6211
6277
|
var targets = {};
|
|
6212
6278
|
var componentMap = Object.keys(this.componentMap);
|
|
@@ -6219,7 +6285,7 @@
|
|
|
6219
6285
|
var el = _step2.value;
|
|
6220
6286
|
var classList = el.classList ? _toConsumableArray(el.classList) : [];
|
|
6221
6287
|
var abort = classList.filter(function (item) {
|
|
6222
|
-
return
|
|
6288
|
+
return _this4.abortClasses.includes(item);
|
|
6223
6289
|
});
|
|
6224
6290
|
|
|
6225
6291
|
if (abort.length) {
|
|
@@ -6259,7 +6325,7 @@
|
|
|
6259
6325
|
}, {
|
|
6260
6326
|
key: "bindComponents",
|
|
6261
6327
|
value: function bindComponents(type, targets) {
|
|
6262
|
-
var
|
|
6328
|
+
var _this5 = this;
|
|
6263
6329
|
|
|
6264
6330
|
//ensure row component is looked up before cell
|
|
6265
6331
|
var keys = Object.keys(targets).reverse(),
|
|
@@ -6274,7 +6340,7 @@
|
|
|
6274
6340
|
var key = _step4.value;
|
|
6275
6341
|
var component = void 0;
|
|
6276
6342
|
var target = targets[key];
|
|
6277
|
-
var previousTarget =
|
|
6343
|
+
var previousTarget = _this5.previousTargets[key];
|
|
6278
6344
|
|
|
6279
6345
|
if (previousTarget && previousTarget.target === target) {
|
|
6280
6346
|
component = previousTarget.component;
|
|
@@ -6283,7 +6349,7 @@
|
|
|
6283
6349
|
case "row":
|
|
6284
6350
|
case "group":
|
|
6285
6351
|
if (listener.components.includes("row") || listener.components.includes("cell")) {
|
|
6286
|
-
var rows =
|
|
6352
|
+
var rows = _this5.table.rowManager.getVisibleRows(true);
|
|
6287
6353
|
|
|
6288
6354
|
component = rows.find(function (row) {
|
|
6289
6355
|
return row.getElement() === target;
|
|
@@ -6294,7 +6360,7 @@
|
|
|
6294
6360
|
|
|
6295
6361
|
case "column":
|
|
6296
6362
|
if (listener.components.includes("column")) {
|
|
6297
|
-
component =
|
|
6363
|
+
component = _this5.table.columnManager.findColumn(target);
|
|
6298
6364
|
}
|
|
6299
6365
|
|
|
6300
6366
|
break;
|
|
@@ -6340,20 +6406,32 @@
|
|
|
6340
6406
|
}
|
|
6341
6407
|
}
|
|
6342
6408
|
}
|
|
6409
|
+
}, {
|
|
6410
|
+
key: "clearWatchers",
|
|
6411
|
+
value: function clearWatchers() {
|
|
6412
|
+
for (var key in this.listeners) {
|
|
6413
|
+
var listener = this.listeners[key];
|
|
6414
|
+
|
|
6415
|
+
if (listener.handler) {
|
|
6416
|
+
this.el.removeEventListener(key, listener.handler);
|
|
6417
|
+
listener.handler = null;
|
|
6418
|
+
}
|
|
6419
|
+
}
|
|
6420
|
+
}
|
|
6343
6421
|
}]);
|
|
6344
6422
|
|
|
6345
6423
|
return InteractionManager;
|
|
6346
6424
|
}(CoreFeature);
|
|
6347
6425
|
|
|
6348
|
-
var
|
|
6349
|
-
function
|
|
6350
|
-
_classCallCheck(this,
|
|
6426
|
+
var ComponentFunctionBinder = /*#__PURE__*/function () {
|
|
6427
|
+
function ComponentFunctionBinder(table) {
|
|
6428
|
+
_classCallCheck(this, ComponentFunctionBinder);
|
|
6351
6429
|
|
|
6352
6430
|
this.table = table;
|
|
6353
6431
|
this.bindings = {};
|
|
6354
6432
|
}
|
|
6355
6433
|
|
|
6356
|
-
_createClass(
|
|
6434
|
+
_createClass(ComponentFunctionBinder, [{
|
|
6357
6435
|
key: "bind",
|
|
6358
6436
|
value: function bind(type, funcName, handler) {
|
|
6359
6437
|
if (!this.bindings[type]) {
|
|
@@ -6379,7 +6457,7 @@
|
|
|
6379
6457
|
}
|
|
6380
6458
|
}]);
|
|
6381
6459
|
|
|
6382
|
-
return
|
|
6460
|
+
return ComponentFunctionBinder;
|
|
6383
6461
|
}();
|
|
6384
6462
|
|
|
6385
6463
|
var DataLoader = /*#__PURE__*/function (_CoreFeature) {
|
|
@@ -6466,7 +6544,7 @@
|
|
|
6466
6544
|
} //get params for request
|
|
6467
6545
|
|
|
6468
6546
|
|
|
6469
|
-
|
|
6547
|
+
params = this.chain("data-params", [data, config, silent], params || {}, params || {});
|
|
6470
6548
|
params = this.mapParams(params, this.table.options.dataSendParams);
|
|
6471
6549
|
var result = this.chain("data-load", [data, params, config, silent], Promise.resolve([]));
|
|
6472
6550
|
return result.then(function (response) {
|
|
@@ -7786,13 +7864,13 @@
|
|
|
7786
7864
|
|
|
7787
7865
|
this.browserSlow = false; //handle reduced functionality for slower browsers
|
|
7788
7866
|
|
|
7789
|
-
this.browserMobile = false; //check if running on
|
|
7867
|
+
this.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance
|
|
7790
7868
|
|
|
7791
7869
|
this.rtl = false; //check if the table is in RTL mode
|
|
7792
7870
|
|
|
7793
7871
|
this.originalElement = null; //hold original table element if it has been replaced
|
|
7794
7872
|
|
|
7795
|
-
this.componentFunctionBinder = new
|
|
7873
|
+
this.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions
|
|
7796
7874
|
|
|
7797
7875
|
this.dataLoader = false; //bind component functions
|
|
7798
7876
|
|
|
@@ -7806,14 +7884,14 @@
|
|
|
7806
7884
|
this.initialized = false;
|
|
7807
7885
|
|
|
7808
7886
|
if (this.initializeElement(element)) {
|
|
7809
|
-
this.initialzeCoreSystems(options); //delay table creation to allow event bindings
|
|
7887
|
+
this.initialzeCoreSystems(options); //delay table creation to allow event bindings immediately after the constructor
|
|
7810
7888
|
|
|
7811
7889
|
setTimeout(function () {
|
|
7812
7890
|
_this._create();
|
|
7813
7891
|
});
|
|
7814
7892
|
}
|
|
7815
7893
|
|
|
7816
|
-
TableRegistry.register(this); //register table for
|
|
7894
|
+
TableRegistry.register(this); //register table for inter-device communication
|
|
7817
7895
|
}
|
|
7818
7896
|
|
|
7819
7897
|
_createClass(Tabulator, [{
|
|
@@ -7848,7 +7926,7 @@
|
|
|
7848
7926
|
|
|
7849
7927
|
this._clearObjectPointers();
|
|
7850
7928
|
|
|
7851
|
-
this.
|
|
7929
|
+
this._mapDeprecatedFunctionality();
|
|
7852
7930
|
|
|
7853
7931
|
this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
|
|
7854
7932
|
this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
|
|
@@ -7857,11 +7935,11 @@
|
|
|
7857
7935
|
this.columnManager.initialize();
|
|
7858
7936
|
this.rowManager.initialize();
|
|
7859
7937
|
this.footerManager.initialize();
|
|
7860
|
-
} //convert
|
|
7938
|
+
} //convert deprecated functionality to new functions
|
|
7861
7939
|
|
|
7862
7940
|
}, {
|
|
7863
|
-
key: "
|
|
7864
|
-
value: function
|
|
7941
|
+
key: "_mapDeprecatedFunctionality",
|
|
7942
|
+
value: function _mapDeprecatedFunctionality() {//all previously deprecated functionality removed in the 5.0 release
|
|
7865
7943
|
}
|
|
7866
7944
|
}, {
|
|
7867
7945
|
key: "_clearSelection",
|
|
@@ -7882,7 +7960,7 @@
|
|
|
7882
7960
|
}
|
|
7883
7961
|
|
|
7884
7962
|
this.element.classList.remove("tabulator-block-select");
|
|
7885
|
-
} //
|
|
7963
|
+
} //create table
|
|
7886
7964
|
|
|
7887
7965
|
}, {
|
|
7888
7966
|
key: "_create",
|
|
@@ -7990,6 +8068,7 @@
|
|
|
7990
8068
|
value: function _initializeTable() {
|
|
7991
8069
|
var element = this.element,
|
|
7992
8070
|
options = this.options;
|
|
8071
|
+
this.interactionMonitor.initialize();
|
|
7993
8072
|
this.columnManager.initialize();
|
|
7994
8073
|
this.rowManager.initialize();
|
|
7995
8074
|
|
|
@@ -8043,7 +8122,7 @@
|
|
|
8043
8122
|
key: "destroy",
|
|
8044
8123
|
value: function destroy() {
|
|
8045
8124
|
var element = this.element;
|
|
8046
|
-
TableRegistry.deregister(this); //deregister table from
|
|
8125
|
+
TableRegistry.deregister(this); //deregister table from inter-device communication
|
|
8047
8126
|
|
|
8048
8127
|
this.eventBus.dispatch("table-destroy"); //clear row data
|
|
8049
8128
|
|
|
@@ -8167,7 +8246,11 @@
|
|
|
8167
8246
|
}, {
|
|
8168
8247
|
key: "replaceData",
|
|
8169
8248
|
value: function replaceData(data, params, config) {
|
|
8170
|
-
|
|
8249
|
+
if (this.initialized) {
|
|
8250
|
+
return this.dataLoader.load(data, params, config, true, true);
|
|
8251
|
+
} else {
|
|
8252
|
+
console.warn("replaceData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8253
|
+
}
|
|
8171
8254
|
} //update table data
|
|
8172
8255
|
|
|
8173
8256
|
}, {
|
|
@@ -8176,59 +8259,68 @@
|
|
|
8176
8259
|
var _this3 = this;
|
|
8177
8260
|
|
|
8178
8261
|
var responses = 0;
|
|
8179
|
-
return new Promise(function (resolve, reject) {
|
|
8180
|
-
_this3.dataLoader.blockActiveLoad();
|
|
8181
8262
|
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8263
|
+
if (this.initialized) {
|
|
8264
|
+
return new Promise(function (resolve, reject) {
|
|
8265
|
+
_this3.dataLoader.blockActiveLoad();
|
|
8185
8266
|
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8267
|
+
if (typeof data === "string") {
|
|
8268
|
+
data = JSON.parse(data);
|
|
8269
|
+
}
|
|
8189
8270
|
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
row.
|
|
8193
|
-
responses--;
|
|
8271
|
+
if (data) {
|
|
8272
|
+
data.forEach(function (item) {
|
|
8273
|
+
var row = _this3.rowManager.findRow(item[_this3.options.index]);
|
|
8194
8274
|
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8275
|
+
if (row) {
|
|
8276
|
+
responses++;
|
|
8277
|
+
row.updateData(item).then(function () {
|
|
8278
|
+
responses--;
|
|
8279
|
+
|
|
8280
|
+
if (!responses) {
|
|
8281
|
+
resolve();
|
|
8282
|
+
}
|
|
8283
|
+
});
|
|
8284
|
+
}
|
|
8285
|
+
});
|
|
8286
|
+
} else {
|
|
8287
|
+
console.warn("Update Error - No data provided");
|
|
8288
|
+
reject("Update Error - No data provided");
|
|
8289
|
+
}
|
|
8290
|
+
});
|
|
8291
|
+
} else {
|
|
8292
|
+
console.warn("updateData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8293
|
+
}
|
|
8206
8294
|
}
|
|
8207
8295
|
}, {
|
|
8208
8296
|
key: "addData",
|
|
8209
8297
|
value: function addData(data, pos, index) {
|
|
8210
8298
|
var _this4 = this;
|
|
8211
8299
|
|
|
8212
|
-
|
|
8213
|
-
|
|
8300
|
+
if (this.initialized) {
|
|
8301
|
+
return new Promise(function (resolve, reject) {
|
|
8302
|
+
_this4.dataLoader.blockActiveLoad();
|
|
8214
8303
|
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8304
|
+
if (typeof data === "string") {
|
|
8305
|
+
data = JSON.parse(data);
|
|
8306
|
+
}
|
|
8218
8307
|
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8308
|
+
if (data) {
|
|
8309
|
+
_this4.rowManager.addRows(data, pos, index).then(function (rows) {
|
|
8310
|
+
var output = [];
|
|
8311
|
+
rows.forEach(function (row) {
|
|
8312
|
+
output.push(row.getComponent());
|
|
8313
|
+
});
|
|
8314
|
+
resolve(output);
|
|
8224
8315
|
});
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8316
|
+
} else {
|
|
8317
|
+
console.warn("Update Error - No data provided");
|
|
8318
|
+
reject("Update Error - No data provided");
|
|
8319
|
+
}
|
|
8320
|
+
});
|
|
8321
|
+
} else {
|
|
8322
|
+
console.warn("addData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8323
|
+
}
|
|
8232
8324
|
} //update table data
|
|
8233
8325
|
|
|
8234
8326
|
}, {
|
|
@@ -8238,44 +8330,49 @@
|
|
|
8238
8330
|
|
|
8239
8331
|
var rows = [],
|
|
8240
8332
|
responses = 0;
|
|
8241
|
-
return new Promise(function (resolve, reject) {
|
|
8242
|
-
_this5.dataLoader.blockActiveLoad();
|
|
8243
8333
|
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8334
|
+
if (this.initialized) {
|
|
8335
|
+
return new Promise(function (resolve, reject) {
|
|
8336
|
+
_this5.dataLoader.blockActiveLoad();
|
|
8247
8337
|
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8338
|
+
if (typeof data === "string") {
|
|
8339
|
+
data = JSON.parse(data);
|
|
8340
|
+
}
|
|
8251
8341
|
|
|
8252
|
-
|
|
8342
|
+
if (data) {
|
|
8343
|
+
data.forEach(function (item) {
|
|
8344
|
+
var row = _this5.rowManager.findRow(item[_this5.options.index]);
|
|
8253
8345
|
|
|
8254
|
-
|
|
8255
|
-
row.updateData(item).then(function () {
|
|
8256
|
-
responses--;
|
|
8257
|
-
rows.push(row.getComponent());
|
|
8346
|
+
responses++;
|
|
8258
8347
|
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
} else {
|
|
8264
|
-
_this5.rowManager.addRows(item).then(function (newRows) {
|
|
8265
|
-
responses--;
|
|
8266
|
-
rows.push(newRows[0].getComponent());
|
|
8348
|
+
if (row) {
|
|
8349
|
+
row.updateData(item).then(function () {
|
|
8350
|
+
responses--;
|
|
8351
|
+
rows.push(row.getComponent());
|
|
8267
8352
|
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8353
|
+
if (!responses) {
|
|
8354
|
+
resolve(rows);
|
|
8355
|
+
}
|
|
8356
|
+
});
|
|
8357
|
+
} else {
|
|
8358
|
+
_this5.rowManager.addRows(item).then(function (newRows) {
|
|
8359
|
+
responses--;
|
|
8360
|
+
rows.push(newRows[0].getComponent());
|
|
8361
|
+
|
|
8362
|
+
if (!responses) {
|
|
8363
|
+
resolve(rows);
|
|
8364
|
+
}
|
|
8365
|
+
});
|
|
8366
|
+
}
|
|
8367
|
+
});
|
|
8368
|
+
} else {
|
|
8369
|
+
console.warn("Update Error - No data provided");
|
|
8370
|
+
reject("Update Error - No data provided");
|
|
8371
|
+
}
|
|
8372
|
+
});
|
|
8373
|
+
} else {
|
|
8374
|
+
console.warn("updateOrAddData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8375
|
+
}
|
|
8279
8376
|
} //get row object
|
|
8280
8377
|
|
|
8281
8378
|
}, {
|
|
@@ -8353,13 +8450,17 @@
|
|
|
8353
8450
|
}, {
|
|
8354
8451
|
key: "addRow",
|
|
8355
8452
|
value: function addRow(data, pos, index) {
|
|
8356
|
-
if (
|
|
8357
|
-
data
|
|
8358
|
-
|
|
8453
|
+
if (this.initialized) {
|
|
8454
|
+
if (typeof data === "string") {
|
|
8455
|
+
data = JSON.parse(data);
|
|
8456
|
+
}
|
|
8359
8457
|
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8458
|
+
return this.rowManager.addRows(data, pos, index).then(function (rows) {
|
|
8459
|
+
return rows[0].getComponent();
|
|
8460
|
+
});
|
|
8461
|
+
} else {
|
|
8462
|
+
console.warn("addRow failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8463
|
+
}
|
|
8363
8464
|
} //update a row if it exitsts otherwise create it
|
|
8364
8465
|
|
|
8365
8466
|
}, {
|
|
@@ -8393,7 +8494,7 @@
|
|
|
8393
8494
|
|
|
8394
8495
|
if (row) {
|
|
8395
8496
|
return row.updateData(data).then(function () {
|
|
8396
|
-
resolve(row.getComponent());
|
|
8497
|
+
return Promise.resolve(row.getComponent());
|
|
8397
8498
|
});
|
|
8398
8499
|
} else {
|
|
8399
8500
|
console.warn("Update Error - No matching row found:", index);
|
|
@@ -8584,8 +8685,12 @@
|
|
|
8584
8685
|
}, {
|
|
8585
8686
|
key: "redraw",
|
|
8586
8687
|
value: function redraw(force) {
|
|
8587
|
-
this.
|
|
8588
|
-
|
|
8688
|
+
if (this.initialized) {
|
|
8689
|
+
this.columnManager.redraw(force);
|
|
8690
|
+
this.rowManager.redraw(force);
|
|
8691
|
+
} else {
|
|
8692
|
+
console.warn("redraw failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
8693
|
+
}
|
|
8589
8694
|
}
|
|
8590
8695
|
}, {
|
|
8591
8696
|
key: "setHeight",
|
|
@@ -9734,6 +9839,7 @@
|
|
|
9734
9839
|
this.subscribe("column-add", this.recalcActiveRows.bind(this));
|
|
9735
9840
|
this.subscribe("data-refeshed", this.recalcActiveRows.bind(this));
|
|
9736
9841
|
this.subscribe("table-redraw", this.tableRedraw.bind(this));
|
|
9842
|
+
this.subscribe("rows-visible", this.visibleRows.bind(this));
|
|
9737
9843
|
this.registerTableFunction("getCalcResults", this.getResults.bind(this));
|
|
9738
9844
|
this.registerTableFunction("recalc", this.userRecalc.bind(this));
|
|
9739
9845
|
}
|
|
@@ -9757,6 +9863,19 @@
|
|
|
9757
9863
|
///////// Internal Logic //////////
|
|
9758
9864
|
///////////////////////////////////
|
|
9759
9865
|
|
|
9866
|
+
}, {
|
|
9867
|
+
key: "visibleRows",
|
|
9868
|
+
value: function visibleRows(viewable, rows) {
|
|
9869
|
+
if (this.topRow) {
|
|
9870
|
+
rows.unshift(this.topRow);
|
|
9871
|
+
}
|
|
9872
|
+
|
|
9873
|
+
if (this.botRow) {
|
|
9874
|
+
rows.push(this.botRow);
|
|
9875
|
+
}
|
|
9876
|
+
|
|
9877
|
+
return rows;
|
|
9878
|
+
}
|
|
9760
9879
|
}, {
|
|
9761
9880
|
key: "rowsUpdated",
|
|
9762
9881
|
value: function rowsUpdated(row) {
|
|
@@ -10042,7 +10161,7 @@
|
|
|
10042
10161
|
this.table.modules.mutator.disable();
|
|
10043
10162
|
}
|
|
10044
10163
|
|
|
10045
|
-
row = new Row
|
|
10164
|
+
row = new Row(rowData, this, "calc");
|
|
10046
10165
|
|
|
10047
10166
|
if (this.table.modExists("mutator")) {
|
|
10048
10167
|
this.table.modules.mutator.enable();
|
|
@@ -10053,7 +10172,7 @@
|
|
|
10053
10172
|
|
|
10054
10173
|
row.getComponent = function () {
|
|
10055
10174
|
if (!row.component) {
|
|
10056
|
-
row.component = new CalcComponent(
|
|
10175
|
+
row.component = new CalcComponent(row);
|
|
10057
10176
|
}
|
|
10058
10177
|
|
|
10059
10178
|
return row.component;
|
|
@@ -10083,7 +10202,7 @@
|
|
|
10083
10202
|
|
|
10084
10203
|
_this4.genColumn.definition.cssClass = column.definition.cssClass; //generate cell and assign to correct column
|
|
10085
10204
|
|
|
10086
|
-
var cell = new Cell
|
|
10205
|
+
var cell = new Cell(_this4.genColumn, row);
|
|
10087
10206
|
cell.getElement();
|
|
10088
10207
|
cell.column = column;
|
|
10089
10208
|
cell.setWidth();
|
|
@@ -10275,11 +10394,9 @@
|
|
|
10275
10394
|
value: function initialize() {
|
|
10276
10395
|
if (this.table.options.dataTree) {
|
|
10277
10396
|
var dummyEl = null,
|
|
10278
|
-
firstCol = this.table.columnManager.getFirstVisibileColumn(),
|
|
10279
10397
|
options = this.table.options;
|
|
10280
10398
|
this.field = options.dataTreeChildField;
|
|
10281
10399
|
this.indent = options.dataTreeChildIndent;
|
|
10282
|
-
this.elementField = options.dataTreeElementColumn || (firstCol ? firstCol.field : false);
|
|
10283
10400
|
|
|
10284
10401
|
if (options.dataTreeBranchElement) {
|
|
10285
10402
|
if (options.dataTreeBranchElement === true) {
|
|
@@ -10348,13 +10465,21 @@
|
|
|
10348
10465
|
|
|
10349
10466
|
this.subscribe("row-init", this.initializeRow.bind(this));
|
|
10350
10467
|
this.subscribe("row-layout-after", this.layoutRow.bind(this));
|
|
10351
|
-
this.subscribe("row-relayout", this.layoutRow.bind(this));
|
|
10352
10468
|
this.subscribe("row-deleted", this.rowDelete.bind(this), 0);
|
|
10353
10469
|
this.subscribe("row-data-changed", this.rowDataChanged.bind(this), 10);
|
|
10470
|
+
this.subscribe("cell-value-updated", this.cellValueChanged.bind(this));
|
|
10471
|
+
this.subscribe("edit-cancelled", this.cellValueChanged.bind(this));
|
|
10354
10472
|
this.subscribe("column-moving-rows", this.columnMoving.bind(this));
|
|
10473
|
+
this.subscribe("table-built", this.initializeElementField.bind(this));
|
|
10355
10474
|
this.registerDisplayHandler(this.getRows.bind(this), 30);
|
|
10356
10475
|
}
|
|
10357
10476
|
}
|
|
10477
|
+
}, {
|
|
10478
|
+
key: "initializeElementField",
|
|
10479
|
+
value: function initializeElementField() {
|
|
10480
|
+
var firstCol = this.table.columnManager.getFirstVisibleColumn();
|
|
10481
|
+
this.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);
|
|
10482
|
+
}
|
|
10358
10483
|
}, {
|
|
10359
10484
|
key: "getRowChildren",
|
|
10360
10485
|
value: function getRowChildren(row) {
|
|
@@ -10383,6 +10508,15 @@
|
|
|
10383
10508
|
}
|
|
10384
10509
|
}
|
|
10385
10510
|
}
|
|
10511
|
+
}, {
|
|
10512
|
+
key: "cellValueChanged",
|
|
10513
|
+
value: function cellValueChanged(cell) {
|
|
10514
|
+
var field = cell.column.getField();
|
|
10515
|
+
|
|
10516
|
+
if (field === this.elementField) {
|
|
10517
|
+
this.layoutRow(cell.row);
|
|
10518
|
+
}
|
|
10519
|
+
}
|
|
10386
10520
|
}, {
|
|
10387
10521
|
key: "initializeRow",
|
|
10388
10522
|
value: function initializeRow(row) {
|
|
@@ -10517,7 +10651,7 @@
|
|
|
10517
10651
|
var config, children;
|
|
10518
10652
|
output.push(row);
|
|
10519
10653
|
|
|
10520
|
-
if (row instanceof Row
|
|
10654
|
+
if (row instanceof Row) {
|
|
10521
10655
|
row.create();
|
|
10522
10656
|
config = row.modules.dataTree.children;
|
|
10523
10657
|
|
|
@@ -10582,7 +10716,7 @@
|
|
|
10582
10716
|
}
|
|
10583
10717
|
|
|
10584
10718
|
childArray.forEach(function (childData) {
|
|
10585
|
-
var childRow = new Row
|
|
10719
|
+
var childRow = new Row(childData || {}, _this6.table.rowManager);
|
|
10586
10720
|
childRow.create();
|
|
10587
10721
|
childRow.modules.dataTree.index = row.modules.dataTree.index + 1;
|
|
10588
10722
|
childRow.modules.dataTree.parent = row;
|
|
@@ -10656,7 +10790,7 @@
|
|
|
10656
10790
|
}
|
|
10657
10791
|
|
|
10658
10792
|
children.forEach(function (childRow) {
|
|
10659
|
-
if (childRow instanceof Row
|
|
10793
|
+
if (childRow instanceof Row) {
|
|
10660
10794
|
output.push(childRow);
|
|
10661
10795
|
}
|
|
10662
10796
|
});
|
|
@@ -10729,7 +10863,7 @@
|
|
|
10729
10863
|
var match = false;
|
|
10730
10864
|
|
|
10731
10865
|
if (_typeof(subject) == "object") {
|
|
10732
|
-
if (subject instanceof Row
|
|
10866
|
+
if (subject instanceof Row) {
|
|
10733
10867
|
//subject is row element
|
|
10734
10868
|
match = subject.data;
|
|
10735
10869
|
} else if (subject instanceof RowComponent) {
|
|
@@ -10738,7 +10872,7 @@
|
|
|
10738
10872
|
} else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) {
|
|
10739
10873
|
if (parent.modules.dataTree) {
|
|
10740
10874
|
match = parent.modules.dataTree.children.find(function (childRow) {
|
|
10741
|
-
return childRow instanceof Row
|
|
10875
|
+
return childRow instanceof Row ? childRow.element === subject : false;
|
|
10742
10876
|
});
|
|
10743
10877
|
|
|
10744
10878
|
if (match) {
|
|
@@ -10782,7 +10916,7 @@
|
|
|
10782
10916
|
}
|
|
10783
10917
|
|
|
10784
10918
|
config.children.forEach(function (childRow) {
|
|
10785
|
-
if (childRow instanceof Row
|
|
10919
|
+
if (childRow instanceof Row) {
|
|
10786
10920
|
output.push(component ? childRow.getComponent() : childRow);
|
|
10787
10921
|
|
|
10788
10922
|
if (recurse) {
|
|
@@ -10794,13 +10928,6 @@
|
|
|
10794
10928
|
|
|
10795
10929
|
return output;
|
|
10796
10930
|
}
|
|
10797
|
-
}, {
|
|
10798
|
-
key: "checkForRestyle",
|
|
10799
|
-
value: function checkForRestyle(cell) {
|
|
10800
|
-
if (!cell.row.cells.indexOf(cell)) {
|
|
10801
|
-
this.layoutRow(cell.row);
|
|
10802
|
-
}
|
|
10803
|
-
}
|
|
10804
10931
|
}, {
|
|
10805
10932
|
key: "getChildField",
|
|
10806
10933
|
value: function getChildField() {
|
|
@@ -10809,6 +10936,7 @@
|
|
|
10809
10936
|
}, {
|
|
10810
10937
|
key: "redrawNeeded",
|
|
10811
10938
|
value: function redrawNeeded(data) {
|
|
10939
|
+
console.log("needed?", data);
|
|
10812
10940
|
return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false);
|
|
10813
10941
|
}
|
|
10814
10942
|
}]);
|
|
@@ -10985,8 +11113,6 @@
|
|
|
10985
11113
|
}
|
|
10986
11114
|
|
|
10987
11115
|
rowData.push(cell);
|
|
10988
|
-
} else {
|
|
10989
|
-
rowData.push("");
|
|
10990
11116
|
}
|
|
10991
11117
|
});
|
|
10992
11118
|
return rowData;
|
|
@@ -11053,16 +11179,18 @@
|
|
|
11053
11179
|
rowData.push(!(col.value instanceof Date) && _typeof(col.value) === "object" ? JSON.stringify(col.value) : col.value);
|
|
11054
11180
|
|
|
11055
11181
|
if (col.width > 1 || col.height > -1) {
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11182
|
+
if (col.height > 1 || col.width > 1) {
|
|
11183
|
+
merges.push({
|
|
11184
|
+
s: {
|
|
11185
|
+
r: i,
|
|
11186
|
+
c: j
|
|
11187
|
+
},
|
|
11188
|
+
e: {
|
|
11189
|
+
r: i + col.height - 1,
|
|
11190
|
+
c: j + col.width - 1
|
|
11191
|
+
}
|
|
11192
|
+
});
|
|
11193
|
+
}
|
|
11066
11194
|
}
|
|
11067
11195
|
} else {
|
|
11068
11196
|
rowData.push("");
|
|
@@ -12861,11 +12989,9 @@
|
|
|
12861
12989
|
|
|
12862
12990
|
//draggable progress bar
|
|
12863
12991
|
function progress (cell, onRendered, success, cancel, editorParams) {
|
|
12864
|
-
var _element$getElementsB, _element$getElementsB2;
|
|
12865
|
-
|
|
12866
12992
|
var element = cell.getElement(),
|
|
12867
|
-
max = typeof editorParams.max === "undefined" ? (
|
|
12868
|
-
min = typeof editorParams.min === "undefined" ? (
|
|
12993
|
+
max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("max") || 100 : editorParams.max,
|
|
12994
|
+
min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("min") || 0 : editorParams.min,
|
|
12869
12995
|
percent = (max - min) / 100,
|
|
12870
12996
|
value = cell.getValue() || 0,
|
|
12871
12997
|
handle = document.createElement("div"),
|
|
@@ -13562,6 +13688,7 @@
|
|
|
13562
13688
|
cell.column.definition.cellEditCancelled.call(this.table, component);
|
|
13563
13689
|
}
|
|
13564
13690
|
|
|
13691
|
+
this.dispatch("edit-cancelled", cell);
|
|
13565
13692
|
this.dispatchExternal("cellEditCancelled", component);
|
|
13566
13693
|
}
|
|
13567
13694
|
} //return a formatted value for a cell
|
|
@@ -13698,10 +13825,6 @@
|
|
|
13698
13825
|
|
|
13699
13826
|
cell.setValue(value, true);
|
|
13700
13827
|
|
|
13701
|
-
if (self.table.options.dataTree && self.table.modExists("dataTree")) {
|
|
13702
|
-
self.table.modules.dataTree.checkForRestyle(cell);
|
|
13703
|
-
}
|
|
13704
|
-
|
|
13705
13828
|
if (valid !== true) {
|
|
13706
13829
|
element.classList.add("tabulator-validation-fail");
|
|
13707
13830
|
self.table.externalEvents.dispatch("validationFailed", cell.getComponent(), value, valid);
|
|
@@ -13724,10 +13847,6 @@
|
|
|
13724
13847
|
function cancel() {
|
|
13725
13848
|
if (self.currentCell === cell) {
|
|
13726
13849
|
self.cancelEdit();
|
|
13727
|
-
|
|
13728
|
-
if (self.table.options.dataTree && self.table.modExists("dataTree")) {
|
|
13729
|
-
self.table.modules.dataTree.checkForRestyle(cell);
|
|
13730
|
-
}
|
|
13731
13850
|
}
|
|
13732
13851
|
}
|
|
13733
13852
|
|
|
@@ -13941,7 +14060,7 @@
|
|
|
13941
14060
|
switch (range) {
|
|
13942
14061
|
case true:
|
|
13943
14062
|
case "visible":
|
|
13944
|
-
rows = this.table.rowManager.getVisibleRows(true);
|
|
14063
|
+
rows = this.table.rowManager.getVisibleRows(false, true);
|
|
13945
14064
|
break;
|
|
13946
14065
|
|
|
13947
14066
|
case "all":
|
|
@@ -14585,6 +14704,8 @@
|
|
|
14585
14704
|
_this.prevHeaderFilterChangeCheck = "{}";
|
|
14586
14705
|
_this.changed = false; //has filtering changed since last render
|
|
14587
14706
|
|
|
14707
|
+
_this.tableInitialized = false;
|
|
14708
|
+
|
|
14588
14709
|
_this.registerTableOption("filterMode", "local"); //local or remote filtering
|
|
14589
14710
|
|
|
14590
14711
|
|
|
@@ -14683,6 +14804,8 @@
|
|
|
14683
14804
|
}
|
|
14684
14805
|
});
|
|
14685
14806
|
}
|
|
14807
|
+
|
|
14808
|
+
this.tableInitialized = true;
|
|
14686
14809
|
}
|
|
14687
14810
|
}, {
|
|
14688
14811
|
key: "remoteFilterParams",
|
|
@@ -15151,10 +15274,12 @@
|
|
|
15151
15274
|
}, {
|
|
15152
15275
|
key: "refreshFilter",
|
|
15153
15276
|
value: function refreshFilter() {
|
|
15154
|
-
if (this.
|
|
15155
|
-
this.
|
|
15156
|
-
|
|
15157
|
-
|
|
15277
|
+
if (this.tableInitialized) {
|
|
15278
|
+
if (this.table.options.filterMode === "remote") {
|
|
15279
|
+
this.reloadData();
|
|
15280
|
+
} else {
|
|
15281
|
+
this.refreshData(true);
|
|
15282
|
+
}
|
|
15158
15283
|
} //TODO - Persist left position of row manager
|
|
15159
15284
|
// left = this.scrollLeft;
|
|
15160
15285
|
// this.scrollHorizontal(left);
|
|
@@ -15536,12 +15661,14 @@
|
|
|
15536
15661
|
|
|
15537
15662
|
function money (cell, formatterParams, onRendered) {
|
|
15538
15663
|
var floatVal = parseFloat(cell.getValue()),
|
|
15664
|
+
sign = "",
|
|
15539
15665
|
number,
|
|
15540
15666
|
integer,
|
|
15541
15667
|
decimal,
|
|
15542
15668
|
rgx;
|
|
15543
15669
|
var decimalSym = formatterParams.decimal || ".";
|
|
15544
15670
|
var thousandSym = formatterParams.thousand || ",";
|
|
15671
|
+
var negativeSign = formatterParams.negativeSign || "-";
|
|
15545
15672
|
var symbol = formatterParams.symbol || "";
|
|
15546
15673
|
var after = !!formatterParams.symbolAfter;
|
|
15547
15674
|
var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2;
|
|
@@ -15550,6 +15677,11 @@
|
|
|
15550
15677
|
return this.emptyToSpace(this.sanitizeHTML(cell.getValue()));
|
|
15551
15678
|
}
|
|
15552
15679
|
|
|
15680
|
+
if (floatVal < 0) {
|
|
15681
|
+
floatVal = Math.abs(floatVal);
|
|
15682
|
+
sign = negativeSign;
|
|
15683
|
+
}
|
|
15684
|
+
|
|
15553
15685
|
number = precision !== false ? floatVal.toFixed(precision) : floatVal;
|
|
15554
15686
|
number = String(number).split(".");
|
|
15555
15687
|
integer = number[0];
|
|
@@ -15560,7 +15692,7 @@
|
|
|
15560
15692
|
integer = integer.replace(rgx, "$1" + thousandSym + "$2");
|
|
15561
15693
|
}
|
|
15562
15694
|
|
|
15563
|
-
return after ? integer + decimal + symbol : symbol + integer + decimal;
|
|
15695
|
+
return after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;
|
|
15564
15696
|
}
|
|
15565
15697
|
|
|
15566
15698
|
function link (cell, formatterParams, onRendered) {
|
|
@@ -15699,7 +15831,7 @@
|
|
|
15699
15831
|
var value = cell.getValue();
|
|
15700
15832
|
|
|
15701
15833
|
if (typeof DT != "undefined") {
|
|
15702
|
-
var newDatetime =
|
|
15834
|
+
var newDatetime = DT.fromFormat(String(value), inputFormat);
|
|
15703
15835
|
|
|
15704
15836
|
if (newDatetime.isValid) {
|
|
15705
15837
|
if (formatterParams.timezone) {
|
|
@@ -15708,7 +15840,7 @@
|
|
|
15708
15840
|
|
|
15709
15841
|
return newDatetime.toFormat(outputFormat);
|
|
15710
15842
|
} else {
|
|
15711
|
-
if (invalid === true) {
|
|
15843
|
+
if (invalid === true || !value) {
|
|
15712
15844
|
return value;
|
|
15713
15845
|
} else if (typeof invalid === "function") {
|
|
15714
15846
|
return invalid(value);
|
|
@@ -15732,7 +15864,7 @@
|
|
|
15732
15864
|
var value = cell.getValue();
|
|
15733
15865
|
|
|
15734
15866
|
if (typeof DT != "undefined") {
|
|
15735
|
-
var newDatetime = DT.fromFormat(value, inputFormat);
|
|
15867
|
+
var newDatetime = DT.fromFormat(String(value), inputFormat);
|
|
15736
15868
|
|
|
15737
15869
|
if (newDatetime.isValid) {
|
|
15738
15870
|
if (humanize) ; else {
|
|
@@ -16731,7 +16863,11 @@
|
|
|
16731
16863
|
|
|
16732
16864
|
if (index > -1) {
|
|
16733
16865
|
var rowEl = row.getElement();
|
|
16734
|
-
|
|
16866
|
+
|
|
16867
|
+
if (rowEl.parentNode) {
|
|
16868
|
+
rowEl.parentNode.removeChild(rowEl);
|
|
16869
|
+
}
|
|
16870
|
+
|
|
16735
16871
|
this.rows.splice(index, 1);
|
|
16736
16872
|
}
|
|
16737
16873
|
}
|
|
@@ -16875,10 +17011,16 @@
|
|
|
16875
17011
|
group.wipe();
|
|
16876
17012
|
});
|
|
16877
17013
|
} else {
|
|
16878
|
-
this.
|
|
16879
|
-
|
|
16880
|
-
|
|
17014
|
+
this.rows.forEach(function (row) {
|
|
17015
|
+
if (row.modules) {
|
|
17016
|
+
delete row.modules.group;
|
|
17017
|
+
}
|
|
17018
|
+
});
|
|
16881
17019
|
}
|
|
17020
|
+
|
|
17021
|
+
this.element = false;
|
|
17022
|
+
this.arrowElement = false;
|
|
17023
|
+
this.elementContents = false;
|
|
16882
17024
|
}
|
|
16883
17025
|
}, {
|
|
16884
17026
|
key: "createElements",
|
|
@@ -17275,7 +17417,7 @@
|
|
|
17275
17417
|
|
|
17276
17418
|
if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) {
|
|
17277
17419
|
this.element.classList.add("tabulator-group-visible");
|
|
17278
|
-
var prev = this.
|
|
17420
|
+
var prev = this.generateElement();
|
|
17279
17421
|
|
|
17280
17422
|
if (this.groupList.length) {
|
|
17281
17423
|
this.groupList.forEach(function (group) {
|
|
@@ -17394,7 +17536,12 @@
|
|
|
17394
17536
|
}, {
|
|
17395
17537
|
key: "getElement",
|
|
17396
17538
|
value: function getElement() {
|
|
17397
|
-
this.
|
|
17539
|
+
return this.elementContents ? this.element : this.generateElement();
|
|
17540
|
+
}
|
|
17541
|
+
}, {
|
|
17542
|
+
key: "generateElement",
|
|
17543
|
+
value: function generateElement() {
|
|
17544
|
+
this.addBindings = false;
|
|
17398
17545
|
|
|
17399
17546
|
this._visSet();
|
|
17400
17547
|
|
|
@@ -17569,6 +17716,30 @@
|
|
|
17569
17716
|
_createClass(GroupRows, [{
|
|
17570
17717
|
key: "initialize",
|
|
17571
17718
|
value: function initialize() {
|
|
17719
|
+
if (this.table.options.groupBy) {
|
|
17720
|
+
this.configureGroupSetup();
|
|
17721
|
+
|
|
17722
|
+
if (this.table.options.groupUpdateOnCellEdit) {
|
|
17723
|
+
this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
|
|
17724
|
+
this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
|
|
17725
|
+
}
|
|
17726
|
+
|
|
17727
|
+
this.subscribe("row-deleting", this.rowDeleting.bind(this));
|
|
17728
|
+
this.subscribe("row-deleted", this.rowsUpdated.bind(this));
|
|
17729
|
+
this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
|
|
17730
|
+
this.subscribe("rows-wipe", this.wipe.bind(this));
|
|
17731
|
+
this.subscribe("rows-added", this.rowsUpdated.bind(this));
|
|
17732
|
+
this.subscribe("row-moving", this.rowMoving.bind(this));
|
|
17733
|
+
this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
|
|
17734
|
+
this.subscribe("rows-sample", this.rowSample.bind(this));
|
|
17735
|
+
this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
|
|
17736
|
+
this.registerDisplayHandler(this.displayHandler, 20);
|
|
17737
|
+
this.initialized = true;
|
|
17738
|
+
}
|
|
17739
|
+
}
|
|
17740
|
+
}, {
|
|
17741
|
+
key: "configureGroupSetup",
|
|
17742
|
+
value: function configureGroupSetup() {
|
|
17572
17743
|
var _this2 = this;
|
|
17573
17744
|
|
|
17574
17745
|
if (this.table.options.groupBy) {
|
|
@@ -17658,23 +17829,6 @@
|
|
|
17658
17829
|
if (groupHeader) {
|
|
17659
17830
|
this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
|
|
17660
17831
|
}
|
|
17661
|
-
|
|
17662
|
-
if (this.table.options.groupUpdateOnCellEdit) {
|
|
17663
|
-
this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
|
|
17664
|
-
this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
|
|
17665
|
-
}
|
|
17666
|
-
|
|
17667
|
-
this.subscribe("row-deleting", this.rowDeleting.bind(this));
|
|
17668
|
-
this.subscribe("row-deleted", this.rowsUpdated.bind(this));
|
|
17669
|
-
this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
|
|
17670
|
-
this.subscribe("rows-wipe", this.wipe.bind(this));
|
|
17671
|
-
this.subscribe("rows-added", this.rowsUpdated.bind(this));
|
|
17672
|
-
this.subscribe("row-moving", this.rowMoving.bind(this));
|
|
17673
|
-
this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
|
|
17674
|
-
this.subscribe("rows-sample", this.rowSample.bind(this));
|
|
17675
|
-
this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
|
|
17676
|
-
this.registerDisplayHandler(this.displayHandler, 20);
|
|
17677
|
-
this.initialized = true;
|
|
17678
17832
|
}
|
|
17679
17833
|
}
|
|
17680
17834
|
}, {
|
|
@@ -17736,23 +17890,29 @@
|
|
|
17736
17890
|
key: "setGroupBy",
|
|
17737
17891
|
value: function setGroupBy(groups) {
|
|
17738
17892
|
this.table.options.groupBy = groups;
|
|
17739
|
-
|
|
17740
|
-
this.
|
|
17893
|
+
|
|
17894
|
+
if (!this.initialized) {
|
|
17895
|
+
this.initialize();
|
|
17896
|
+
} else {
|
|
17897
|
+
this.configureGroupSetup();
|
|
17898
|
+
}
|
|
17899
|
+
|
|
17900
|
+
this.refreshData();
|
|
17741
17901
|
this.trackChanges();
|
|
17742
17902
|
}
|
|
17743
17903
|
}, {
|
|
17744
17904
|
key: "setGroupValues",
|
|
17745
17905
|
value: function setGroupValues(groupValues) {
|
|
17746
17906
|
this.table.options.groupValues = groupValues;
|
|
17747
|
-
this.
|
|
17748
|
-
this.refreshData(
|
|
17907
|
+
this.configureGroupSetup();
|
|
17908
|
+
this.refreshData();
|
|
17749
17909
|
this.trackChanges();
|
|
17750
17910
|
}
|
|
17751
17911
|
}, {
|
|
17752
17912
|
key: "setGroupStartOpen",
|
|
17753
17913
|
value: function setGroupStartOpen(values) {
|
|
17754
17914
|
this.table.options.groupStartOpen = values;
|
|
17755
|
-
this.
|
|
17915
|
+
this.configureGroupSetup();
|
|
17756
17916
|
|
|
17757
17917
|
if (this.table.options.groupBy) {
|
|
17758
17918
|
this.refreshData();
|
|
@@ -17765,7 +17925,7 @@
|
|
|
17765
17925
|
key: "setGroupHeader",
|
|
17766
17926
|
value: function setGroupHeader(values) {
|
|
17767
17927
|
this.table.options.groupHeader = values;
|
|
17768
|
-
this.
|
|
17928
|
+
this.configureGroupSetup();
|
|
17769
17929
|
|
|
17770
17930
|
if (this.table.options.groupBy) {
|
|
17771
17931
|
this.refreshData();
|
|
@@ -17848,7 +18008,7 @@
|
|
|
17848
18008
|
}, {
|
|
17849
18009
|
key: "getRows",
|
|
17850
18010
|
value: function getRows(rows) {
|
|
17851
|
-
if (this.groupIDLookups.length) {
|
|
18011
|
+
if (this.table.options.groupBy && this.groupIDLookups.length) {
|
|
17852
18012
|
this.dispatchExternal("dataGrouping");
|
|
17853
18013
|
this.generateGroups(rows);
|
|
17854
18014
|
|
|
@@ -18209,7 +18369,7 @@
|
|
|
18209
18369
|
}
|
|
18210
18370
|
}
|
|
18211
18371
|
|
|
18212
|
-
this.
|
|
18372
|
+
this.action("rowDelete", row, {
|
|
18213
18373
|
data: row.getData(),
|
|
18214
18374
|
pos: !index,
|
|
18215
18375
|
index: index
|
|
@@ -18364,7 +18524,7 @@
|
|
|
18364
18524
|
data = [];
|
|
18365
18525
|
this.hasIndex = false;
|
|
18366
18526
|
this.dispatchExternal("htmlImporting");
|
|
18367
|
-
rows = rows ? rows.getElementsByTagName("tr") : []; //check for
|
|
18527
|
+
rows = rows ? rows.getElementsByTagName("tr") : []; //check for Tabulator inline options
|
|
18368
18528
|
|
|
18369
18529
|
this._extractOptions(element, options);
|
|
18370
18530
|
|
|
@@ -18404,7 +18564,7 @@
|
|
|
18404
18564
|
key: "_extractOptions",
|
|
18405
18565
|
value: function _extractOptions(element, options, defaultOptions) {
|
|
18406
18566
|
var attributes = element.attributes;
|
|
18407
|
-
var optionsArr = defaultOptions ? Object.
|
|
18567
|
+
var optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);
|
|
18408
18568
|
var optionsList = {};
|
|
18409
18569
|
optionsArr.forEach(function (item) {
|
|
18410
18570
|
optionsList[item.toLowerCase()] = item;
|
|
@@ -18472,12 +18632,10 @@
|
|
|
18472
18632
|
|
|
18473
18633
|
if (width && !col.width) {
|
|
18474
18634
|
col.width = width;
|
|
18475
|
-
} //check for
|
|
18635
|
+
} //check for Tabulator inline options
|
|
18476
18636
|
|
|
18477
18637
|
|
|
18478
|
-
header.
|
|
18479
|
-
|
|
18480
|
-
this._extractOptions(header, col, Column.prototype.defaultOptionList);
|
|
18638
|
+
this._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);
|
|
18481
18639
|
|
|
18482
18640
|
this.fieldIndex[index] = col.field;
|
|
18483
18641
|
|
|
@@ -18825,7 +18983,7 @@
|
|
|
18825
18983
|
callback;
|
|
18826
18984
|
|
|
18827
18985
|
if (this.columnSubscribers[action]) {
|
|
18828
|
-
if (component instanceof Cell
|
|
18986
|
+
if (component instanceof Cell) {
|
|
18829
18987
|
callback = component.column.definition[action];
|
|
18830
18988
|
} else if (component instanceof Column$1) {
|
|
18831
18989
|
callback = component.definition[action];
|
|
@@ -19575,7 +19733,9 @@
|
|
|
19575
19733
|
}, {
|
|
19576
19734
|
key: "initialize",
|
|
19577
19735
|
value: function initialize() {
|
|
19578
|
-
|
|
19736
|
+
if (this.table.options.movableColumns) {
|
|
19737
|
+
this.subscribe("column-init", this.initializeColumn.bind(this));
|
|
19738
|
+
}
|
|
19579
19739
|
}
|
|
19580
19740
|
}, {
|
|
19581
19741
|
key: "initializeColumn",
|
|
@@ -19714,7 +19874,9 @@
|
|
|
19714
19874
|
}, {
|
|
19715
19875
|
key: "startMove",
|
|
19716
19876
|
value: function startMove(e, column) {
|
|
19717
|
-
var element = column.getElement()
|
|
19877
|
+
var element = column.getElement(),
|
|
19878
|
+
headerElement = this.table.columnManager.getElement(),
|
|
19879
|
+
headersElement = this.table.columnManager.getHeadersElement();
|
|
19718
19880
|
this.moving = column;
|
|
19719
19881
|
this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
|
|
19720
19882
|
this.table.element.classList.add("tabulator-block-select"); //create placeholder
|
|
@@ -19728,7 +19890,7 @@
|
|
|
19728
19890
|
this.hoverElement.classList.add("tabulator-moving");
|
|
19729
19891
|
this.table.columnManager.getElement().appendChild(this.hoverElement);
|
|
19730
19892
|
this.hoverElement.style.left = "0";
|
|
19731
|
-
this.hoverElement.style.bottom = "
|
|
19893
|
+
this.hoverElement.style.bottom = headerElement.clientHeight - headersElement.offsetHeight + "px";
|
|
19732
19894
|
|
|
19733
19895
|
if (!this.touchMove) {
|
|
19734
19896
|
this._bindMouseMove();
|
|
@@ -19768,7 +19930,7 @@
|
|
|
19768
19930
|
column.getCells().forEach(function (cell, i) {
|
|
19769
19931
|
var cellEl = cell.getElement(true);
|
|
19770
19932
|
|
|
19771
|
-
if (cellEl.parentNode) {
|
|
19933
|
+
if (cellEl.parentNode && movingCells[i]) {
|
|
19772
19934
|
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
|
|
19773
19935
|
}
|
|
19774
19936
|
});
|
|
@@ -19776,7 +19938,7 @@
|
|
|
19776
19938
|
column.getCells().forEach(function (cell, i) {
|
|
19777
19939
|
var cellEl = cell.getElement(true);
|
|
19778
19940
|
|
|
19779
|
-
if (cellEl.parentNode) {
|
|
19941
|
+
if (cellEl.parentNode && movingCells[i]) {
|
|
19780
19942
|
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
|
|
19781
19943
|
}
|
|
19782
19944
|
});
|
|
@@ -20674,9 +20836,6 @@
|
|
|
20674
20836
|
_this.dataChanging = false; //flag to check if data is being changed by this module
|
|
20675
20837
|
|
|
20676
20838
|
_this.pageSizes = [];
|
|
20677
|
-
_this.dataReceivedNames = {}; //TODO - remove once pagimation update is complete
|
|
20678
|
-
|
|
20679
|
-
_this.dataSentNames = {}; //TODO - remove once pagimation update is complete
|
|
20680
20839
|
|
|
20681
20840
|
_this.registerTableOption("pagination", false); //set pagination type
|
|
20682
20841
|
|
|
@@ -20687,7 +20846,7 @@
|
|
|
20687
20846
|
_this.registerTableOption("paginationSize", false); //set number of rows to a page
|
|
20688
20847
|
|
|
20689
20848
|
|
|
20690
|
-
_this.registerTableOption("paginationInitialPage", 1); //
|
|
20849
|
+
_this.registerTableOption("paginationInitialPage", 1); //initial page to show on load
|
|
20691
20850
|
|
|
20692
20851
|
|
|
20693
20852
|
_this.registerTableOption("paginationButtonCount", 5); // set count of page button
|
|
@@ -20764,6 +20923,7 @@
|
|
|
20764
20923
|
this.subscribe("data-params", this.remotePageParams.bind(this));
|
|
20765
20924
|
this.subscribe("data-loaded", this._parseRemoteData.bind(this));
|
|
20766
20925
|
this.subscribe("table-built", this.calculatePageSizes.bind(this));
|
|
20926
|
+
this.subscribe("data-processed", this.initialLoadComplete.bind(this));
|
|
20767
20927
|
this.initializeProgressive(this.table.options.progressiveLoad);
|
|
20768
20928
|
|
|
20769
20929
|
if (this.table.options.progressiveLoad === "scroll") {
|
|
@@ -20884,7 +21044,7 @@
|
|
|
20884
21044
|
margin = this.table.options.progressiveLoadScrollMargin || element.clientHeight * 2;
|
|
20885
21045
|
|
|
20886
21046
|
if (diff < margin) {
|
|
20887
|
-
this.nextPage();
|
|
21047
|
+
this.nextPage()["catch"](function () {}); //consume the exception thrown when on the last page
|
|
20888
21048
|
}
|
|
20889
21049
|
}
|
|
20890
21050
|
}
|
|
@@ -21124,7 +21284,7 @@
|
|
|
21124
21284
|
this.page = 1;
|
|
21125
21285
|
}
|
|
21126
21286
|
}
|
|
21127
|
-
} //set the
|
|
21287
|
+
} //set the maximum page
|
|
21128
21288
|
|
|
21129
21289
|
}, {
|
|
21130
21290
|
key: "setMaxPage",
|
|
@@ -21382,7 +21542,7 @@
|
|
|
21382
21542
|
var data, margin;
|
|
21383
21543
|
|
|
21384
21544
|
if (typeof data.last_page === "undefined") {
|
|
21385
|
-
console.warn("Remote Pagination Error - Server response missing '" + this.
|
|
21545
|
+
console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").last_page || "last_page") + "' property");
|
|
21386
21546
|
}
|
|
21387
21547
|
|
|
21388
21548
|
if (data.data) {
|
|
@@ -21406,7 +21566,7 @@
|
|
|
21406
21566
|
break;
|
|
21407
21567
|
|
|
21408
21568
|
case "progressive_scroll":
|
|
21409
|
-
data = this.table.rowManager.getData().concat(data.data);
|
|
21569
|
+
data = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);
|
|
21410
21570
|
this.table.rowManager.setData(data, this.page !== 1, this.page == 1);
|
|
21411
21571
|
margin = this.table.options.progressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2;
|
|
21412
21572
|
|
|
@@ -21426,7 +21586,7 @@
|
|
|
21426
21586
|
// this.table.columnManager.scrollHorizontal(left);
|
|
21427
21587
|
}
|
|
21428
21588
|
} else {
|
|
21429
|
-
console.warn("Remote Pagination Error - Server response missing '" + this.
|
|
21589
|
+
console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").data || "data") + "' property");
|
|
21430
21590
|
}
|
|
21431
21591
|
|
|
21432
21592
|
return data.data;
|
|
@@ -23321,9 +23481,9 @@
|
|
|
23321
23481
|
this.subscribe("row-init", this.initializeRow.bind(this));
|
|
23322
23482
|
this.subscribe("row-deleting", this.rowDeleted.bind(this));
|
|
23323
23483
|
this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
|
|
23324
|
-
this.subscribe("rows-retrieve", this.
|
|
23484
|
+
this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
|
|
23325
23485
|
|
|
23326
|
-
if (this.table.options.selectable && this.table.options.selectablePersistence) {
|
|
23486
|
+
if (this.table.options.selectable && !this.table.options.selectablePersistence) {
|
|
23327
23487
|
this.subscribe("data-refeshing", this.deselectRows.bind(this));
|
|
23328
23488
|
}
|
|
23329
23489
|
}
|
|
@@ -23563,9 +23723,7 @@
|
|
|
23563
23723
|
this.childRowSelection(row, true);
|
|
23564
23724
|
}
|
|
23565
23725
|
|
|
23566
|
-
|
|
23567
|
-
this.dispatchExternal("rowSelected", row.getComponent());
|
|
23568
|
-
}
|
|
23726
|
+
this.dispatchExternal("rowSelected", row.getComponent());
|
|
23569
23727
|
|
|
23570
23728
|
this._rowSelectionChanged(silent);
|
|
23571
23729
|
}
|
|
@@ -23639,9 +23797,7 @@
|
|
|
23639
23797
|
this.childRowSelection(row, false);
|
|
23640
23798
|
}
|
|
23641
23799
|
|
|
23642
|
-
|
|
23643
|
-
this.dispatchExternal("rowDeselected", row.getComponent());
|
|
23644
|
-
}
|
|
23800
|
+
this.dispatchExternal("rowDeselected", row.getComponent());
|
|
23645
23801
|
|
|
23646
23802
|
self._rowSelectionChanged(silent);
|
|
23647
23803
|
}
|
|
@@ -23830,8 +23986,8 @@
|
|
|
23830
23986
|
emptyAlign = 0;
|
|
23831
23987
|
|
|
23832
23988
|
if (typeof DT != "undefined") {
|
|
23833
|
-
a = DT.fromFormat(a, format);
|
|
23834
|
-
b = DT.fromFormat(b, format);
|
|
23989
|
+
a = DT.fromFormat(String(a), format);
|
|
23990
|
+
b = DT.fromFormat(String(b), format);
|
|
23835
23991
|
|
|
23836
23992
|
if (!a.isValid) {
|
|
23837
23993
|
emptyAlign = !b.isValid ? 0 : -1;
|
|
@@ -24219,7 +24375,7 @@
|
|
|
24219
24375
|
if (this.table.options.sortMode === "remote") {
|
|
24220
24376
|
this.reloadData();
|
|
24221
24377
|
} else {
|
|
24222
|
-
this.refreshData();
|
|
24378
|
+
this.refreshData(true);
|
|
24223
24379
|
} //TODO - Persist left position of row manager
|
|
24224
24380
|
// left = this.scrollLeft;
|
|
24225
24381
|
// this.scrollHorizontal(left);
|