tabulator-rails 1.0.4 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34a916a24981fbd8467116a89d0f7b9613a1a064
4
- data.tar.gz: 0260dcb175c96d006698766c37145c5c36f3ffa1
3
+ metadata.gz: 55f61db55512668e27d85d3e9471bcfcdd9f703d
4
+ data.tar.gz: 1865a238e04136fd8fb435f698ebf1967dfe3578
5
5
  SHA512:
6
- metadata.gz: 724b30d0fd6e73d090009a83cc058aa0891ab487bfe0bed058e73b8865a8e2016f60faec181287afda07e682c4842830159cd78a7d904ccd828b0c877bc788aa
7
- data.tar.gz: 2af174d82c3d198e822d0b87ce2d6d3a8cfe5f2c651b545c739bafc817aaab364f8e99a898c3841b6878d82fac2279618bab8af489ba0e76307686f81867c9dd
6
+ metadata.gz: 5ec01aa6b62bfb37f28fb3e86bf808a3448de12fe449114d358ec05dbf4c7b6d0b0bef1ce83c28c451c93790af111a091a8c2e38d4a57d5e7b65073f4ac0d966
7
+ data.tar.gz: 5a5d91cc037464a7a2410afeb25cc6d6733bd4aec30febbd53ade1584f87b24884a32c07c8ce4d24b31267523840c9e4b72908701b2e76f4fe1281b924ac0848
@@ -20,3 +20,4 @@
20
20
  | 1.0.2 | 4.0.2
21
21
  | 1.0.3 | 4.0.3
22
22
  | 1.0.4 | 4.0.4
23
+ | 1.0.5 | 4.0.5
@@ -1,5 +1,5 @@
1
1
  module Tabulator
2
2
  module Rails
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  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; };
2
2
 
3
- /* Tabulator v4.0.4 (c) Oliver Folkerd */
3
+ /* Tabulator v4.0.5 (c) Oliver Folkerd */
4
4
 
