tabulator-tables 5.4.2 → 5.4.3

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 (66) hide show
  1. package/dist/css/tabulator.css +1 -0
  2. package/dist/css/tabulator.css.map +1 -1
  3. package/dist/css/tabulator.min.css +1 -1
  4. package/dist/css/tabulator.min.css.map +1 -1
  5. package/dist/css/tabulator_bootstrap3.css +1 -0
  6. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  7. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  8. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  9. package/dist/css/tabulator_bootstrap4.css +1 -0
  10. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  11. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  12. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  13. package/dist/css/tabulator_bootstrap5.css +1 -0
  14. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  15. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  16. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  17. package/dist/css/tabulator_bulma.css +1 -0
  18. package/dist/css/tabulator_bulma.css.map +1 -1
  19. package/dist/css/tabulator_bulma.min.css +1 -1
  20. package/dist/css/tabulator_bulma.min.css.map +1 -1
  21. package/dist/css/tabulator_materialize.css +1 -0
  22. package/dist/css/tabulator_materialize.css.map +1 -1
  23. package/dist/css/tabulator_materialize.min.css +1 -1
  24. package/dist/css/tabulator_materialize.min.css.map +1 -1
  25. package/dist/css/tabulator_midnight.css +1 -0
  26. package/dist/css/tabulator_midnight.css.map +1 -1
  27. package/dist/css/tabulator_midnight.min.css +1 -1
  28. package/dist/css/tabulator_midnight.min.css.map +1 -1
  29. package/dist/css/tabulator_modern.css +1 -0
  30. package/dist/css/tabulator_modern.css.map +1 -1
  31. package/dist/css/tabulator_modern.min.css +1 -1
  32. package/dist/css/tabulator_modern.min.css.map +1 -1
  33. package/dist/css/tabulator_semanticui.css +1 -0
  34. package/dist/css/tabulator_semanticui.css.map +1 -1
  35. package/dist/css/tabulator_semanticui.min.css +1 -1
  36. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  37. package/dist/css/tabulator_simple.css +1 -0
  38. package/dist/css/tabulator_simple.css.map +1 -1
  39. package/dist/css/tabulator_simple.min.css +1 -1
  40. package/dist/css/tabulator_simple.min.css.map +1 -1
  41. package/dist/css/tabulator_site.css +1 -0
  42. package/dist/css/tabulator_site.css.map +1 -1
  43. package/dist/css/tabulator_site.min.css +1 -1
  44. package/dist/css/tabulator_site.min.css.map +1 -1
  45. package/dist/js/tabulator.js +280 -222
  46. package/dist/js/tabulator.js.map +1 -1
  47. package/dist/js/tabulator.min.js +2 -2
  48. package/dist/js/tabulator.min.js.map +1 -1
  49. package/dist/js/tabulator_esm.js +280 -222
  50. package/dist/js/tabulator_esm.js.map +1 -1
  51. package/dist/js/tabulator_esm.min.js +2 -2
  52. package/dist/js/tabulator_esm.min.js.map +1 -1
  53. package/package.json +1 -1
  54. package/src/js/core/RowManager.js +49 -30
  55. package/src/js/core/Tabulator.js +7 -8
  56. package/src/js/core/tools/Popup.js +1 -1
  57. package/src/js/modules/Edit/List.js +1 -1
  58. package/src/js/modules/Edit/inputMask.js +1 -1
  59. package/src/js/modules/Export/Export.js +151 -145
  60. package/src/js/modules/Filter/Filter.js +11 -8
  61. package/src/js/modules/GroupRows/Group.js +10 -7
  62. package/src/js/modules/GroupRows/GroupRows.js +23 -7
  63. package/src/js/modules/Localize/Localize.js +0 -9
  64. package/src/js/modules/Print/Print.js +15 -2
  65. package/src/js/modules/SelectRow/SelectRow.js +10 -2
  66. package/src/scss/tabulator.scss +1 -0
@@ -4,57 +4,57 @@ import ExportRow from './ExportRow.js';
4
4
  import ExportColumn from './ExportColumn.js';
5
5
 
