tabulator-tables 5.6.1 → 6.0.0

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.
Files changed (167) hide show
  1. package/bower.json +1 -1
  2. package/build/{Bundler.js → Bundler.mjs} +8 -6
  3. package/build/rollup.mjs +9 -0
  4. package/dist/css/tabulator.css +62 -0
  5. package/dist/css/tabulator.css.map +1 -1
  6. package/dist/css/tabulator.min.css +1 -1
  7. package/dist/css/tabulator.min.css.map +1 -1
  8. package/dist/css/tabulator_bootstrap3.css +72 -0
  9. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  10. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  11. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap4.css +78 -0
  13. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  14. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  15. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  16. package/dist/css/tabulator_bootstrap5.css +78 -0
  17. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  18. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  19. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  20. package/dist/css/tabulator_bulma.css +84 -0
  21. package/dist/css/tabulator_bulma.css.map +1 -1
  22. package/dist/css/tabulator_bulma.min.css +1 -1
  23. package/dist/css/tabulator_bulma.min.css.map +1 -1
  24. package/dist/css/tabulator_materialize.css +77 -0
  25. package/dist/css/tabulator_materialize.css.map +1 -1
  26. package/dist/css/tabulator_materialize.min.css +1 -1
  27. package/dist/css/tabulator_materialize.min.css.map +1 -1
  28. package/dist/css/tabulator_midnight.css +72 -0
  29. package/dist/css/tabulator_midnight.css.map +1 -1
  30. package/dist/css/tabulator_midnight.min.css +1 -1
  31. package/dist/css/tabulator_midnight.min.css.map +1 -1
  32. package/dist/css/tabulator_modern.css +82 -0
  33. package/dist/css/tabulator_modern.css.map +1 -1
  34. package/dist/css/tabulator_modern.min.css +1 -1
  35. package/dist/css/tabulator_modern.min.css.map +1 -1
  36. package/dist/css/tabulator_semanticui.css +74 -0
  37. package/dist/css/tabulator_semanticui.css.map +1 -1
  38. package/dist/css/tabulator_semanticui.min.css +1 -1
  39. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  40. package/dist/css/tabulator_simple.css +75 -0
  41. package/dist/css/tabulator_simple.css.map +1 -1
  42. package/dist/css/tabulator_simple.min.css +1 -1
  43. package/dist/css/tabulator_simple.min.css.map +1 -1
  44. package/dist/css/tabulator_site.css +85 -0
  45. package/dist/css/tabulator_site.css.map +1 -1
  46. package/dist/css/tabulator_site.min.css +1 -1
  47. package/dist/css/tabulator_site.min.css.map +1 -1
  48. package/dist/js/tabulator.js +3882 -2809
  49. package/dist/js/tabulator.js.map +1 -1
  50. package/dist/js/tabulator.min.js +2 -2
  51. package/dist/js/tabulator.min.js.map +1 -1
  52. package/dist/js/tabulator_esm.js +3845 -2770
  53. package/dist/js/tabulator_esm.js.map +1 -1
  54. package/dist/js/tabulator_esm.min.js +2 -2
  55. package/dist/js/tabulator_esm.min.js.map +1 -1
  56. package/package.json +17 -17
  57. package/src/js/builds/esm.js +2 -0
  58. package/src/js/core/ColumnManager.js +15 -0
  59. package/src/js/core/Module.js +2 -4
  60. package/src/js/core/RowManager.js +1 -1
  61. package/src/js/core/Tabulator.js +35 -22
  62. package/src/js/core/TabulatorFull.js +15 -5
  63. package/src/js/core/cell/Cell.js +4 -0
  64. package/src/js/core/column/Column.js +228 -217
  65. package/src/js/core/column/ColumnComponent.js +1 -3
  66. package/src/js/core/defaults/options.js +1 -0
  67. package/src/js/core/modules/optional.js +2 -1
  68. package/src/js/core/row/Row.js +23 -11
  69. package/src/js/core/tools/DataLoader.js +1 -1
  70. package/src/js/core/tools/ModuleBinder.js +123 -75
  71. package/src/js/core/tools/TableRegistry.js +58 -55
  72. package/src/js/modules/Accessor/Accessor.js +7 -8
  73. package/src/js/modules/Accessor/defaults/accessors.js +5 -1
  74. package/src/js/modules/Ajax/Ajax.js +10 -12
  75. package/src/js/modules/Clipboard/Clipboard.js +10 -10
  76. package/src/js/modules/Clipboard/defaults/pasteActions.js +0 -43
  77. package/src/js/modules/Clipboard/defaults/pasteParsers.js +0 -55
  78. package/src/js/modules/Clipboard/extensions/extensions.js +9 -0
  79. package/src/js/modules/Clipboard/extensions/keybindings/actions.js +9 -0
  80. package/src/js/modules/Clipboard/extensions/keybindings/bindings.js +3 -0
  81. package/src/js/modules/ColumnCalcs/CalcComponent.js +2 -4
  82. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +16 -18
  83. package/src/js/modules/Comms/Comms.js +5 -8
  84. package/src/js/modules/DataTree/DataTree.js +11 -11
  85. package/src/js/modules/Download/Download.js +9 -11
  86. package/src/js/modules/Edit/Edit.js +47 -15
  87. package/src/js/modules/Edit/List.js +12 -12
  88. package/src/js/modules/Edit/defaults/editors/time.js +0 -2
  89. package/src/js/modules/Edit/defaults/editors.js +0 -4
  90. package/src/js/modules/Export/Export.js +70 -62
  91. package/src/js/modules/Export/ExportColumn.js +2 -4
  92. package/src/js/modules/Export/ExportRow.js +2 -4
  93. package/src/js/modules/Export/defaults/columnLookups.js +3 -0
  94. package/src/js/modules/Export/defaults/rowLookups.js +18 -0
  95. package/src/js/modules/Filter/Filter.js +7 -9
  96. package/src/js/modules/Format/Format.js +7 -9
  97. package/src/js/modules/Format/defaults/formatters.js +0 -4
  98. package/src/js/modules/FrozenColumns/FrozenColumns.js +8 -6
  99. package/src/js/modules/FrozenRows/FrozenRows.js +4 -6
  100. package/src/js/modules/GroupRows/Group.js +2 -4
  101. package/src/js/modules/GroupRows/GroupComponent.js +2 -4
  102. package/src/js/modules/GroupRows/GroupRows.js +4 -6
  103. package/src/js/modules/History/History.js +10 -10
  104. package/src/js/modules/History/extensions/extensions.js +9 -0
  105. package/src/js/modules/History/extensions/keybindings/actions.js +27 -0
  106. package/src/js/modules/History/extensions/keybindings/bindings.js +4 -0
  107. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +4 -6
  108. package/src/js/modules/Import/Import.js +7 -9
  109. package/src/js/modules/Import/defaults/importers/array.js +2 -4
  110. package/src/js/modules/Import/defaults/importers/csv.js +2 -4
  111. package/src/js/modules/Interaction/Interaction.js +4 -6
  112. package/src/js/modules/Keybindings/Keybindings.js +8 -10
  113. package/src/js/modules/Keybindings/defaults/actions.js +5 -71
  114. package/src/js/modules/Keybindings/defaults/bindings.js +0 -16
  115. package/src/js/modules/Layout/Layout.js +7 -9
  116. package/src/js/modules/Localize/Localize.js +7 -9
  117. package/src/js/modules/Menu/Menu.js +7 -9
  118. package/src/js/modules/MoveColumns/MoveColumns.js +6 -8
  119. package/src/js/modules/MoveRows/MoveRows.js +13 -45
  120. package/src/js/modules/MoveRows/defaults/receivers.js +30 -0
  121. package/src/js/modules/MoveRows/defaults/senders.js +5 -0
  122. package/src/js/modules/Mutator/Mutator.js +7 -9
  123. package/src/js/modules/Page/Page.js +7 -9
  124. package/src/js/modules/Persistence/Persistence.js +10 -12
  125. package/src/js/modules/Popup/Popup.js +4 -8
  126. package/src/js/modules/Print/Print.js +4 -6
  127. package/src/js/modules/ReactiveData/ReactiveData.js +4 -9
  128. package/src/js/modules/ResizeColumns/ResizeColumns.js +91 -53
  129. package/src/js/modules/ResizeRows/ResizeRows.js +41 -8
  130. package/src/js/modules/ResizeTable/ResizeTable.js +4 -6
  131. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +15 -9
  132. package/src/js/modules/ResponsiveLayout/extensions/extensions.js +9 -0
  133. package/src/js/modules/SelectRange/Range.js +22 -10
  134. package/src/js/modules/SelectRange/RangeComponent.js +2 -4
  135. package/src/js/modules/SelectRange/SelectRange.js +58 -28
  136. package/src/js/modules/SelectRange/extensions/clipboard/pasteActions.js +45 -0
  137. package/src/js/modules/SelectRange/extensions/clipboard/pasteParsers.js +57 -0
  138. package/src/js/modules/SelectRange/extensions/export/columnLookups.js +11 -0
  139. package/src/js/modules/SelectRange/extensions/export/rowLookups.js +5 -0
  140. package/src/js/modules/SelectRange/extensions/extensions.js +21 -0
  141. package/src/js/modules/SelectRange/extensions/keybindings/actions.js +38 -0
  142. package/src/js/modules/SelectRange/extensions/keybindings/bindings.js +14 -0
  143. package/src/js/modules/SelectRow/SelectRow.js +12 -12
  144. package/src/js/modules/SelectRow/extensions/extensions.js +9 -0
  145. package/src/js/modules/Sort/Sort.js +16 -13
  146. package/src/js/modules/Spreadsheet/GridCalculator.js +64 -0
  147. package/src/js/modules/Spreadsheet/Sheet.js +243 -0
  148. package/src/js/modules/Spreadsheet/SheetComponent.js +59 -0
  149. package/src/js/modules/Spreadsheet/Spreadsheet.js +309 -0
  150. package/src/js/modules/Tooltip/Tooltip.js +6 -8
  151. package/src/js/modules/Validate/Validate.js +7 -9
  152. package/src/scss/tabulator.scss +79 -3
  153. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +14 -0
  154. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +18 -0
  155. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +18 -0
  156. package/src/scss/themes/bulma/tabulator_bulma.scss +24 -0
  157. package/src/scss/themes/materialize/tabulator_materialize.scss +18 -0
  158. package/src/scss/themes/semanticui/tabulator_semanticui.scss +14 -0
  159. package/src/scss/themes/tabulator_midnight.scss +34 -21
  160. package/src/scss/themes/tabulator_modern.scss +23 -0
  161. package/src/scss/themes/tabulator_simple.scss +15 -0
  162. package/src/scss/themes/tabulator_site.scss +25 -0
  163. package/build/rollup.js +0 -6
  164. package/src/js/modules/Edit/defaults/editors/autocomplete.js +0 -12
  165. package/src/js/modules/Edit/defaults/editors/select.js +0 -10
  166. /package/src/js/modules/{Format/defaults → ResponsiveLayout/extensions}/formatters/responsiveCollapse.js +0 -0
  167. /package/src/js/modules/{Format/defaults → SelectRow/extensions}/formatters/rowSelection.js +0 -0