5
5
  ;(function (global, factory) {
6
6
  if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && typeof module !== 'undefined') {
@@ -1022,7 +1022,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
1022
1022
 
1023
1023
  ColumnComponent.prototype.scrollTo = function () {
1024
1024
 
1025
- return this._column.table.columManager.scrollToColumn(this._column);
1025
+ return this._column.table.columnManager.scrollToColumn(this._column);
1026
1026
  };
1027
1027
 
1028
1028
  ColumnComponent.prototype.getTable = function () {
@@ -9100,7 +9100,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9100
9100
 
9101
9101
  Ajax.prototype.createLoaderElement = function () {
9102
9102
  var el = document.createElement("div");
9103
- el.classList.add("tablulator-loader");
9103
+ el.classList.add("tabulator-loader");
9104
9104
  return el;
9105
9105
  };
9106
9106
 
@@ -10020,7 +10020,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
10020
10020
  if (sel.toString() && internal) {
10021
10021
  selector = "userSelection";
10022
10022
  formatter = "raw";
10023
- this.copySelectorParams = sel.toString();
10023
+ selectorParams = sel.toString();
10024
10024
  }
10025
10025
 
10026
10026
  sel.removeAllRanges();
@@ -10045,7 +10045,6 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
10045
10045
  };
10046
10046
 
10047
10047
  Clipboard.prototype.setSelector = function (selector) {
10048
-
10049
10048
  selector = selector || this.table.options.clipboardCopySelector;
10050
10049
 
10051
10050
  switch (typeof selector === 'undefined' ? 'undefined' : _typeof(selector)) {
@@ -11685,6 +11684,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11685
11684
  Filter.prototype.initializeColumn = function (column, value) {
11686
11685
  var self = this,
11687
11686
  field = column.getField(),
11687
+ prevSuccess,
11688
11688
  params;
11689
11689
 
11690
11690
  //handle successfull value change
@@ -11693,60 +11693,65 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11693
11693
  type = "",
11694
11694
  filterFunc;
11695
11695
 
11696
- if (!column.modules.filter.emptyFunc(value)) {
11697
- column.modules.filter.value = value;
11696
+ if (typeof prevSuccess === "undefined" || prevSuccess !== value) {
11698
11697
 
11699
- switch (_typeof(column.definition.headerFilterFunc)) {
11700
- case "string":
11701
- if (self.filters[column.definition.headerFilterFunc]) {
11702
- type = column.definition.headerFilterFunc;
11703
- filterFunc = function filterFunc(data) {
11704
- return self.filters[column.definition.headerFilterFunc](value, column.getFieldValue(data));
11705
- };
11706
- } else {
11707
- console.warn("Header Filter Error - Matching filter function not found: ", column.definition.headerFilterFunc);
11708
- }
11709
- break;
11698
+ prevSuccess = value;
11710
11699
 
11711
- case "function":
11712
- filterFunc = function filterFunc(data) {
11713
- var params = column.definition.headerFilterFuncParams || {};
11714
- var fieldVal = column.getFieldValue(data);
11700
+ if (!column.modules.filter.emptyFunc(value)) {
11701
+ column.modules.filter.value = value;
11715
11702
 
11716
- params = typeof params === "function" ? params(value, fieldVal, data) : params;
11703
+ switch (_typeof(column.definition.headerFilterFunc)) {
11704
+ case "string":
11705
+ if (self.filters[column.definition.headerFilterFunc]) {
11706
+ type = column.definition.headerFilterFunc;
11707
+ filterFunc = function filterFunc(data) {
11708
+ return self.filters[column.definition.headerFilterFunc](value, column.getFieldValue(data));
11709
+ };
11710
+ } else {
11711
+ console.warn("Header Filter Error - Matching filter function not found: ", column.definition.headerFilterFunc);
11712
+ }
11713
+ break;
11717
11714
 
11718
- return column.definition.headerFilterFunc(value, fieldVal, data, params);
11719
- };
11715
+ case "function":
11716
+ filterFunc = function filterFunc(data) {
11717
+ var params = column.definition.headerFilterFuncParams || {};
11718
+ var fieldVal = column.getFieldValue(data);
11720
11719
 
11721
- type = filterFunc;
11722
- break;
11723
- }
11720
+ params = typeof params === "function" ? params(value, fieldVal, data) : params;
11724
11721
 
11725
- if (!filterFunc) {
11726
- switch (filterType) {
11727
- case "partial":
11728
- filterFunc = function filterFunc(data) {
11729
- return String(column.getFieldValue(data)).toLowerCase().indexOf(String(value).toLowerCase()) > -1;
11722
+ return column.definition.headerFilterFunc(value, fieldVal, data, params);
11730
11723
  };
11731
- type = "like";
11724
+
11725
+ type = filterFunc;
11732
11726
  break;
11727
+ }
11733
11728
 
11734
- default:
11735
- filterFunc = function filterFunc(data) {
11736
- return column.getFieldValue(data) == value;
11737
- };
11738
- type = "=";
11729
+ if (!filterFunc) {
11730
+ switch (filterType) {
11731
+ case "partial":
11732
+ filterFunc = function filterFunc(data) {
11733
+ return String(column.getFieldValue(data)).toLowerCase().indexOf(String(value).toLowerCase()) > -1;
11734
+ };
11735
+ type = "like";
11736
+ break;
11737
+
11738
+ default:
11739
+ filterFunc = function filterFunc(data) {
11740
+ return column.getFieldValue(data) == value;
11741
+ };
11742
+ type = "=";
11743
+ }
11739
11744
  }
11740
- }
11741
11745
 
11742
- self.headerFilters[field] = { value: value, func: filterFunc, type: type };
11743
- } else {
11744
- delete self.headerFilters[field];
11745
- }
11746
+ self.headerFilters[field] = { value: value, func: filterFunc, type: type };
11747
+ } else {
11748
+ delete self.headerFilters[field];
11749
+ }
11746
11750
 
11747
- self.changed = true;
11751
+ self.changed = true;
11748
11752
 
11749
- self.table.rowManager.filterRefresh();
11753
+ self.table.rowManager.filterRefresh();
11754
+ }
11750
11755
  }
11751
11756
 
11752
11757
  column.modules.filter = {
@@ -11859,7 +11864,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11859
11864
  });
11860
11865
  } else {
11861
11866
  self.table.modules.localize.bind("headerFilters|default", function (value) {
11862
- editorElement.setAttribute("placeholdder", typeof self.column.definition.headerFilterPlaceholder !== "undefined" && self.column.definition.headerFilterPlaceholder ? self.column.definition.headerFilterPlaceholder : value);
11867
+ editorElement.setAttribute("placeholder", typeof self.column.definition.headerFilterPlaceholder !== "undefined" && self.column.definition.headerFilterPlaceholder ? self.column.definition.headerFilterPlaceholder : value);
11863
11868
  });
11864
11869
  }
11865
11870
 
@@ -12565,7 +12570,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12565
12570
  element.setAttribute("aria-checked", true);
12566
12571
  return tick;
12567
12572
  } else {
12568
- if (empty && (value === "null" || value === null || typeof value === "undefined")) {
12573
+ if (empty && (value === "null" || value === "" || value === null || typeof value === "undefined")) {
12569
12574
  element.setAttribute("aria-checked", "mixed");
12570
12575
  return "";
12571
12576
  } else {
@@ -14076,7 +14081,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
14076
14081
  options = self.table.options,
14077
14082
  columns = options.columns,
14078
14083
  headers = element.getElementsByTagName("th"),
14079
- rows = element.getElementsByTagName("tbody")[0].getElementsByTagName("tr"),
14084
+ rows = element.getElementsByTagName("tbody")[0],
14080
14085
  data = [],
14081
14086
  newTable;
14082
14087
 
@@ -14084,6 +14089,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
14084
14089
 
14085
14090
  self.table.options.htmlImporting.call(this.table);
14086
14091
 
14092
+ rows = rows ? rows.getElementsByTagName("tr") : [];
14093
+
14087
14094
  //check for tablator inline options
14088
14095
  self._extractOptions(element, options);
14089
14096
 
@@ -14141,7 +14148,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
14141
14148
  this.table.element = newElement;
14142
14149
  };
14143
14150
 
14144
- //extract tabluator attribute options
14151
+ //extract tabulator attribute options
14145
14152
  HtmlTableImport.prototype._extractOptions = function (element, options) {
14146
14153
  var attributes = element.attributes;
14147
14154
 
@@ -15095,7 +15102,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
15095
15102
 
15096
15103
  self.table.rowManager.getDisplayRows().forEach(function (row) {
15097
15104
  if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) {
15098
- row.getElement.addEventListener("mouseup", row.modules.moveRow.mouseup);
15105
+ row.getElement().addEventListener("mouseup", row.modules.moveRow.mouseup);
15099
15106
  }
15100
15107
  });
15101
15108
 
@@ -15798,49 +15805,49 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
15798
15805
  data,
15799
15806
  margin;
15800
15807
 
15801
- if (data[this.paginationDataReceivedNames.last_page]) {
15802
- if (data[this.paginationDataReceivedNames.data]) {
15803
- this.max = parseInt(data[this.paginationDataReceivedNames.last_page]);
15804
-
15805
- if (this.progressiveLoad) {
15806
- switch (this.mode) {
15807
- case "progressive_load":
15808
- this.table.rowManager.addRows(data[this.paginationDataReceivedNames.data]);
15809
- if (this.page < this.max) {
15810
- setTimeout(function () {
15811
- self.nextPage();
15812
- }, self.table.options.ajaxProgressiveLoadDelay);
15813
- }
15814
- break;
15815
-
15816
- case "progressive_scroll":
15817
- data = this.table.rowManager.getData().concat(data[this.paginationDataReceivedNames.data]);
15818
-
15819
- this.table.rowManager.setData(data, true);
15808
+ if (typeof data[this.paginationDataReceivedNames.last_page] === "undefined") {
15809
+ console.warn("Remote Pagination Error - Server response missing '" + this.paginationDataReceivedNames.last_page + "' property");
15810
+ }
15820
15811
 
15821
- margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2;
15812
+ if (data[this.paginationDataReceivedNames.data]) {
15813
+ this.max = parseInt(data[this.paginationDataReceivedNames.last_page]) || 1;
15822
15814
 
15823
- if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) {
15815
+ if (this.progressiveLoad) {
15816
+ switch (this.mode) {
15817
+ case "progressive_load":
15818
+ this.table.rowManager.addRows(data[this.paginationDataReceivedNames.data]);
15819
+ if (this.page < this.max) {
15820
+ setTimeout(function () {
15824
15821
  self.nextPage();
15825
- }
15826
- break;
15827
- }
15828
- } else {
15829
- left = this.table.rowManager.scrollLeft;
15822
+ }, self.table.options.ajaxProgressiveLoadDelay);
15823
+ }
15824
+ break;
15830
15825
 
15831
- this.table.rowManager.setData(data[this.paginationDataReceivedNames.data]);
15826
+ case "progressive_scroll":
15827
+ data = this.table.rowManager.getData().concat(data[this.paginationDataReceivedNames.data]);
15832
15828
 
15833
- this.table.rowManager.scrollHorizontal(left);
15829
+ this.table.rowManager.setData(data, true);
15834
15830
 
15835
- this.table.columnManager.scrollHorizontal(left);
15831
+ margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2;
15836
15832
 
15837
- this.table.options.pageLoaded.call(this.table, this.getPage());
15833
+ if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) {
15834
+ self.nextPage();
15835
+ }
15836
+ break;
15838
15837
  }
15839
15838
  } else {
15840
- console.warn("Remote Pagination Error - Server response missing '" + this.paginationDataReceivedNames.data + "' property");
15839
+ left = this.table.rowManager.scrollLeft;
15840
+
15841
+ this.table.rowManager.setData(data[this.paginationDataReceivedNames.data]);
15842
+
15843
+ this.table.rowManager.scrollHorizontal(left);
15844
+
15845
+ this.table.columnManager.scrollHorizontal(left);
15846
+
15847
+ this.table.options.pageLoaded.call(this.table, this.getPage());
15841
15848
  }
15842
15849
  } else {
15843
- console.warn("Remote Pagination Error - Server response missing '" + this.paginationDataReceivedNames.last_page + "' property");
15850
+ console.warn("Remote Pagination Error - Server response missing '" + this.paginationDataReceivedNames.data + "' property");
15844
15851
  }
15845
15852
  };
15846
15853
 
@@ -1,4 +1,4 @@
1
- /* Tabulator v4.0.4 (c) Oliver Folkerd */
1
+ /* Tabulator v4.0.5 (c) Oliver Folkerd */
2
2
  .tabulator {
3
3
  position: relative;
4
4
  border: 1px solid #999;
@@ -343,7 +343,7 @@
343
343
  cursor: ew-resize;
344
344
  }
345
345
 
346
- .tabulator .tablulator-loader {
346
+ .tabulator .tabulator-loader {
347
347
  position: absolute;
348
348
  display: -ms-flexbox;
349
349
  display: flex;
@@ -358,7 +358,7 @@
358
358
  text-align: center;
359
359
  }
360
360
 
361
- .tabulator .tablulator-loader .tabulator-loader-msg {
361
+ .tabulator .tabulator-loader .tabulator-loader-msg {
362
362
  display: inline-block;
363
363
  margin: 0 auto;
364
364
  padding: 10px 20px;
@@ -368,12 +368,12 @@
368
368
  font-size: 16px;
369
369
  }
370
370
 
371
- .tabulator .tablulator-loader .tabulator-loader-msg.tabulator-loading {
371
+ .tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading {
372
372
  border: 4px solid #333;
373
373
  color: #000;
374
374
  }
375
375
 
376
- .tabulator .tablulator-loader .tabulator-loader-msg.tabulator-error {
376
+ .tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error {
377
377
  border: 4px solid #D00;
378
378
  color: #590000;
379
379
  }
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: 1.0.4
4
+ version: 1.0.5
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-11-10 00:00:00.000000000 Z
11
+ date: 2018-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler