tabulator-tables 6.0.1 → 6.1.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.
@@ -1,4 +1,4 @@
1
- /* Tabulator v6.0.1 (c) Oliver Folkerd 2024 */
1
+ /* Tabulator v6.1.0 (c) Oliver Folkerd 2024 */
2
2
  class CoreFeature{
3
3
 
4
4
  constructor(table){
@@ -5078,7 +5078,7 @@ function pdf(list, options = {}, setFileContents){
5078
5078
  setFileContents(doc.output("arraybuffer"), "application/pdf");
5079
5079
  }
5080
5080
 
5081
- function xlsx(list, options, setFileContents){
5081
+ function xlsx$1(list, options, setFileContents){
5082
5082
  var self = this,
5083
5083
  sheetName = options.sheetName || "Sheet1",
5084
5084
  workbook = XLSX.utils.book_new(),
@@ -5223,7 +5223,7 @@ var defaultDownloaders = {
5223
5223
  json:json$1,
5224
5224
  jsonLines:jsonLines,
5225
5225
  pdf:pdf,
5226
- xlsx:xlsx,
5226
+ xlsx:xlsx$1,
5227
5227
  html:html$1,
5228
5228
  };
5229
5229
 
@@ -13258,10 +13258,18 @@ function array$1 (input){
13258
13258
  return input;
13259
13259
  }
13260
13260
 
13261
+ function xlsx(input, floop){
13262
+ var workbook2 = XLSX.read(input);
13263
+ var sheet = workbook2.Sheets[workbook2.SheetNames[0]];
13264
+
13265
+ return XLSX.utils.sheet_to_json(sheet, {});
13266
+ }
13267
+
13261
13268
  var defaultImporters = {
13262
13269
  csv:csv,
13263
13270
  json:json,
13264
13271
  array:array$1,
13272
+ xlsx:xlsx,
13265
13273
  };
13266
13274
 
13267
13275
  class Import extends Module{
@@ -13320,11 +13328,11 @@ class Import extends Module{
13320
13328
  return importer;
13321
13329
  }
13322
13330
 
13323
- importFromFile(importFormat, extension){
13331
+ importFromFile(importFormat, extension, importReader){
13324
13332
  var importer = this.lookupImporter(importFormat);
13325
13333
 
13326
13334
  if(importer){
13327
- return this.pickFile(extension)
13335
+ return this.pickFile(extension, importReader)
13328
13336
  .then(this.importData.bind(this, importer))
13329
13337
  .then(this.structureData.bind(this))
13330
13338
  .then(this.setData.bind(this))
@@ -13335,7 +13343,7 @@ class Import extends Module{
13335
13343
  }
13336
13344
  }
13337
13345
 
13338
- pickFile(extensions){
13346
+ pickFile(extensions, importReader){
13339
13347
  return new Promise((resolve, reject) => {
13340
13348
  var input = document.createElement("input");
13341
13349
  input.type = "file";
@@ -13345,7 +13353,7 @@ class Import extends Module{
13345
13353
  var file = input.files[0],
13346
13354
  reader = new FileReader();
13347
13355
 
13348
- switch(this.table.options.importReader){
13356
+ switch(importReader || this.table.options.importReader){
13349
13357
  case "buffer":
13350
13358
  reader.readAsArrayBuffer(file);
13351
13359
  break;