@@ -1,7 +1,7 @@
1
1
  import CoreFeature from '../../core/CoreFeature.js';
2
2
  import RangeComponent from "./RangeComponent";
3
3
 
4
- class Range extends CoreFeature{
4
+ export default class Range extends CoreFeature{
5
5
  constructor(table, rangeManager, start, end) {
6
6
  super(table);
7
7
 
@@ -152,7 +152,7 @@ class Range extends CoreFeature{
152
152
  }
153
153
 
154
154
  _getTableRows() {
155
- return this.table.rowManager.getDisplayRows();
155
+ return this.table.rowManager.getDisplayRows().filter(row=> row.type === "row");
156
156
  }
157
157
 
158
158
  ///////////////////////////////////
@@ -164,7 +164,11 @@ class Range extends CoreFeature{
164
164
  _vDomBottom = this.table.rowManager.renderer.vDomBottom,
165
165
  _vDomLeft = this.table.columnManager.renderer.leftCol,
166
166
  _vDomRight = this.table.columnManager.renderer.rightCol,
167
- top, bottom, left, right, topLeftCell, bottomRightCell;
167
+ top, bottom, left, right, topLeftCell, bottomRightCell, topLeftCellEl, bottomRightCellEl, topLeftRowEl, bottomRightRowEl;
168
+
169
+ if(this.table.options.renderHorizontal === "virtual" && this.rangeManager.rowHeader) {
170
+ _vDomRight += 1;
171
+ }
168
172
 
169
173
  if (_vDomTop == null) {
170
174
  _vDomTop = 0;
@@ -190,14 +194,24 @@ class Range extends CoreFeature{
190
194
 
191
195
  topLeftCell = this.rangeManager.getCell(top, left);
192
196
  bottomRightCell = this.rangeManager.getCell(bottom, right);
197
+ topLeftCellEl = topLeftCell.getElement();
198
+ bottomRightCellEl = bottomRightCell.getElement();
199
+ topLeftRowEl = topLeftCell.row.getElement();
200
+ bottomRightRowEl = bottomRightCell.row.getElement();
193
201
 
194
202
  this.element.classList.add("tabulator-range-active");
195
203
  // this.element.classList.toggle("tabulator-range-active", this === this.rangeManager.activeRange);
204
+
205
+ if(this.table.rtl){
206
+ this.element.style.right = topLeftRowEl.offsetWidth - topLeftCellEl.offsetLeft - topLeftCellEl.offsetWidth + "px";
207
+ this.element.style.width = topLeftCellEl.offsetLeft + topLeftCellEl.offsetWidth - bottomRightCellEl.offsetLeft + "px";
208
+ }else{
209
+ this.element.style.left = topLeftRowEl.offsetLeft + topLeftCellEl.offsetLeft + "px";
210
+ this.element.style.width = bottomRightCellEl.offsetLeft + bottomRightCellEl.offsetWidth - topLeftCellEl.offsetLeft + "px";
211
+ }
196
212
 
197
- this.element.style.left = topLeftCell.row.getElement().offsetLeft + topLeftCell.getElement().offsetLeft + "px";
198
- this.element.style.top = topLeftCell.row.getElement().offsetTop + "px";
199
- this.element.style.width = bottomRightCell.getElement().offsetLeft + bottomRightCell.getElement().offsetWidth - topLeftCell.getElement().offsetLeft + "px";
200
- this.element.style.height = bottomRightCell.row.getElement().offsetTop + bottomRightCell.row.getElement().offsetHeight - topLeftCell.row.getElement().offsetTop + "px";
213
+ this.element.style.top = topLeftRowEl.offsetTop + "px";
214
+ this.element.style.height = bottomRightRowEl.offsetTop + bottomRightRowEl.offsetHeight - topLeftRowEl.offsetTop + "px";
201
215
  }
202
216
  }
203
217
 
@@ -349,6 +363,4 @@ class Range extends CoreFeature{
349
363
 
350
364
  return !this.destroyed;
351
365
  }
352
- }
353
-
354
- export default Range;
366
+ }
@@ -1,4 +1,4 @@
1
- class RangeComponent {
1
+ export default class RangeComponent {
2
2
  constructor(range) {
3
3
  this._range = range;
4
4
 
@@ -88,6 +88,4 @@ class RangeComponent {
88
88
  this._range.destroy(true);
89
89
  }
90
90
  }
91
- }
92
-
93
- export default RangeComponent;
91
+ }
@@ -1,7 +1,14 @@
1
1
  import Module from "../../core/Module.js";
2
2
  import Range from "./Range.js";
3
+ import extensions from './extensions/extensions.js';
3
4
 
4
- class SelectRange extends Module {
5
+
6
+ export default class SelectRange extends Module {
7
+
8
+ static moduleName = "selectRange";
9
+ static moduleInitOrder = 1;
10
+ static moduleExtensions = extensions;
11
+
5
12
  constructor(table) {
6
13
  super(table);
7
14
 
@@ -25,11 +32,11 @@ class SelectRange extends Module {
25
32
  this.registerTableOption("selectableRangeRows", false); //enable selectable range
26
33
  this.registerTableOption("selectableRangeClearCells", false); //allow clearing of active range
27
34
  this.registerTableOption("selectableRangeClearCellsValue", undefined); //value for cleared active range
28
-
35
+
29
36
  this.registerTableFunction("getRangesData", this.getRangesData.bind(this));
30
37
  this.registerTableFunction("getRanges", this.getRanges.bind(this));
31
38
  this.registerTableFunction("addRange", this.addRangeFromComponent.bind(this));
32
-
39
+
33
40
  this.registerComponentFunction("cell", "getRanges", this.cellGetRanges.bind(this));
34
41
  this.registerComponentFunction("row", "getRanges", this.rowGetRanges.bind(this));
35
42
  this.registerComponentFunction("column", "getRanges", this.colGetRanges.bind(this));
@@ -40,9 +47,8 @@ class SelectRange extends Module {
40
47
  ///////////////////////////////////
41
48
 
42
49
  initialize() {
43
- if (this.options("selectableRange")) {
50
+ if (this.options("selectableRange")) {
44
51
  if(!this.options("selectableRows")){
45
-
46
52
  this.maxRanges = this.options("selectableRange");
47
53
 
48
54
  this.initializeTable();
@@ -50,6 +56,14 @@ class SelectRange extends Module {
50
56
  }else{
51
57
  console.warn("SelectRange functionality cannot be used in conjunction with row selection");
52
58
  }
59
+
60
+ if(this.options('columns').findIndex((column) => column.frozen) > 0) {
61
+ console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior.");
62
+ }
63
+
64
+ if(this.options('columns').filter((column) => column.frozen) > 1) {
65
+ console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior.");
66
+ }
53
67
  }
54
68
  }
55
69
 
@@ -88,7 +102,7 @@ class SelectRange extends Module {
88
102
  this.subscribe("column-height", this.layoutChange.bind(this));
89
103
  this.subscribe("column-resized", this.layoutChange.bind(this));
90
104
  this.subscribe("columns-loaded", this.updateHeaderColumn.bind(this));
91
-
105
+
92
106
  this.subscribe("cell-height", this.layoutChange.bind(this));
93
107
  this.subscribe("cell-rendered", this.renderCell.bind(this));
94
108
  this.subscribe("cell-mousedown", this.handleCellMouseDown.bind(this));
@@ -97,7 +111,7 @@ class SelectRange extends Module {
97
111
  this.subscribe("cell-editing", this.handleEditingCell.bind(this));
98
112
 
99
113
  this.subscribe("page-changed", this.redraw.bind(this));
100
-
114
+
101
115
  this.subscribe("scroll-vertical", this.layoutChange.bind(this));
102
116
  this.subscribe("scroll-horizontal", this.layoutChange.bind(this));
103
117
 
@@ -134,6 +148,8 @@ class SelectRange extends Module {
134
148
  }
135
149
 
136
150
  updateHeaderColumn(){
151
+ var frozenCols;
152
+
137
153
  if(this.rowSelection){
138
154
  this.rowHeader = this.table.columnManager.getVisibleColumnsByIndex()[0];
139
155
 
@@ -149,6 +165,15 @@ class SelectRange extends Module {
149
165
  }
150
166
  }
151
167
  }
168
+
169
+ //warn if invalid frozen column configuration detected
170
+ if(this.table.modules.frozenColumns && this.table.modules.frozenColumns.active){
171
+ frozenCols = this.table.modules.frozenColumns.getFrozenColumns();
172
+
173
+ if(frozenCols.length > 1 || (frozenCols.length === 1 && frozenCols[0] !== this.rowHeader)){
174
+ console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior");
175
+ }
176
+ }
152
177
  }
153
178
 
154
179
  ///////////////////////////////////
@@ -214,12 +239,12 @@ class SelectRange extends Module {
214
239
  if (this.table.modules.edit && this.table.modules.edit.currentCell) {
215
240
  return;
216
241
  }
217
-
242
+
218
243
  this.table.modules.edit.editCell(this.getActiveCell());
219
244
 
220
245
  e.preventDefault();
221
246
  }
222
-
247
+
223
248
  if ((e.key === "Backspace" || e.key === "Delete") && this.options("selectableRangeClearCells")) {
224
249
  if(this.activeRange){
225
250
  this.activeRange.clearValues();
@@ -346,7 +371,7 @@ class SelectRange extends Module {
346
371
  finishEditingCell() {
347
372
  this.blockKeydown = true;
348
373
  this.table.rowManager.element.focus();
349
-
374
+
350
375
  setTimeout(() => {
351
376
  this.blockKeydown = false;
352
377
  }, 10);
@@ -590,7 +615,7 @@ class SelectRange extends Module {
590
615
  this.selecting = "all";
591
616
 
592
617
  var topLeftCell, bottomRightCell = this.getCell(-1, -1);
593
-
618
+
594
619
  if(this.rowHeader){
595
620
  topLeftCell = this.getCell(0, 1);
596
621
  }else{
@@ -620,7 +645,7 @@ class SelectRange extends Module {
620
645
  autoScroll(range, row, column) {
621
646
  var tableHolder = this.table.rowManager.element,
622
647
  rowHeader, rect, view, withinHorizontalView, withinVerticalView;
623
-
648
+
624
649
  if (typeof row === 'undefined') {
625
650
  row = this.getRowByRangePos(range.end.row).getElement();
626
651
  }
@@ -628,7 +653,7 @@ class SelectRange extends Module {
628
653
  if (typeof column === 'undefined') {
629
654
  column = this.getColumnByRangePos(range.end.col).getElement();
630
655
  }
631
-
656
+
632
657
  if (this.rowHeader) {
633
658
  rowHeader = this.rowHeader.getElement();
634
659
  }
@@ -646,7 +671,7 @@ class SelectRange extends Module {
646
671
  top: tableHolder.scrollTop,
647
672
  bottom: tableHolder.scrollTop + tableHolder.offsetHeight - this.table.rowManager.scrollbarWidth,
648
673
  };
649
-
674
+
650
675
  if (rowHeader) {
651
676
  view.left += rowHeader.offsetWidth;
652
677
  }
@@ -748,7 +773,7 @@ class SelectRange extends Module {
748
773
  }
749
774
 
750
775
  layoutRanges() {
751
- var activeCell;
776
+ var activeCell, activeCellEl, activeRowEl;
752
777
 
753
778
  if (!this.table.initialized) {
754
779
  return;
@@ -759,11 +784,19 @@ class SelectRange extends Module {
759
784
  if (!activeCell) {
760
785
  return;
761
786
  }
762
-
763
- this.activeRangeCellElement.style.left = activeCell.row.getElement().offsetLeft + activeCell.getElement().offsetLeft + "px";
764
- this.activeRangeCellElement.style.top = activeCell.row.getElement().offsetTop + "px";
765
- this.activeRangeCellElement.style.width = activeCell.getElement().offsetLeft + activeCell.getElement().offsetWidth - activeCell.getElement().offsetLeft + "px";
766
- this.activeRangeCellElement.style.height = activeCell.row.getElement().offsetTop + activeCell.row.getElement().offsetHeight - activeCell.row.getElement().offsetTop + "px";
787
+
788
+ activeCellEl = activeCell.getElement();
789
+ activeRowEl = activeCell.row.getElement();
790
+
791
+ if(this.table.rtl){
792
+ this.activeRangeCellElement.style.right = activeRowEl.offsetWidth - activeCellEl.offsetLeft - activeCellEl.offsetWidth + "px";
793
+ }else{
794
+ this.activeRangeCellElement.style.left = activeRowEl.offsetLeft + activeCellEl.offsetLeft + "px";
795
+ }
796
+
797
+ this.activeRangeCellElement.style.top = activeRowEl.offsetTop + "px";
798
+ this.activeRangeCellElement.style.width = activeCellEl.offsetWidth + "px";
799
+ this.activeRangeCellElement.style.height = activeRowEl.offsetHeight + "px";
767
800
 
768
801
  this.ranges.forEach((range) => range.layout());
769
802
 
@@ -808,7 +841,7 @@ class SelectRange extends Module {
808
841
  }
809
842
 
810
843
  getTableRows() {
811
- return this.table.rowManager.getDisplayRows();
844
+ return this.table.rowManager.getDisplayRows().filter(row=> row.type === "row");
812
845
  }
813
846
 
814
847
  getTableColumns() {
@@ -832,7 +865,7 @@ class SelectRange extends Module {
832
865
  }
833
866
 
834
867
  resetRanges() {
835
- var range, cell;
868
+ var range, cell, visibleCells;
836
869
 
837
870
  this.ranges.forEach((range) => range.destroy());
838
871
  this.ranges = [];
@@ -840,7 +873,8 @@ class SelectRange extends Module {
840
873
  range = this.addRange();
841
874
 
842
875
  if(this.table.rowManager.activeRows.length){
843
- cell = this.table.rowManager.activeRows[0].cells[this.rowHeader ? 1 : 0];
876
+ visibleCells = this.table.rowManager.activeRows[0].cells.filter((cell) => cell.column.visible);
877
+ cell = visibleCells[this.rowHeader ? 1 : 0];
844
878
 
845
879
  if(cell){
846
880
  range.setBounds(cell);
@@ -863,8 +897,4 @@ class SelectRange extends Module {
863
897
  selectedColumns(component) {
864
898
  return component ? this.activeRange.getColumns().map((col) => col.getComponent()) : this.activeRange.getColumns();
865
899
  }
866
- }
867
-
868
- SelectRange.moduleName = "selectRange";
869
-
870
- export default SelectRange;
900
+ }
@@ -0,0 +1,45 @@
1
+ export default {
2
+ range:function(data){
3
+ var rows = [],
4
+ range = this.table.modules.selectRange.activeRange,
5
+ singleCell = false,
6
+ bounds, startCell, startRow, rowWidth, dataLength;
7
+
8
+ dataLength = data.length;
9
+
10
+ if(range){
11
+ bounds = range.getBounds();
12
+ startCell = bounds.start;
13
+
14
+ if(bounds.start === bounds.end){
15
+ singleCell = true;
16
+ }
17
+
18
+ if(startCell){
19
+ rows = this.table.rowManager.activeRows.slice();
20
+ startRow = rows.indexOf(startCell.row);
21
+
22
+ if(singleCell){
23
+ rowWidth = data.length;
24
+ }else{
25
+ rowWidth = (rows.indexOf(bounds.end.row) - startRow) + 1;
26
+ }
27
+
28
+
29
+ if(startRow >-1){
30
+ this.table.blockRedraw();
31
+
32
+ rows = rows.slice(startRow, startRow + rowWidth);
33
+
34
+ rows.forEach((row, i) => {
35
+ row.updateData(data[i % dataLength]);
36
+ });
37
+
38
+ this.table.restoreRedraw();
39
+ }
40
+ }
41
+ }
42
+
43
+ return rows;
44
+ }
45
+ };
@@ -0,0 +1,57 @@
1
+ export default {
2
+ range:function(clipboard){
3
+ var data = [],
4
+ rows = [],
5
+ range = this.table.modules.selectRange.activeRange,
6
+ singleCell = false,
7
+ bounds, startCell, colWidth, columnMap, startCol;
8
+
9
+ if(range){
10
+ bounds = range.getBounds();
11
+ startCell = bounds.start;
12
+
13
+ if(bounds.start === bounds.end){
14
+ singleCell = true;
15
+ }
16
+
17
+ if(startCell){
18
+ //get data from clipboard into array of columns and rows.
19
+ clipboard = clipboard.split("\n");
20
+
21
+ clipboard.forEach(function(row){
22
+ data.push(row.split("\t"));
23
+ });
24
+
25
+ if(data.length){
26
+ columnMap = this.table.columnManager.getVisibleColumnsByIndex();
27
+ startCol = columnMap.indexOf(startCell.column);
28
+
29
+ if(startCol > -1){
30
+ if(singleCell){
31
+ colWidth = data[0].length;
32
+ }else{
33
+ colWidth = (columnMap.indexOf(bounds.end.column) - startCol) + 1;
34
+ }
35
+
36
+ columnMap = columnMap.slice(startCol, startCol + colWidth);
37
+
38
+ data.forEach((item) => {
39
+ var row = {};
40
+ var itemLength = item.length;
41
+
42
+ columnMap.forEach(function(col, i){
43
+ row[col.field] = item[i % itemLength];
44
+ });
45
+
46
+ rows.push(row);
47
+ });
48
+
49
+ return rows;
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ return false;
56
+ }
57
+ };
@@ -0,0 +1,11 @@
1
+ export default {
2
+ range:function(){
3
+ var columns = this.modules.selectRange.selectedColumns();
4
+
5
+ if(this.columnManager.rowHeader){
6
+ columns.unshift(this.columnManager.rowHeader);
7
+ }
8
+
9
+ return columns;
10
+ },
11
+ };
@@ -0,0 +1,5 @@
1
+ export default {
2
+ range:function(){
3
+ return this.modules.selectRange.selectedRows();
4
+ },
5
+ };
@@ -0,0 +1,21 @@
1
+ import bindings from './keybindings/bindings.js';
2
+ import actions from './keybindings/actions.js';
3
+ import pasteActions from './clipboard/pasteActions.js';
4
+ import pasteParsers from './clipboard/pasteParsers.js';
5
+ import columnLookups from './export/columnLookups.js';
6
+ import rowLookups from './export/rowLookups.js';
7
+
8
+ export default {
9
+ keybindings:{
10
+ bindings:bindings,
11
+ actions:actions
12
+ },
13
+ clipboard:{
14
+ pasteActions:pasteActions,
15
+ pasteParsers:pasteParsers
16
+ },
17
+ export:{
18
+ columnLookups:columnLookups,
19
+ rowLookups:rowLookups,
20
+ }
21
+ };
@@ -0,0 +1,38 @@
1
+ export default {
2
+ rangeJumpLeft: function(e){
3
+ this.dispatch("keybinding-nav-range", e, "left", true, false);
4
+ },
5
+ rangeJumpRight: function(e){
6
+ this.dispatch("keybinding-nav-range", e, "right", true, false);
7
+ },
8
+ rangeJumpUp: function(e){
9
+ this.dispatch("keybinding-nav-range", e, "up", true, false);
10
+ },
11
+ rangeJumpDown: function(e){
12
+ this.dispatch("keybinding-nav-range", e, "down", true, false);
13
+ },
14
+ rangeExpandLeft: function(e){
15
+ this.dispatch("keybinding-nav-range", e, "left", false, true);
16
+ },
17
+ rangeExpandRight: function(e){
18
+ this.dispatch("keybinding-nav-range", e, "right", false, true);
19
+ },
20
+ rangeExpandUp: function(e){
21
+ this.dispatch("keybinding-nav-range", e, "up", false, true);
22
+ },
23
+ rangeExpandDown: function(e){
24
+ this.dispatch("keybinding-nav-range", e, "down", false, true);
25
+ },
26
+ rangeExpandJumpLeft: function(e){
27
+ this.dispatch("keybinding-nav-range", e, "left", true, true);
28
+ },
29
+ rangeExpandJumpRight: function(e){
30
+ this.dispatch("keybinding-nav-range", e, "right", true, true);
31
+ },
32
+ rangeExpandJumpUp: function(e){
33
+ this.dispatch("keybinding-nav-range", e, "up", true, true);
34
+ },
35
+ rangeExpandJumpDown: function(e){
36
+ this.dispatch("keybinding-nav-range", e, "down", true, true);
37
+ },
38
+ };
@@ -0,0 +1,14 @@
1
+ export default {
2
+ rangeJumpUp:["ctrl + 38", "meta + 38"],
3
+ rangeJumpDown:["ctrl + 40", "meta + 40"],
4
+ rangeJumpLeft:["ctrl + 37", "meta + 37"],
5
+ rangeJumpRight:["ctrl + 39", "meta + 39"],
6
+ rangeExpandUp:"shift + 38",
7
+ rangeExpandDown:"shift + 40",
8
+ rangeExpandLeft:"shift + 37",
9
+ rangeExpandRight:"shift + 39",
10
+ rangeExpandJumpUp:["ctrl + shift + 38", "meta + shift + 38"],
11
+ rangeExpandJumpDown:["ctrl + shift + 40", "meta + shift + 40"],
12
+ rangeExpandJumpLeft:["ctrl + shift + 37", "meta + shift + 37"],
13
+ rangeExpandJumpRight:["ctrl + shift + 39", "meta + shift + 39"],
14
+ };
@@ -1,6 +1,10 @@
1
1
  import Module from '../../core/Module.js';
2
+ import extensions from './extensions/extensions.js';
2
3
 
3
- class SelectRow extends Module{
4
+ export default class SelectRow extends Module{
5
+
6
+ static moduleName = "selectRow";
7
+ static moduleExtensions = extensions;
4
8
 
5
9
  constructor(table){
6
10
  super(table);
@@ -51,11 +55,11 @@ class SelectRow extends Module{
51
55
  }
52
56
 
53
57
  deprecatedOptionsCheck(){
54
- this.deprecationCheck("selectable", "selectableRows", true);
55
- this.deprecationCheck("selectableRollingSelection", "selectableRowsRollingSelection", true);
56
- this.deprecationCheck("selectableRangeMode", "selectableRowsRangeMode", true);
57
- this.deprecationCheck("selectablePersistence", "selectableRowsPersistence", true);
58
- this.deprecationCheck("selectableCheck", "selectableRowsCheck", true);
58
+ // this.deprecationCheck("selectable", "selectableRows", true);
59
+ // this.deprecationCheck("selectableRollingSelection", "selectableRowsRollingSelection", true);
60
+ // this.deprecationCheck("selectableRangeMode", "selectableRowsRangeMode", true);
61
+ // this.deprecationCheck("selectablePersistence", "selectableRowsPersistence", true);
62
+ // this.deprecationCheck("selectableCheck", "selectableRowsCheck", true);
59
63
  }
60
64
 
61
65
  rowRetrieve(type, prevValue){
@@ -476,7 +480,7 @@ class SelectRow extends Module{
476
480
  }
477
481
 
478
482
  childRowSelection(row, select){
479
- var children = this.table.modules.dataTree.getChildren(row, true);
483
+ var children = this.table.modules.dataTree.getChildren(row, true, true);
480
484
 
481
485
  if(select){
482
486
  for(let child of children){
@@ -488,8 +492,4 @@ class SelectRow extends Module{
488
492
  }
489
493
  }
490
494
  }
491
- }
492
-
493
- SelectRow.moduleName = "selectRow";
494
-
495
- export default SelectRow;
495
+ }
@@ -0,0 +1,9 @@
1
+ import rowSelection from './formatters/rowSelection.js';
2
+
3
+ export default {
4
+ format:{
5
+ formatters:{
6
+ rowSelection:rowSelection,
7
+ }
8
+ }
9
+ };
@@ -2,7 +2,12 @@ import Module from '../../core/Module.js';
2
2
 
3
3
  import defaultSorters from './defaults/sorters.js';
4
4
 
5
- class Sort extends Module{
5
+ export default class Sort extends Module{
6
+
7
+ static moduleName = "sort";
8
+
9
+ //load defaults
10
+ static sorters = defaultSorters;
6
11
 
7
12
  constructor(table){
8
13
  super(table);
@@ -333,7 +338,7 @@ class Sort extends Module{
333
338
  }
334
339
 
335
340
  //work through sort list sorting data
336
- sort(data){
341
+ sort(data, sortOnly){
337
342
  var self = this,
338
343
  sortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,
339
344
  sortListActual = [],
@@ -343,7 +348,9 @@ class Sort extends Module{
343
348
  this.dispatchExternal("dataSorting", self.getSort());
344
349
  }
345
350
 
346
- self.clearColumnHeaders();
351
+ if(!sortOnly) {
352
+ self.clearColumnHeaders();
353
+ }
347
354
 
348
355
  if(this.table.options.sortMode !== "remote"){
349
356
 
@@ -366,7 +373,9 @@ class Sort extends Module{
366
373
  sortListActual.push(item);
367
374
  }
368
375
 
369
- self.setColumnHeader(item.column, item.dir);
376
+ if(!sortOnly) {
377
+ self.setColumnHeader(item.column, item.dir);
378
+ }
370
379
  }
371
380
  });
372
381
 
@@ -375,11 +384,12 @@ class Sort extends Module{
375
384
  self._sortItems(data, sortListActual);
376
385
  }
377
386
 
378
- }else{
387
+ }else if(!sortOnly) {
379
388
  sortList.forEach(function(item, i){
380
389
  self.setColumnHeader(item.column, item.dir);
381
390
  });
382
391
  }
392
+
383
393
 
384
394
  if(this.subscribedExternal("dataSorted")){
385
395
  data.forEach((row) => {
@@ -467,11 +477,4 @@ class Sort extends Module{
467
477
 
468
478
  return column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);
469
479
  }
470
- }
471
-
472
- Sort.moduleName = "sort";
473
-
474
- //load defaults
475
- Sort.sorters = defaultSorters;
476
-
477
- export default Sort;
480
+ }