6
6
  class Export extends Module{
7
-
7
+
8
8
  constructor(table){
9
9
  super(table);
10
-
10
+
11
11
  this.config = {};
12
12
  this.cloneTableStyle = true;
13
13
  this.colVisProp = "";
14
-
14
+
15
15
  this.registerTableOption("htmlOutputConfig", false); //html output config
16
-
16
+
17
17
  this.registerColumnOption("htmlOutput");
18
18
  this.registerColumnOption("titleHtmlOutput");
19
19
  }
20
-
20
+
21
21
  initialize(){
22
22
  this.registerTableFunction("getHtml", this.getHtml.bind(this));
23
23
  }
24
-
24
+
25
25
  ///////////////////////////////////
26
26
  ///////// Table Functions /////////
27
27
  ///////////////////////////////////
28
-
29
-
28
+
29
+
30
30
  ///////////////////////////////////
31
31
  ///////// Internal Logic //////////
32
32
  ///////////////////////////////////
33
-
33
+
34
34
  generateExportList(config, style, range, colVisProp){
35
35
  this.cloneTableStyle = style;
36
36
  this.config = config || {};
37
37
  this.colVisProp = colVisProp;
38
-
38
+
39
39
  var headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];
40
40
  var body = this.bodyToExportRows(this.rowLookup(range));
41
-
41
+
42
42
  return headers.concat(body);
43
43
  }
44
-
44
+
45
45
  generateTable(config, style, range, colVisProp){
46
46
  var list = this.generateExportList(config, style, range, colVisProp);
47
-
47
+
48
48
  return this.generateTableElement(list);
49
49
  }
