tabulator-rails 0.2.1 → 0.2.2
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.
- checksums.yaml +4 -4
- data/VERSIONS.md +1 -0
- data/lib/tabulator-rails/version.rb +1 -1
- data/vendor/assets/javascripts/tabulator.js +110 -59
- data/vendor/assets/stylesheets/tabulator.css +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23e571464d638240a28e71bdaf174e84f3319f6f
|
4
|
+
data.tar.gz: e392e22ae683ac9bbe87e0db66b783740d2b02c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1459e8946d8d4b798799eee9d56582ed1d3d425bb64bf577ab0ab9445414c6278e593a5077ca5d6f5e889b91854c3a13d70404173234f784cc63eff1be0fe49d
|
7
|
+
data.tar.gz: ee56c42dde84320fcf45cc4c1701b6282da8e8754e3c8b8966d8340a2fd5a620569e302a9219727d72286d6bc755656a39eaa386a34c821455d25f95f832f85e
|
data/VERSIONS.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
4
4
|
|
5
|
-
/* Tabulator v3.4.
|
5
|
+
/* Tabulator v3.4.2 (c) Oliver Folkerd */
|
6
6
|
|
7
7
|
/*
|
8
8
|
* This file is part of the Tabulator package.
|
@@ -1014,7 +1014,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
1014
1014
|
|
1015
1015
|
if (this.definition.tooltipHeader) {
|
1016
1016
|
|
1017
|
-
console.warn("The%c tooltipHeader%c column definition property has been depricated and will be removed in version 4.0, use %c
|
1017
|
+
console.warn("The%c tooltipHeader%c column definition property has been depricated and will be removed in version 4.0, use %c headerTooltip%c instead.", "font-weight:bold;", "font-weight:regular;", "font-weight:bold;", "font-weight:regular;");
|
1018
1018
|
|
1019
1019
|
if (typeof this.definition.headerTooltip == "undefined") {
|
1020
1020
|
|
@@ -1064,29 +1064,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
1064
1064
|
}
|
1065
1065
|
};
|
1066
1066
|
|
1067
|
-
|
1068
|
-
|
1069
|
-
Column.prototype._buildHeader = function () {
|
1067
|
+
Column.prototype.setTooltip = function () {
|
1070
1068
|
|
1071
1069
|
var self = this,
|
1072
|
-
def = self.definition
|
1073
|
-
dblTap,
|
1074
|
-
tapHold,
|
1075
|
-
tap;
|
1076
|
-
|
1077
|
-
self.element.empty();
|
1078
|
-
|
1079
|
-
self.contentElement = self._buildColumnHeaderContent();
|
1080
|
-
|
1081
|
-
self.element.append(self.contentElement);
|
1082
|
-
|
1083
|
-
if (self.isGroup) {
|
1084
|
-
|
1085
|
-
self._buildGroupHeader();
|
1086
|
-
} else {
|
1087
|
-
|
1088
|
-
self._buildColumnHeader();
|
1089
|
-
}
|
1070
|
+
def = self.definition;
|
1090
1071
|
|
1091
1072
|
//set header tooltips
|
1092
1073
|
|
@@ -1119,6 +1100,33 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
1119
1100
|
|
1120
1101
|
self.element.attr("title", "");
|
1121
1102
|
}
|
1103
|
+
};
|
1104
|
+
|
1105
|
+
//build header element
|
1106
|
+
|
1107
|
+
Column.prototype._buildHeader = function () {
|
1108
|
+
|
1109
|
+
var self = this,
|
1110
|
+
def = self.definition,
|
1111
|
+
dblTap,
|
1112
|
+
tapHold,
|
1113
|
+
tap;
|
1114
|
+
|
1115
|
+
self.element.empty();
|
1116
|
+
|
1117
|
+
self.contentElement = self._buildColumnHeaderContent();
|
1118
|
+
|
1119
|
+
self.element.append(self.contentElement);
|
1120
|
+
|
1121
|
+
if (self.isGroup) {
|
1122
|
+
|
1123
|
+
self._buildGroupHeader();
|
1124
|
+
} else {
|
1125
|
+
|
1126
|
+
self._buildColumnHeader();
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
self.setTooltip();
|
1122
1130
|
|
1123
1131
|
//set resizable handles
|
1124
1132
|
|
@@ -1160,6 +1168,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
1160
1168
|
self.table.extensions.columnCalcs.initializeColumn(self);
|
1161
1169
|
}
|
1162
1170
|
|
1171
|
+
//update header tooltip on mouse enter
|
1172
|
+
|
1173
|
+
self.element.on("mouseenter", function (e) {
|
1174
|
+
|
1175
|
+
self.setTooltip();
|
1176
|
+
});
|
1177
|
+
|
1163
1178
|
//setup header click event bindings
|
1164
1179
|
|
1165
1180
|
if (typeof def.headerClick == "function") {
|
@@ -1381,6 +1396,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
1381
1396
|
self.element.addClass(def.cssClass);
|
1382
1397
|
}
|
1383
1398
|
|
1399
|
+
if (def.field) {
|
1400
|
+
|
1401
|
+
this.element.attr("tabulator-field", def.field);
|
1402
|
+
}
|
1403
|
+
|
1384
1404
|
//set min width if present
|
1385
1405
|
|
1386
1406
|
self.setMinWidth(typeof def.minWidth == "undefined" ? self.table.options.columnMinWidth : def.minWidth);
|
@@ -2123,9 +2143,6 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
2123
2143
|
this.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed
|
2124
2144
|
|
2125
2145
|
this.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed
|
2126
|
-
|
2127
|
-
|
2128
|
-
this._initialize();
|
2129
2146
|
};
|
2130
2147
|
|
2131
2148
|
//////////////// Setup Functions /////////////////
|
@@ -2165,10 +2182,12 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
2165
2182
|
this.columnManager = manager;
|
2166
2183
|
};
|
2167
2184
|
|
2168
|
-
RowManager.prototype.
|
2185
|
+
RowManager.prototype.initialize = function () {
|
2169
2186
|
|
2170
2187
|
var self = this;
|
2171
2188
|
|
2189
|
+
self.setRenderMode();
|
2190
|
+
|
2172
2191
|
//initialize manager
|
2173
2192
|
|
2174
2193
|
self.element.append(self.tableElement);
|
@@ -2203,7 +2222,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
2203
2222
|
|
2204
2223
|
//handle virtual dom scrolling
|
2205
2224
|
|
2206
|
-
if (
|
2225
|
+
if (this.renderMode === "virtual") {
|
2207
2226
|
|
2208
2227
|
self.element.scroll(function () {
|
2209
2228
|
|
@@ -2584,7 +2603,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
2584
2603
|
|
2585
2604
|
if (this.table.options.history && this.table.extExists("history")) {
|
2586
2605
|
|
2587
|
-
this.table.extensions.history.action("
|
2606
|
+
this.table.extensions.history.action("rowMove", from, { pos: this.getRowPosition(from), to: to, after: after });
|
2588
2607
|
};
|
2589
2608
|
|
2590
2609
|
this.moveRowActual(from, to, after);
|
@@ -3067,6 +3086,22 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
3067
3086
|
}
|
3068
3087
|
};
|
3069
3088
|
|
3089
|
+
RowManager.prototype.setRenderMode = function () {
|
3090
|
+
|
3091
|
+
if ((this.table.element.innerHeight() || this.table.options.height) && this.table.options.virtualDom && !this.table.options.pagination) {
|
3092
|
+
|
3093
|
+
this.renderMode = "virtual";
|
3094
|
+
} else {
|
3095
|
+
|
3096
|
+
this.renderMode = "classic";
|
3097
|
+
}
|
3098
|
+
};
|
3099
|
+
|
3100
|
+
RowManager.prototype.getRenderMode = function () {
|
3101
|
+
|
3102
|
+
return this.renderMode;
|
3103
|
+
};
|
3104
|
+
|
3070
3105
|
RowManager.prototype.renderTable = function () {
|
3071
3106
|
|
3072
3107
|
var self = this;
|
@@ -3075,16 +3110,20 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
3075
3110
|
|
3076
3111
|
self.element.scrollTop(0);
|
3077
3112
|
|
3078
|
-
|
3113
|
+
switch (self.renderMode) {
|
3079
3114
|
|
3080
|
-
|
3115
|
+
case "classic":
|
3081
3116
|
|
3082
|
-
|
3083
|
-
} else {
|
3117
|
+
self._simpleRender();
|
3084
3118
|
|
3085
|
-
|
3119
|
+
break;
|
3120
|
+
|
3121
|
+
case "virtual":
|
3122
|
+
|
3123
|
+
self._virtualRenderFill();
|
3124
|
+
|
3125
|
+
break;
|
3086
3126
|
|
3087
|
-
self._virtualRenderFill();
|
3088
3127
|
}
|
3089
3128
|
|
3090
3129
|
if (self.firstRender) {
|
@@ -3116,11 +3155,6 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
3116
3155
|
self.table.options.renderComplete();
|
3117
3156
|
};
|
3118
3157
|
|
3119
|
-
RowManager.prototype.getRenderMode = function () {
|
3120
|
-
|
3121
|
-
return this.renderMode;
|
3122
|
-
};
|
3123
|
-
|
3124
3158
|
//simple render on heightless table
|
3125
3159
|
|
3126
3160
|
RowManager.prototype._simpleRender = function () {
|
@@ -3618,21 +3652,24 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
3618
3652
|
|
3619
3653
|
var self = this;
|
3620
3654
|
|
3621
|
-
|
3655
|
+
if (this.renderMode === "virtual") {
|
3622
3656
|
|
3623
|
-
|
3657
|
+
var otherHeight = self.columnManager.getElement().outerHeight() + (self.table.footerManager ? self.table.footerManager.getElement().outerHeight() : 0);
|
3624
3658
|
|
3625
|
-
|
3659
|
+
self.element.css({
|
3626
3660
|
|
3627
|
-
|
3661
|
+
"min-height": "calc(100% - " + otherHeight + "px)",
|
3628
3662
|
|
3629
|
-
|
3663
|
+
"height": "calc(100% - " + otherHeight + "px)",
|
3630
3664
|
|
3631
|
-
|
3665
|
+
"max-height": "calc(100% - " + otherHeight + "px)"
|
3632
3666
|
|
3633
|
-
|
3667
|
+
});
|
3668
|
+
|
3669
|
+
self.height = self.element.innerHeight();
|
3634
3670
|
|
3635
|
-
|
3671
|
+
self.vDomWindowBuffer = self.table.options.virtualDomBuffer || self.height;
|
3672
|
+
}
|
3636
3673
|
};
|
3637
3674
|
|
3638
3675
|
//renitialize all rows
|
@@ -3652,10 +3689,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
3652
3689
|
var pos = 0,
|
3653
3690
|
left = this.scrollLeft;
|
3654
3691
|
|
3655
|
-
|
3656
|
-
|
3657
|
-
this.adjustTableSize();
|
3658
|
-
}
|
3692
|
+
this.adjustTableSize();
|
3659
3693
|
|
3660
3694
|
if (!force) {
|
3661
3695
|
|
@@ -5508,6 +5542,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
5508
5542
|
|
5509
5543
|
element.addClass("tabulator").attr("role", "grid").empty();
|
5510
5544
|
|
5545
|
+
this.rowManager.initialize();
|
5546
|
+
|
5511
5547
|
this._detectBrowser();
|
5512
5548
|
|
5513
5549
|
if (this.extExists("layout", true)) {
|
@@ -5653,7 +5689,22 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
5653
5689
|
|
5654
5690
|
if (self.options.pagination == "local") {
|
5655
5691
|
|
5656
|
-
|
5692
|
+
if (self.options.data.length) {
|
5693
|
+
|
5694
|
+
self.rowManager.setData(self.options.data);
|
5695
|
+
} else {
|
5696
|
+
|
5697
|
+
if (self.options.ajaxURL && self.extExists("ajax")) {
|
5698
|
+
|
5699
|
+
self.extensions.ajax.sendRequest(function (data) {
|
5700
|
+
|
5701
|
+
self.rowManager.setData(data);
|
5702
|
+
});
|
5703
|
+
} else {
|
5704
|
+
|
5705
|
+
self.rowManager.setData(self.options.data);
|
5706
|
+
}
|
5707
|
+
}
|
5657
5708
|
}
|
5658
5709
|
} else {
|
5659
5710
|
|
@@ -12464,7 +12515,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
12464
12515
|
|
12465
12516
|
this.index--;
|
12466
12517
|
|
12467
|
-
this.table.options.historyUndo(action.type, action.component, action.data);
|
12518
|
+
this.table.options.historyUndo(action.type, action.component.getComponent(), action.data);
|
12468
12519
|
|
12469
12520
|
return true;
|
12470
12521
|
} else {
|
@@ -12485,7 +12536,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
12485
12536
|
|
12486
12537
|
this.redoers[action.type].call(this, action);
|
12487
12538
|
|
12488
|
-
this.table.options.historyRedo(action.type, action.component, action.data);
|
12539
|
+
this.table.options.historyRedo(action.type, action.component.getComponent(), action.data);
|
12489
12540
|
|
12490
12541
|
return true;
|
12491
12542
|
} else {
|
@@ -12515,7 +12566,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
12515
12566
|
this._rebindRow(action.component, newRow);
|
12516
12567
|
},
|
12517
12568
|
|
12518
|
-
|
12569
|
+
rowMove: function rowMove(action) {
|
12519
12570
|
|
12520
12571
|
this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.pos], false);
|
12521
12572
|
|
@@ -12543,9 +12594,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
12543
12594
|
action.component.delete();
|
12544
12595
|
},
|
12545
12596
|
|
12546
|
-
|
12597
|
+
rowMove: function rowMove(action) {
|
12547
12598
|
|
12548
|
-
this.table.rowManager.moveRowActual(action.component, action.data.
|
12599
|
+
this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.pos], false);
|
12549
12600
|
|
12550
12601
|
this.table.rowManager.redraw();
|
12551
12602
|
}
|
@@ -15082,7 +15133,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
15082
15133
|
var table = this.table,
|
15083
15134
|
observer;
|
15084
15135
|
|
15085
|
-
if (typeof ResizeObserver !== "undefined") {
|
15136
|
+
if (typeof ResizeObserver !== "undefined" && this.table.rowManager.getRenderMode() === "virtual") {
|
15086
15137
|
|
15087
15138
|
observer = new ResizeObserver(function (entry) {
|
15088
15139
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tabulator-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tanvir hasan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|