tabulator-tables 5.0.9 → 5.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,18 +33,31 @@ export default class InteractionManager extends CoreFeature {
33
33
  };
34
34
 
35
35
  this.pseudoTrackers = {
36
- "row":null,
37
- "cell":null,
38
- "group":null,
39
- "column":null,
36
+ "row":{
37
+ subscriber:null,
38
+ target:null,
39
+ },
40
+ "cell":{
41
+ subscriber:null,
42
+ target:null,
43
+ },
44
+ "group":{
45
+ subscriber:null,
46
+ target:null,
47
+ },
48
+ "column":{
49
+ subscriber:null,
50
+ target:null,
51
+ },
40
52
  }
53
+
54
+ this.pseudoTracking = false;
41
55
  }
42
56
 
43
57
  initialize(){
44
58
  this.el = this.table.element;
45
59
  this.buildListenerMap();
46
60
  this.bindSubscriptionWatchers();
47
- this.bindPseudoEvents();
48
61
  }
49
62
 
50
63
  buildListenerMap(){
@@ -62,21 +75,23 @@ export default class InteractionManager extends CoreFeature {
62
75
 
63
76
  bindPseudoEvents(){
64
77
  Object.keys(this.pseudoTrackers).forEach((key) => {
65
- this.subscribe(key + "-mouseover", this.pseudoMouseEnter.bind(this, key));
66
- // this.subscribe(key + "-mouseout", this.pseudoMouseLeave.bind(this, key));
78
+ this.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);
79
+ this.subscribe(key + "-mouseover", this.pseudoTrackers[key].subscriber);
67
80
  });
81
+
82
+ this.pseudoTracking = true;
68
83
  }
69
84
 
70
85
  pseudoMouseEnter(key, e, target){
71
- if(this.pseudoTrackers[key] !== target){
86
+ if(this.pseudoTrackers[key].target !== target){
72
87
 
73
- if(this.pseudoTrackers[key]){
88
+ if(this.pseudoTrackers[key].target){
74
89
  this.dispatch(key + "-mouseleave", e, target);
75
90
  }
76
91
 
77
92
  this.pseudoMouseLeave(key, e);
78
93
 
79
- this.pseudoTrackers[key] = target;
94
+ this.pseudoTrackers[key].target = target;
80
95
 
81
96
  this.dispatch(key + "-mouseenter", e, target);
82
97
  }
@@ -96,12 +111,12 @@ export default class InteractionManager extends CoreFeature {
96
111
 
97
112
 
98
113
  leaveList.forEach((key) => {
99
- var target = this.pseudoTrackers[key];
114
+ var target = this.pseudoTrackers[key].target;
100
115
 
101
- if(this.pseudoTrackers[key]){
116
+ if(this.pseudoTrackers[key].target){
102
117
  this.dispatch(key + "-mouseleave", e, target);
103
118
 
104
- this.pseudoTrackers[key] = null;
119
+ this.pseudoTrackers[key].target = null;
105
120
  }
106
121
  });
107
122
  }
@@ -126,7 +141,7 @@ export default class InteractionManager extends CoreFeature {
126
141
  var listener = this.listeners[key].components,
127
142
  index = listener.indexOf(component),
128
143
  changed = false;
129
-
144
+
130
145
  if(added){
131
146
  if(index === -1){
132
147
  listener.push(component);
@@ -140,6 +155,10 @@ export default class InteractionManager extends CoreFeature {
140
155
  }
141
156
  }
142
157
  }
158
+
159
+ if((key === "mouseenter" || key === "mouseleave") && !this.pseudoTracking){
160
+ this.bindPseudoEvents();
161
+ }
143
162
 
144
163
  if(changed){
145
164
  this.updateEventListeners();
@@ -173,7 +192,7 @@ export default class InteractionManager extends CoreFeature {
173
192
 
174
193
  this.triggerEvents(type, e, targets);
175
194
 
176
- if((type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length){
195
+ if(this.pseudoTracking && (type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length){
177
196
  this.pseudoMouseLeave("none", e);
178
197
  }
179
198
  }
@@ -405,20 +405,23 @@ class Edit extends Module{
405
405
 
406
406
  this.invalidEdit = false;
407
407
 
408
+ console.log("clear", cancel, cell, cell.validate)
409
+
408
410
  if(cell){
409
411
  this.currentCell = false;
410
412
 
411
413
  cellEl = cell.getElement();
412
414
 
413
415
  if(cancel){
414
- if(cell.validate){
415
- cell.validate();
416
+ if(cell.column.modules.validate && this.table.modExists("validate")){
417
+ this.table.modules.validate.cellValidate(cell);
416
418
  }
417
419
  }else{
418
420
  cellEl.classList.remove("tabulator-validation-fail");
419
421
  }
420
422
 
421
423
  cellEl.classList.remove("tabulator-editing");
424
+
422
425
  while(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);
423
426
 
424
427
  cell.row.getElement().classList.remove("tabulator-row-editing");
@@ -35,7 +35,7 @@ class FrozenColumns extends Module{
35
35
  this.subscribe("cell-layout", this.layoutCell.bind(this));
36
36
  this.subscribe("column-init", this.initializeColumn.bind(this));
37
37
  this.subscribe("column-width", this.layout.bind(this));
38
- this.subscribe("row-layout-before", this.layoutRow.bind(this));
38
+ this.subscribe("row-layout-after", this.layoutRow.bind(this));
39
39
  this.subscribe("table-layout", this.layout.bind(this));
40
40
  this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
41
41
  this.subscribe("columns-loading", this.reset.bind(this));
@@ -21,7 +21,7 @@ class ResponsiveLayout extends Module{
21
21
  this.registerColumnOption("responsive");
22
22
  }
23
23
 
24
- //generate resposive columns list
24
+ //generate responsive columns list
25
25
  initialize(){
26
26
  var self = this,
27
27
  columns = [];
@@ -60,7 +60,7 @@ class ResponsiveLayout extends Module{
60
60
  this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;
61
61
  this.hiddenColumns = [];
62
62
 
63
- //detemine level of responsivity for each column
63
+ //determine level of responsivity for each column
64
64
  this.table.columnManager.columnsByIndex.forEach(function(column, i){
65
65
  if(column.modules.responsive){
66
66
  if(column.modules.responsive.order && column.modules.responsive.visible){
@@ -142,10 +142,8 @@ class ResponsiveLayout extends Module{
142
142
  updateColumnVisibility(column, responsiveToggle){
143
143
  if(!responsiveToggle && column.modules.responsive){
144
144
  column.modules.responsive.visible = column.visible;
145
- this.initialize();
145
+ this.initializeResponsivity();
146
146
  }
147
-
148
- //this.update();
149
147
  }
150
148
 
151
149
  hideColumn(column){