50
-
50
+
51
51
  rowLookup(range){
52
52
  var rows = [];
53
-
53
+
54
54
  if(typeof range == "function"){
55
55
  range.call(this.table).forEach((row) =>{
56
56
  row = this.table.rowManager.findRow(row);
57
-
57
+
58
58
  if(row){
59
59
  rows.push(row);
60
60
  }
@@ -65,15 +65,15 @@ class Export extends Module{
65
65
  case "visible":
66
66
  rows = this.table.rowManager.getVisibleRows(false, true);
67
67
  break;
68
-
68
+
69
69
  case "all":
70
70
  rows = this.table.rowManager.rows;
71
71
  break;
72
-
72
+
73
73
  case "selected":
74
74
  rows = this.table.modules.selectRow.selectedRows;
75
75
  break;
76
-
76
+
77
77
  case "active":
78
78
  default:
79
79
  if(this.table.options.pagination){
@@ -83,56 +83,56 @@ class Export extends Module{
83
83
  }
84
84
  }
85
85
  }
86
-
86
+
87
87
  return Object.assign([], rows);
88
88
  }
89
-
89
+
90
90
  generateColumnGroupHeaders(){
91
91
  var output = [];
92
-
92
+
93
93
  var columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;
94
-
94
+
95
95
  columns.forEach((column) => {
96
96
  var colData = this.processColumnGroup(column);
97
-
97
+
98
98
  if(colData){
99
99
  output.push(colData);
100
100
  }
101
101
  });
102
-
102
+
103
103
  return output;
104
104
  }
105
-
105
+
106
106
  processColumnGroup(column){
107
107
  var subGroups = column.columns,
108
108
  maxDepth = 0,
109
109
  title = column.definition["title" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;
110
-
110
+
111
111
  var groupData = {
112
112
  title:title,
113
113
  column:column,
114
114
  depth:1,
115
115
  };
116
-
116
+
117
117
  if(subGroups.length){
118
118
  groupData.subGroups = [];
119
119
  groupData.width = 0;
120
-
120
+
121
121
  subGroups.forEach((subGroup) => {
122
122
  var subGroupData = this.processColumnGroup(subGroup);
123
-
123
+
124
124
  if(subGroupData){
125
125
  groupData.width += subGroupData.width;
126
126
  groupData.subGroups.push(subGroupData);
127
-
127
+
128
128
  if(subGroupData.depth > maxDepth){
129
129
  maxDepth = subGroupData.depth;
130
130
  }
131
131
  }
132
132
  });
133
-
133
+
134
134
  groupData.depth += maxDepth;
135
-
135
+
136
136
  if(!groupData.width){
137
137
  return false;
138
138
  }
@@ -143,75 +143,75 @@ class Export extends Module{
143
143
  return false;
144
144
  }
145
145
  }
146
-
146
+
147
147
  return groupData;
148
148
  }
149
-
149
+
150
150
  columnVisCheck(column){
151
151
  var visProp = column.definition[this.colVisProp];
152
-
152
+
153
153
  if(typeof visProp === "function"){
154
154
  visProp = visProp.call(this.table, column.getComponent());
155
155
  }
156
-
156
+
157
157
  return visProp !== false && (column.visible || (!column.visible && visProp));
158
158
  }
159
-
159
+
160
160
  headersToExportRows(columns){
161
161
  var headers = [],
162
162
  headerDepth = 0,
163
163
  exportRows = [];
164
-
164
+
165
165
  function parseColumnGroup(column, level){
166
-
166
+
167
167
  var depth = headerDepth - level;
168
-
168
+
169
169
  if(typeof headers[level] === "undefined"){
170
170
  headers[level] = [];
171
171
  }
172
-
172
+
173
173
  column.height = column.subGroups ? 1 : (depth - column.depth) + 1;
174
-
174
+
175
175
  headers[level].push(column);
176
-
176
+
177
177
  if(column.height > 1){
178
178
  for(let i = 1; i < column.height; i ++){
179
-
179
+
180
180
  if(typeof headers[level + i] === "undefined"){
181
181
  headers[level + i] = [];
182
182
  }
183
-
183
+
184
184
  headers[level + i].push(false);
185
185
  }
186
186
  }
187
-
187
+
188
188
  if(column.width > 1){
189
189
  for(let i = 1; i < column.width; i ++){
190
190
  headers[level].push(false);
191
191
  }
192
192
  }
193
-
193
+
194
194
  if(column.subGroups){
195
195
  column.subGroups.forEach(function(subGroup){
196
196
  parseColumnGroup(subGroup, level+1);
197
197
  });
198
198
  }
199
199
  }
200
-
200
+
201
201
  //calculate maximum header depth
202
202
  columns.forEach(function(column){
203
203
  if(column.depth > headerDepth){
204
204
  headerDepth = column.depth;
205
205
  }
206
206
  });
207
-
207
+
208
208
  columns.forEach(function(column){
209
209
  parseColumnGroup(column,0);
210
210
  });
211
-
211
+
212
212
  headers.forEach((header) => {
213
213
  var columns = [];
214
-
214
+
215
215
  header.forEach((col) => {
216
216
  if(col){
217
217
  let title = typeof col.title === "undefined" ? "" : col.title;
@@ -220,78 +220,78 @@ class Export extends Module{
220
220
  columns.push(null);
221
221
  }
222
222
  });
223
-
223
+
224
224
  exportRows.push(new ExportRow("header", columns));
225
225
  });
226
-
226
+
227
227
  return exportRows;
228
228
  }
229
-
229
+
230
230
  bodyToExportRows(rows){
231
-
231
+
232
232
  var columns = [];
233
233
  var exportRows = [];
234
-
234
+
235
235
  this.table.columnManager.columnsByIndex.forEach((column) => {
236
236
  if (this.columnVisCheck(column)) {
237
237
  columns.push(column.getComponent());
238
238
  }
239
239
  });
240
-
240
+
241
241
  if(this.config.columnCalcs !== false && this.table.modExists("columnCalcs")){
242
242
  if(this.table.modules.columnCalcs.topInitialized){
243
243
  rows.unshift(this.table.modules.columnCalcs.topRow);
244
244
  }
245
-
245
+
246
246
  if(this.table.modules.columnCalcs.botInitialized){
247
247
  rows.push(this.table.modules.columnCalcs.botRow);
248
248
  }
249
249
  }
250
-
250
+
251
251
  rows = rows.filter((row) => {
252
252
  switch(row.type){
253
253
  case "group":
254
254
  return this.config.rowGroups !== false;
255
-
255
+
256
256
  case "calc":
257
257
  return this.config.columnCalcs !== false;
258
-
258
+
259
259
  case "row":
260
260
  return !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);
261
261
  }
262
-
262
+
263
263
  return true;
264
264
  });
265
-
265
+
266
266
  rows.forEach((row, i) => {
267
267
  var rowData = row.getData(this.colVisProp);
268
268
  var exportCols = [];
269
269
  var indent = 0;
270
-
270
+
271
271
  switch(row.type){
272
272
  case "group":
273
273
  indent = row.level;
274
274
  exportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));
275
275
  break;
276
-
276
+
277
277
  case "calc" :
278
278
  case "row" :
279
279
  columns.forEach((col) => {
280
280
  exportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));
281
281
  });
282
-
282
+
283
283
  if(this.table.options.dataTree && this.config.dataTree !== false){
284
284
  indent = row.modules.dataTree.index;
285
285
  }
286
286
  break;
287
287
  }
288
-
288
+
289
289
  exportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));
290
290
  });
291
-
291
+
292
292
  return exportRows;
293
293
  }
294
-
294
+
295
295
  generateTableElement(list){
296
296
  var table = document.createElement("table"),
297
297
  headerEl = document.createElement("thead"),
@@ -299,68 +299,68 @@ class Export extends Module{
299
299
  styles = this.lookupTableStyles(),
300
300
  rowFormatter = this.table.options["rowFormatter" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],
301
301
  setup = {};
302
-
302
+
303
303
  setup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;
304
-
304
+
305
305
  if(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists("columnCalcs")){
306
306
  setup.treeElementField = this.table.modules.dataTree.elementField;
307
307
  }
308
-
308
+
309
309
  //assign group header formatter
310
310
  setup.groupHeader = this.table.options["groupHeader" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];
311
-
311
+
312
312
  if(setup.groupHeader && !Array.isArray(setup.groupHeader)){
313
313
  setup.groupHeader = [setup.groupHeader];
314
314
  }
315
-
315
+
316
316
  table.classList.add("tabulator-print-table");
317
-
317
+
318
318
  this.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, ["border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]);
319
-
320
-
319
+
320
+
321
321
  if(list.length > 1000){
322
322
  console.warn("It may take a long time to render an HTML table with more than 1000 rows");
323
323
  }
324
-
324
+
325
325
  list.forEach((row, i) => {
326
326
  let rowEl;
327
-
327
+
328
328
  switch(row.type){
329
329
  case "header":
330
330
  headerEl.appendChild(this.generateHeaderElement(row, setup, styles));
331
331
  break;
332
-
332
+
333
333
  case "group":
334
334
  bodyEl.appendChild(this.generateGroupElement(row, setup, styles));
335
335
  break;
336
-
336
+
337
337
  case "calc":
338
338
  bodyEl.appendChild(this.generateCalcElement(row, setup, styles));
339
339
  break;
340
-
340
+
341
341
  case "row":
342
342
  rowEl = this.generateRowElement(row, setup, styles);
343
-
343
+
344
344
  this.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]);
345
345
  bodyEl.appendChild(rowEl);
346
346
  break;
347
347
  }
348
348
  });
349
-
349
+
350
350
  if(headerEl.innerHTML){
351
351
  table.appendChild(headerEl);
352
352
  }
353
-
353
+
354
354
  table.appendChild(bodyEl);
355
-
356
-
355
+
356
+
357
357
  this.mapElementStyles(this.table.element, table, ["border-top", "border-left", "border-right", "border-bottom"]);
358
358
  return table;
359
359
  }
360
-
360
+
361
361
  lookupTableStyles(){
362
362
  var styles = {};
363
-
363
+
364
364
  //lookup row styles
365
365
  if(this.cloneTableStyle && window.getComputedStyle){
366
366
  styles.oddRow = this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)");
@@ -368,41 +368,41 @@ class Export extends Module{
368
368
  styles.calcRow = this.table.element.querySelector(".tabulator-row.tabulator-calcs");
369
369
  styles.firstRow = this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)");
370
370
  styles.firstGroup = this.table.element.getElementsByClassName("tabulator-group")[0];
371
-
371
+
372
372
  if(styles.firstRow){
373
373
  styles.styleCells = styles.firstRow.getElementsByClassName("tabulator-cell");
374
374
  styles.firstCell = styles.styleCells[0];
375
375
  styles.lastCell = styles.styleCells[styles.styleCells.length - 1];
376
376
  }
377
377
  }
378
-
378
+
379
379
  return styles;
380
380
  }
381
-
381
+
382
382
  generateHeaderElement(row, setup, styles){
383
383
  var rowEl = document.createElement("tr");
384
-
384
+
385
385
  row.columns.forEach((column) => {
386
386
  if(column){
387
387
  var cellEl = document.createElement("th");
388
388
  var classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(" ") : [];
389
-
389
+
390
390
  cellEl.colSpan = column.width;
391
391
  cellEl.rowSpan = column.height;
392
-
392
+
393
393
  cellEl.innerHTML = column.value;
394
-
394
+
395
395
  if(this.cloneTableStyle){
396
396
  cellEl.style.boxSizing = "border-box";
397
397
  }
398
-
398
+
399
399
  classNames.forEach(function(className) {
400
400
  cellEl.classList.add(className);
401
401
  });
402
-
402
+
403
403
  this.mapElementStyles(column.component.getElement(), cellEl, ["text-align", "border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]);
404
404
  this.mapElementStyles(column.component._column.contentElement, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]);
405
-
405
+
406
406
  if(column.component._column.visible){
407
407
  this.mapElementStyles(column.component.getElement(), cellEl, ["width"]);
408
408
  }else{
@@ -410,26 +410,26 @@ class Export extends Module{
410
410
  cellEl.style.width = column.component._column.definition.width + "px";
411
411
  }
412
412
  }
413
-
413
+
414
414
  if(column.component._column.parent){
415
415
  this.mapElementStyles(column.component._column.parent.groupElement, cellEl, ["border-top"]);
416
416
  }
417
-
417
+
418
418
  rowEl.appendChild(cellEl);
419
419
  }
420
420
  });
421
-
421
+
422
422
  return rowEl;
423
423
  }
424
-
424
+
425
425
  generateGroupElement(row, setup, styles){
426
-
426
+
427
427
  var rowEl = document.createElement("tr"),
428
428
  cellEl = document.createElement("td"),
429
429
  group = row.columns[0];
430
-
430
+
431
431
  rowEl.classList.add("tabulator-print-table-row");
432
-
432
+
433
433
  if(setup.groupHeader && setup.groupHeader[row.indent]){
434
434
  group.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);
435
435
  }else{
@@ -437,39 +437,39 @@ class Export extends Module{
437
437
  group.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);
438
438
  }
439
439
  }
440
-
440
+
441
441
  cellEl.colSpan = group.width;
442
442
  cellEl.innerHTML = group.value;
443
-
443
+
444
444
  rowEl.classList.add("tabulator-print-table-group");
445
445
  rowEl.classList.add("tabulator-group-level-" + row.indent);
446
-
446
+
447
447
  if(group.component.isVisible()){
448
448
  rowEl.classList.add("tabulator-group-visible");
449
449
  }
450
-
450
+
451
451
  this.mapElementStyles(styles.firstGroup, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]);
452
452
  this.mapElementStyles(styles.firstGroup, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]);
453
-
453
+
454
454
  rowEl.appendChild(cellEl);
455
-
455
+
456
456
  return rowEl;
457
457
  }
458
-
458
+
459
459
  generateCalcElement(row, setup, styles){
460
460
  var rowEl = this.generateRowElement(row, setup, styles);
461
-
461
+
462
462
  rowEl.classList.add("tabulator-print-table-calcs");
463
463
  this.mapElementStyles(styles.calcRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]);
464
-
464
+
465
465
  return rowEl;
466
466
  }
467
-
467
+
468
468
  generateRowElement(row, setup, styles){
469
469
  var rowEl = document.createElement("tr");
470
-
470
+
471
471
  rowEl.classList.add("tabulator-print-table-row");
472
-
472
+
473
473
  row.columns.forEach((col, i) => {
474
474
  if(col){
475
475
  var cellEl = document.createElement("td"),
@@ -477,7 +477,7 @@ class Export extends Module{
477
477
  index = this.table.columnManager.findColumnIndex(column),
478
478
  value = col.value,
479
479
  cellStyle;
480
-
480
+
481
481
  var cellWrapper = {
482
482
  modules:{},
483
483
  getValue:function(){
@@ -503,13 +503,13 @@ class Export extends Module{
503
503
  },
504
504
  column:column,
505
505
  };
506
-
506
+
507
507
  var classNames = column.definition.cssClass ? column.definition.cssClass.split(" ") : [];
508
-
508
+
509
509
  classNames.forEach(function(className) {
510
510
  cellEl.classList.add(className);
511
511
  });
512
-
512
+
513
513
  if(this.table.modExists("format") && this.config.formatCells !== false){
514
514
  value = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);
515
515
  }else{
@@ -517,29 +517,29 @@ class Export extends Module{
517
517
  case "object":
518
518
  value = value !== null ? JSON.stringify(value) : "";
519
519
  break;
520
-
520
+
521
521
  case "undefined":
522
522
  value = "";
523
523
  break;
524
524
  }
525
525
  }
526
-
526
+
527
527
  if(value instanceof Node){
528
528
  cellEl.appendChild(value);
529
529
  }else{
530
530
  cellEl.innerHTML = value;
531
531
  }
532
-
532
+
533
533
  cellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;
534
-
534
+
535
535
  if(cellStyle){
536
536
  this.mapElementStyles(cellStyle, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "text-align"]);
537
-
537
+
538
538
  if(column.definition.align){
539
539
  cellEl.style.textAlign = column.definition.align;
540
540
  }
541
541
  }
542
-
542
+
543
543
  if(this.table.options.dataTree && this.config.dataTree !== false){
544
544
  if((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){
545
545
  if(row.component._row.modules.dataTree.controlEl){
@@ -550,39 +550,43 @@ class Export extends Module{
550
550
  }
551
551
  }
552
552
  }
553
-
553
+
554
554
  rowEl.appendChild(cellEl);
555
-
555
+
556
556
  if(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){
557
557
  cellWrapper.modules.format.renderedCallback();
558
558
  }
559
-
560
- if(setup.rowFormatter && this.config.formatCells !== false){
561
- setup.rowFormatter(row.component);
562
- }
563
559
  }
564
560
  });
561
+
562
+ if(setup.rowFormatter && row.type === "row" && this.config.formatCells !== false){
563
+ let formatComponent = Object.assign(row.component);
564
+
565
+ formatComponent.getElement = function(){return rowEl;};
565
566
 
567
+ setup.rowFormatter(row.component);
568
+ }
569
+
566
570
  return rowEl;
567
571
  }
568
-
572
+
569
573
  generateHTMLTable(list){
570
574
  var holder = document.createElement("div");
571
-
575
+
572
576
  holder.appendChild(this.generateTableElement(list));
573
-
577
+
574
578
  return holder.innerHTML;
575
579
  }
576
-
580
+
577
581
  getHtml(visible, style, config, colVisProp){
578
582
  var list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || "htmlOutput");
579
-
583
+
580
584
  return this.generateHTMLTable(list);
581
585
  }
582
-
586
+
583
587
  mapElementStyles(from, to, props){
584
588
  if(this.cloneTableStyle && from && to){
585
-
589
+
586
590
  var lookup = {
587
591
  "background-color" : "backgroundColor",
588
592
  "color" : "fontColor",
@@ -600,12 +604,14 @@ class Export extends Module{
600
604
  "padding-right" : "paddingRight",
601
605
  "padding-bottom" : "paddingBottom",
602
606
  };
603
-
607
+
604
608
  if(window.getComputedStyle){
605
609
  var fromStyle = window.getComputedStyle(from);
606
-
610
+
607
611
  props.forEach(function(prop){
608
- to.style[lookup[prop]] = fromStyle.getPropertyValue(prop);
612
+ if(!to.style[lookup[prop]]){
613
+ to.style[lookup[prop]] = fromStyle.getPropertyValue(prop);
614
+ }
609
615
  });
610
616
  }
611
617
  }