@loaders.gl/excel 4.0.0-alpha.4 → 4.0.0-alpha.6
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.
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +2 -2
- package/dist/dist.min.js +35871 -0
- package/dist/es5/bundle.js +6 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/excel-loader.js +29 -0
- package/dist/es5/excel-loader.js.map +1 -0
- package/dist/es5/index.js +42 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/lib/encode-excel.js +2 -0
- package/dist/es5/lib/encode-excel.js.map +1 -0
- package/dist/es5/lib/parse-excel.js +31 -0
- package/dist/es5/lib/parse-excel.js.map +1 -0
- package/dist/es5/workers/excel-worker.js +6 -0
- package/dist/es5/workers/excel-worker.js.map +1 -0
- package/dist/esm/bundle.js +4 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/excel-loader.js +21 -0
- package/dist/esm/excel-loader.js.map +1 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/encode-excel.js +2 -0
- package/dist/esm/lib/encode-excel.js.map +1 -0
- package/dist/esm/lib/parse-excel.js +25 -0
- package/dist/esm/lib/parse-excel.js.map +1 -0
- package/dist/esm/workers/excel-worker.js +4 -0
- package/dist/esm/workers/excel-worker.js.map +1 -0
- package/dist/excel-loader.d.ts +14 -0
- package/dist/excel-loader.d.ts.map +1 -0
- package/dist/excel-loader.js +29 -18
- package/dist/excel-worker.js +1502 -311
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -7
- package/dist/lib/encode-excel.d.ts +80 -0
- package/dist/lib/encode-excel.d.ts.map +1 -0
- package/dist/lib/encode-excel.js +80 -1
- package/dist/lib/parse-excel.d.ts +10 -0
- package/dist/lib/parse-excel.d.ts.map +1 -0
- package/dist/lib/parse-excel.js +44 -29
- package/dist/workers/excel-worker.d.ts +2 -0
- package/dist/workers/excel-worker.d.ts.map +1 -0
- package/dist/workers/excel-worker.js +5 -4
- package/package.json +9 -9
- package/src/excel-loader.ts +4 -1
- package/src/index.ts +10 -6
- package/src/lib/parse-excel.ts +5 -2
- package/dist/bundle.js.map +0 -1
- package/dist/excel-loader.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/encode-excel.js.map +0 -1
- package/dist/lib/parse-excel.js.map +0 -1
- package/dist/workers/excel-worker.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";;AACA,IAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports._typecheckLoader = exports.ExcelLoader = void 0;
|
|
7
|
+
var VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
|
|
8
|
+
var DEFAULT_EXCEL_LOADER_OPTIONS = {
|
|
9
|
+
excel: {
|
|
10
|
+
shape: 'object-row-table',
|
|
11
|
+
sheet: undefined
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var ExcelLoader = {
|
|
15
|
+
name: 'Excel',
|
|
16
|
+
id: 'excel',
|
|
17
|
+
module: 'excel',
|
|
18
|
+
version: VERSION,
|
|
19
|
+
worker: true,
|
|
20
|
+
extensions: ['xls', 'xlsb', 'xlsm', 'xlsx'],
|
|
21
|
+
mimeTypes: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel'],
|
|
22
|
+
category: 'table',
|
|
23
|
+
binary: true,
|
|
24
|
+
options: DEFAULT_EXCEL_LOADER_OPTIONS
|
|
25
|
+
};
|
|
26
|
+
exports.ExcelLoader = ExcelLoader;
|
|
27
|
+
var _typecheckLoader = ExcelLoader;
|
|
28
|
+
exports._typecheckLoader = _typecheckLoader;
|
|
29
|
+
//# sourceMappingURL=excel-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-loader.js","names":["VERSION","DEFAULT_EXCEL_LOADER_OPTIONS","excel","shape","sheet","undefined","ExcelLoader","name","id","module","version","worker","extensions","mimeTypes","category","binary","options","exports","_typecheckLoader"],"sources":["../../src/excel-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ObjectRowTable} from '@loaders.gl/schema';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type ExcelLoaderOptions = LoaderOptions & {\n excel?: {\n shape: /* 'array-row-table' | */ 'object-row-table';\n sheet?: string; // Load default Sheet\n };\n};\n\nconst DEFAULT_EXCEL_LOADER_OPTIONS: ExcelLoaderOptions = {\n excel: {\n shape: 'object-row-table',\n sheet: undefined // Load default Sheet\n }\n};\n\n/**\n * Worker Loader for Excel files\n */\nexport const ExcelLoader: Loader<ObjectRowTable, never, ExcelLoaderOptions> = {\n name: 'Excel',\n id: 'excel',\n module: 'excel',\n version: VERSION,\n worker: true,\n extensions: ['xls', 'xlsb', 'xlsm', 'xlsx'],\n mimeTypes: [\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'\n ],\n category: 'table',\n binary: true,\n options: DEFAULT_EXCEL_LOADER_OPTIONS\n};\n\nexport const _typecheckLoader: Loader = ExcelLoader;\n"],"mappings":";;;;;;AAOA,IAAMA,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAS3E,IAAMC,4BAAgD,GAAG;EACvDC,KAAK,EAAE;IACLC,KAAK,EAAE,kBAAkB;IACzBC,KAAK,EAAEC;EACT;AACF,CAAC;AAKM,IAAMC,WAA8D,GAAG;EAC5EC,IAAI,EAAE,OAAO;EACbC,EAAE,EAAE,OAAO;EACXC,MAAM,EAAE,OAAO;EACfC,OAAO,EAAEV,OAAO;EAChBW,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;EAC3CC,SAAS,EAAE,CACT,mEAAmE,EACnE,0BAA0B,CAC3B;EACDC,QAAQ,EAAE,OAAO;EACjBC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEf;AACX,CAAC;AAACgB,OAAA,CAAAX,WAAA,GAAAA,WAAA;AAEK,IAAMY,gBAAwB,GAAGZ,WAAW;AAACW,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ExcelLoader = void 0;
|
|
8
|
+
Object.defineProperty(exports, "ExcelWorkerLoader", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _excelLoader.ExcelLoader;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
+
var _excelLoader = require("./excel-loader");
|
|
18
|
+
var _parseExcel = require("./lib/parse-excel");
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
var ExcelLoader = _objectSpread(_objectSpread({}, _excelLoader.ExcelLoader), {}, {
|
|
22
|
+
parse: function parse(arrayBuffer, options) {
|
|
23
|
+
return (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
24
|
+
var data;
|
|
25
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
26
|
+
while (1) switch (_context.prev = _context.next) {
|
|
27
|
+
case 0:
|
|
28
|
+
data = (0, _parseExcel.parseExcel)(arrayBuffer, options);
|
|
29
|
+
return _context.abrupt("return", {
|
|
30
|
+
shape: 'object-row-table',
|
|
31
|
+
data: data
|
|
32
|
+
});
|
|
33
|
+
case 2:
|
|
34
|
+
case "end":
|
|
35
|
+
return _context.stop();
|
|
36
|
+
}
|
|
37
|
+
}, _callee);
|
|
38
|
+
}))();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
exports.ExcelLoader = ExcelLoader;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_excelLoader","require","_parseExcel","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","ExcelLoader","ExcelWorkerLoader","parse","arrayBuffer","options","_asyncToGenerator2","_regenerator","mark","_callee","data","wrap","_callee$","_context","prev","next","parseExcel","abrupt","shape","stop","exports"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ObjectRowTable} from '@loaders.gl/schema';\nimport type {ExcelLoaderOptions} from './excel-loader';\nimport {ExcelLoader as ExcelWorkerLoader} from './excel-loader';\nimport {parseExcel} from './lib/parse-excel';\n\n// Excel Loader\n\nexport type {ExcelLoaderOptions};\nexport {ExcelWorkerLoader};\n\n/**\n * Loader for Excel files\n */\nexport const ExcelLoader: LoaderWithParser<ObjectRowTable, never, ExcelLoaderOptions> = {\n ...ExcelWorkerLoader,\n async parse(arrayBuffer: ArrayBuffer, options?: ExcelLoaderOptions): Promise<ObjectRowTable> {\n const data = parseExcel(arrayBuffer, options);\n return {shape: 'object-row-table', data};\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAKA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAA6C,SAAAE,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,QAAAC,gBAAA,CAAAC,OAAA,EAAAR,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAmB,yBAAA,GAAAnB,MAAA,CAAAoB,gBAAA,CAAAV,MAAA,EAAAV,MAAA,CAAAmB,yBAAA,CAAAL,MAAA,KAAAlB,OAAA,CAAAI,MAAA,CAAAc,MAAA,GAAAC,OAAA,WAAAC,GAAA,IAAAhB,MAAA,CAAAqB,cAAA,CAAAX,MAAA,EAAAM,GAAA,EAAAhB,MAAA,CAAAK,wBAAA,CAAAS,MAAA,EAAAE,GAAA,iBAAAN,MAAA;AAUtC,IAAMY,WAAwE,GAAAb,aAAA,CAAAA,aAAA,KAChFc,wBAAiB;EACdC,KAAK,WAAAA,MAACC,WAAwB,EAAEC,OAA4B,EAA2B;IAAA,WAAAC,kBAAA,CAAAT,OAAA,EAAAU,YAAA,CAAAV,OAAA,CAAAW,IAAA,UAAAC,QAAA;MAAA,IAAAC,IAAA;MAAA,OAAAH,YAAA,CAAAV,OAAA,CAAAc,IAAA,UAAAC,SAAAC,QAAA;QAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;UAAA;YACrFL,IAAI,GAAG,IAAAM,sBAAU,EAACZ,WAAW,EAAEC,OAAO,CAAC;YAAA,OAAAQ,QAAA,CAAAI,MAAA,WACtC;cAACC,KAAK,EAAE,kBAAkB;cAAER,IAAI,EAAJA;YAAI,CAAC;UAAA;UAAA;YAAA,OAAAG,QAAA,CAAAM,IAAA;QAAA;MAAA,GAAAV,OAAA;IAAA;EAC1C;AAAC,EACF;AAACW,OAAA,CAAAnB,WAAA,GAAAA,WAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode-excel.js","names":[],"sources":["../../../src/lib/encode-excel.ts"],"sourcesContent":["// import * as xlsx from 'xlsx';\n\n/**\n * Saves JSON data in Excel format for html, ods, xml, xlsb and xlsx file types.\n * @param filePath Local data file path.\n * @param fileData Raw data to save.\n * @param tableName Table name for data files with multiple tables support.\n * @param showData Show saved data callback.\n *\n public saveData(filePath: string, fileData: any, tableName: string, showData?: Function): void {\n const fileType: string = filePath.substr(filePath.lastIndexOf('.'));\n fileData = this.jsonToExcelData(fileData, fileType, tableName);\n if ( fileData.length > 0) {\n // TODO: change this to async later\n fs.writeFile(filePath, fileData, (error) => showData(error));\n }\n }\n\n /**\n * Converts JSON data to Excel data formats.\n * @param jsonData Json data to convert.\n * @param bookType Excel data file/book type.\n *\n private jsonToExcelData(jsonData: any, fileType: string, tableName: string): any {\n console.debug('jsonToExcelData(): creating excel data:', fileType);\n\n // create new workbook\n const workbook = xlsx.utils.book_new();\n\n // convert json data to worksheet format\n const worksheet = xlsx.utils.json_to_sheet(jsonData, {\n //header: JSON.parse(this._viewConfig.columns)\n });\n\n // append worksheet to workbook\n xlsx.utils.book_append_sheet(workbook, worksheet, tableName);\n\n // get text data string or binary spreadsheet data buffer\n let data: any = '';\n if (fileType === 'html' || fileType === 'xml') {\n data = xlsx.write(workbook, {\n type: 'string',\n compression: false,\n bookType: getBookType(fileType)\n });\n } else {\n data = xlsx.write(workbook, {\n type: 'buffer',\n compression: true, // use zip compression for zip-based formats\n bookType: getBookType(fileType)\n });\n }\n return data;\n }\n\n\n}\n\n/**\n * Converts file type to Excel book type.\n * @param {string} fileType File type: .html, .ods, .xml, .xlsb, .xlsx, etc.\n * @returns {xlsx.BookType}\n *\nfunction getBookType(fileType) {\n // TODO: must be a better way to do this string to type conversion :)\n switch (fileType) {\n case '.html':\n return 'html';\n case '.ods':\n return 'ods';\n case '.xml':\n return 'xlml';\n case '.xlsb':\n return 'xlsb';\n case '.xlsx':\n return 'xlsx';\n default:\n return 'xlsb';\n }\n}\n*/\n"],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseExcel = parseExcel;
|
|
7
|
+
var _xlsx = require("xlsx");
|
|
8
|
+
var dataTableNamesMap = {};
|
|
9
|
+
function parseExcel(arrayBuffer, options) {
|
|
10
|
+
var dataUrl = 'dummy';
|
|
11
|
+
var workbook = (0, _xlsx.read)(arrayBuffer, {
|
|
12
|
+
type: 'array'
|
|
13
|
+
});
|
|
14
|
+
var dataRows = [];
|
|
15
|
+
dataTableNamesMap[dataUrl] = [];
|
|
16
|
+
if (workbook.SheetNames.length > 0) {
|
|
17
|
+
var _options$excel, _options$excel2;
|
|
18
|
+
if (workbook.SheetNames.length > 1) {
|
|
19
|
+
dataTableNamesMap[dataUrl] = workbook.SheetNames;
|
|
20
|
+
}
|
|
21
|
+
var sheetName = workbook.SheetNames[0];
|
|
22
|
+
if (options !== null && options !== void 0 && (_options$excel = options.excel) !== null && _options$excel !== void 0 && _options$excel.sheet && workbook.SheetNames.indexOf(options === null || options === void 0 ? void 0 : (_options$excel2 = options.excel) === null || _options$excel2 === void 0 ? void 0 : _options$excel2.sheet) >= 0) {
|
|
23
|
+
var _options$excel3;
|
|
24
|
+
sheetName = options === null || options === void 0 ? void 0 : (_options$excel3 = options.excel) === null || _options$excel3 === void 0 ? void 0 : _options$excel3.sheet;
|
|
25
|
+
}
|
|
26
|
+
var worksheet = workbook.Sheets[sheetName];
|
|
27
|
+
dataRows = _xlsx.utils.sheet_to_json(worksheet);
|
|
28
|
+
}
|
|
29
|
+
return dataRows;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=parse-excel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-excel.js","names":["_xlsx","require","dataTableNamesMap","parseExcel","arrayBuffer","options","dataUrl","workbook","read","type","dataRows","SheetNames","length","_options$excel","_options$excel2","sheetName","excel","sheet","indexOf","_options$excel3","worksheet","Sheets","utils","sheet_to_json"],"sources":["../../../src/lib/parse-excel.ts"],"sourcesContent":["import type {ExcelLoaderOptions} from '../excel-loader';\nimport {utils, read} from 'xlsx';\n// import {convertToArrayRow} from '@loaders.gl/schema';\n\n// local table names cache with dataUrl/tableNames array key/values\nconst dataTableNamesMap = {};\n\n/**\n * Gets local or remote Excel file data.\n * @param arrayBuffer Loaded data\n * @param options Data parse options.\n */\nexport function parseExcel(\n arrayBuffer: ArrayBuffer,\n options?: ExcelLoaderOptions\n): {[key: string]: unknown}[] {\n const dataUrl = 'dummy';\n // const dataFileType: string = dataUrl.substr(dataUrl.lastIndexOf('.')); // file extension\n\n // create Excel 'workbook'\n const workbook = read(arrayBuffer, {\n type: 'array'\n // cellDates: true\n });\n\n // load data sheets\n let dataRows: {[key: string]: unknown}[] = [];\n dataTableNamesMap[dataUrl] = [];\n if (workbook.SheetNames.length > 0) {\n if (workbook.SheetNames.length > 1) {\n // cache sheet names\n dataTableNamesMap[dataUrl] = workbook.SheetNames;\n // eslint-ignore-next-line\n // console.debug(`getData(): file: sheetNames:`, workbook.SheetNames);\n }\n\n // determine spreadsheet to load\n let sheetName = workbook.SheetNames[0];\n if (options?.excel?.sheet && workbook.SheetNames.indexOf(options?.excel?.sheet) >= 0) {\n // reset to requested table name\n sheetName = options?.excel?.sheet;\n }\n\n // get worksheet data row objects array\n const worksheet = workbook.Sheets[sheetName];\n dataRows = utils.sheet_to_json(worksheet);\n\n // const headers = dataRows.length ? Object.keys(dataRows[0]) : [];\n // if (options?.excel?.type === 'array-row-table') {\n // dataRows = dataRows.map(row => convertToArrayRow(row, headers))\n // }\n }\n\n return dataRows;\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAMC,iBAAiB,GAAG,CAAC,CAAC;AAOrB,SAASC,UAAUA,CACxBC,WAAwB,EACxBC,OAA4B,EACA;EAC5B,IAAMC,OAAO,GAAG,OAAO;EAIvB,IAAMC,QAAQ,GAAG,IAAAC,UAAI,EAACJ,WAAW,EAAE;IACjCK,IAAI,EAAE;EAER,CAAC,CAAC;EAGF,IAAIC,QAAoC,GAAG,EAAE;EAC7CR,iBAAiB,CAACI,OAAO,CAAC,GAAG,EAAE;EAC/B,IAAIC,QAAQ,CAACI,UAAU,CAACC,MAAM,GAAG,CAAC,EAAE;IAAA,IAAAC,cAAA,EAAAC,eAAA;IAClC,IAAIP,QAAQ,CAACI,UAAU,CAACC,MAAM,GAAG,CAAC,EAAE;MAElCV,iBAAiB,CAACI,OAAO,CAAC,GAAGC,QAAQ,CAACI,UAAU;IAGlD;IAGA,IAAII,SAAS,GAAGR,QAAQ,CAACI,UAAU,CAAC,CAAC,CAAC;IACtC,IAAIN,OAAO,aAAPA,OAAO,gBAAAQ,cAAA,GAAPR,OAAO,CAAEW,KAAK,cAAAH,cAAA,eAAdA,cAAA,CAAgBI,KAAK,IAAIV,QAAQ,CAACI,UAAU,CAACO,OAAO,CAACb,OAAO,aAAPA,OAAO,wBAAAS,eAAA,GAAPT,OAAO,CAAEW,KAAK,cAAAF,eAAA,uBAAdA,eAAA,CAAgBG,KAAK,CAAC,IAAI,CAAC,EAAE;MAAA,IAAAE,eAAA;MAEpFJ,SAAS,GAAGV,OAAO,aAAPA,OAAO,wBAAAc,eAAA,GAAPd,OAAO,CAAEW,KAAK,cAAAG,eAAA,uBAAdA,eAAA,CAAgBF,KAAK;IACnC;IAGA,IAAMG,SAAS,GAAGb,QAAQ,CAACc,MAAM,CAACN,SAAS,CAAC;IAC5CL,QAAQ,GAAGY,WAAK,CAACC,aAAa,CAACH,SAAS,CAAC;EAM3C;EAEA,OAAOV,QAAQ;AACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-worker.js","names":["_loaderUtils","require","_index","createLoaderWorker","ExcelLoader"],"sources":["../../../src/workers/excel-worker.ts"],"sourcesContent":["import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport {ExcelLoader} from '../index';\n\ncreateLoaderWorker(ExcelLoader);\n"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,+BAAkB,EAACC,kBAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
|
|
2
|
+
const DEFAULT_EXCEL_LOADER_OPTIONS = {
|
|
3
|
+
excel: {
|
|
4
|
+
shape: 'object-row-table',
|
|
5
|
+
sheet: undefined
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export const ExcelLoader = {
|
|
9
|
+
name: 'Excel',
|
|
10
|
+
id: 'excel',
|
|
11
|
+
module: 'excel',
|
|
12
|
+
version: VERSION,
|
|
13
|
+
worker: true,
|
|
14
|
+
extensions: ['xls', 'xlsb', 'xlsm', 'xlsx'],
|
|
15
|
+
mimeTypes: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel'],
|
|
16
|
+
category: 'table',
|
|
17
|
+
binary: true,
|
|
18
|
+
options: DEFAULT_EXCEL_LOADER_OPTIONS
|
|
19
|
+
};
|
|
20
|
+
export const _typecheckLoader = ExcelLoader;
|
|
21
|
+
//# sourceMappingURL=excel-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-loader.js","names":["VERSION","DEFAULT_EXCEL_LOADER_OPTIONS","excel","shape","sheet","undefined","ExcelLoader","name","id","module","version","worker","extensions","mimeTypes","category","binary","options","_typecheckLoader"],"sources":["../../src/excel-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ObjectRowTable} from '@loaders.gl/schema';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type ExcelLoaderOptions = LoaderOptions & {\n excel?: {\n shape: /* 'array-row-table' | */ 'object-row-table';\n sheet?: string; // Load default Sheet\n };\n};\n\nconst DEFAULT_EXCEL_LOADER_OPTIONS: ExcelLoaderOptions = {\n excel: {\n shape: 'object-row-table',\n sheet: undefined // Load default Sheet\n }\n};\n\n/**\n * Worker Loader for Excel files\n */\nexport const ExcelLoader: Loader<ObjectRowTable, never, ExcelLoaderOptions> = {\n name: 'Excel',\n id: 'excel',\n module: 'excel',\n version: VERSION,\n worker: true,\n extensions: ['xls', 'xlsb', 'xlsm', 'xlsx'],\n mimeTypes: [\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'\n ],\n category: 'table',\n binary: true,\n options: DEFAULT_EXCEL_LOADER_OPTIONS\n};\n\nexport const _typecheckLoader: Loader = ExcelLoader;\n"],"mappings":"AAOA,MAAMA,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAS3E,MAAMC,4BAAgD,GAAG;EACvDC,KAAK,EAAE;IACLC,KAAK,EAAE,kBAAkB;IACzBC,KAAK,EAAEC;EACT;AACF,CAAC;AAKD,OAAO,MAAMC,WAA8D,GAAG;EAC5EC,IAAI,EAAE,OAAO;EACbC,EAAE,EAAE,OAAO;EACXC,MAAM,EAAE,OAAO;EACfC,OAAO,EAAEV,OAAO;EAChBW,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;EAC3CC,SAAS,EAAE,CACT,mEAAmE,EACnE,0BAA0B,CAC3B;EACDC,QAAQ,EAAE,OAAO;EACjBC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEf;AACX,CAAC;AAED,OAAO,MAAMgB,gBAAwB,GAAGX,WAAW"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExcelLoader as ExcelWorkerLoader } from './excel-loader';
|
|
2
|
+
import { parseExcel } from './lib/parse-excel';
|
|
3
|
+
export { ExcelWorkerLoader };
|
|
4
|
+
export const ExcelLoader = {
|
|
5
|
+
...ExcelWorkerLoader,
|
|
6
|
+
async parse(arrayBuffer, options) {
|
|
7
|
+
const data = parseExcel(arrayBuffer, options);
|
|
8
|
+
return {
|
|
9
|
+
shape: 'object-row-table',
|
|
10
|
+
data
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ExcelLoader","ExcelWorkerLoader","parseExcel","parse","arrayBuffer","options","data","shape"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ObjectRowTable} from '@loaders.gl/schema';\nimport type {ExcelLoaderOptions} from './excel-loader';\nimport {ExcelLoader as ExcelWorkerLoader} from './excel-loader';\nimport {parseExcel} from './lib/parse-excel';\n\n// Excel Loader\n\nexport type {ExcelLoaderOptions};\nexport {ExcelWorkerLoader};\n\n/**\n * Loader for Excel files\n */\nexport const ExcelLoader: LoaderWithParser<ObjectRowTable, never, ExcelLoaderOptions> = {\n ...ExcelWorkerLoader,\n async parse(arrayBuffer: ArrayBuffer, options?: ExcelLoaderOptions): Promise<ObjectRowTable> {\n const data = parseExcel(arrayBuffer, options);\n return {shape: 'object-row-table', data};\n }\n};\n"],"mappings":"AAKA,SAAQA,WAAW,IAAIC,iBAAiB,QAAO,gBAAgB;AAC/D,SAAQC,UAAU,QAAO,mBAAmB;AAK5C,SAAQD,iBAAiB;AAKzB,OAAO,MAAMD,WAAwE,GAAG;EACtF,GAAGC,iBAAiB;EACpB,MAAME,KAAKA,CAACC,WAAwB,EAAEC,OAA4B,EAA2B;IAC3F,MAAMC,IAAI,GAAGJ,UAAU,CAACE,WAAW,EAAEC,OAAO,CAAC;IAC7C,OAAO;MAACE,KAAK,EAAE,kBAAkB;MAAED;IAAI,CAAC;EAC1C;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode-excel.js","names":[],"sources":["../../../src/lib/encode-excel.ts"],"sourcesContent":["// import * as xlsx from 'xlsx';\n\n/**\n * Saves JSON data in Excel format for html, ods, xml, xlsb and xlsx file types.\n * @param filePath Local data file path.\n * @param fileData Raw data to save.\n * @param tableName Table name for data files with multiple tables support.\n * @param showData Show saved data callback.\n *\n public saveData(filePath: string, fileData: any, tableName: string, showData?: Function): void {\n const fileType: string = filePath.substr(filePath.lastIndexOf('.'));\n fileData = this.jsonToExcelData(fileData, fileType, tableName);\n if ( fileData.length > 0) {\n // TODO: change this to async later\n fs.writeFile(filePath, fileData, (error) => showData(error));\n }\n }\n\n /**\n * Converts JSON data to Excel data formats.\n * @param jsonData Json data to convert.\n * @param bookType Excel data file/book type.\n *\n private jsonToExcelData(jsonData: any, fileType: string, tableName: string): any {\n console.debug('jsonToExcelData(): creating excel data:', fileType);\n\n // create new workbook\n const workbook = xlsx.utils.book_new();\n\n // convert json data to worksheet format\n const worksheet = xlsx.utils.json_to_sheet(jsonData, {\n //header: JSON.parse(this._viewConfig.columns)\n });\n\n // append worksheet to workbook\n xlsx.utils.book_append_sheet(workbook, worksheet, tableName);\n\n // get text data string or binary spreadsheet data buffer\n let data: any = '';\n if (fileType === 'html' || fileType === 'xml') {\n data = xlsx.write(workbook, {\n type: 'string',\n compression: false,\n bookType: getBookType(fileType)\n });\n } else {\n data = xlsx.write(workbook, {\n type: 'buffer',\n compression: true, // use zip compression for zip-based formats\n bookType: getBookType(fileType)\n });\n }\n return data;\n }\n\n\n}\n\n/**\n * Converts file type to Excel book type.\n * @param {string} fileType File type: .html, .ods, .xml, .xlsb, .xlsx, etc.\n * @returns {xlsx.BookType}\n *\nfunction getBookType(fileType) {\n // TODO: must be a better way to do this string to type conversion :)\n switch (fileType) {\n case '.html':\n return 'html';\n case '.ods':\n return 'ods';\n case '.xml':\n return 'xlml';\n case '.xlsb':\n return 'xlsb';\n case '.xlsx':\n return 'xlsx';\n default:\n return 'xlsb';\n }\n}\n*/\n"],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { utils, read } from 'xlsx';
|
|
2
|
+
const dataTableNamesMap = {};
|
|
3
|
+
export function parseExcel(arrayBuffer, options) {
|
|
4
|
+
const dataUrl = 'dummy';
|
|
5
|
+
const workbook = read(arrayBuffer, {
|
|
6
|
+
type: 'array'
|
|
7
|
+
});
|
|
8
|
+
let dataRows = [];
|
|
9
|
+
dataTableNamesMap[dataUrl] = [];
|
|
10
|
+
if (workbook.SheetNames.length > 0) {
|
|
11
|
+
var _options$excel, _options$excel2;
|
|
12
|
+
if (workbook.SheetNames.length > 1) {
|
|
13
|
+
dataTableNamesMap[dataUrl] = workbook.SheetNames;
|
|
14
|
+
}
|
|
15
|
+
let sheetName = workbook.SheetNames[0];
|
|
16
|
+
if (options !== null && options !== void 0 && (_options$excel = options.excel) !== null && _options$excel !== void 0 && _options$excel.sheet && workbook.SheetNames.indexOf(options === null || options === void 0 ? void 0 : (_options$excel2 = options.excel) === null || _options$excel2 === void 0 ? void 0 : _options$excel2.sheet) >= 0) {
|
|
17
|
+
var _options$excel3;
|
|
18
|
+
sheetName = options === null || options === void 0 ? void 0 : (_options$excel3 = options.excel) === null || _options$excel3 === void 0 ? void 0 : _options$excel3.sheet;
|
|
19
|
+
}
|
|
20
|
+
const worksheet = workbook.Sheets[sheetName];
|
|
21
|
+
dataRows = utils.sheet_to_json(worksheet);
|
|
22
|
+
}
|
|
23
|
+
return dataRows;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=parse-excel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-excel.js","names":["utils","read","dataTableNamesMap","parseExcel","arrayBuffer","options","dataUrl","workbook","type","dataRows","SheetNames","length","_options$excel","_options$excel2","sheetName","excel","sheet","indexOf","_options$excel3","worksheet","Sheets","sheet_to_json"],"sources":["../../../src/lib/parse-excel.ts"],"sourcesContent":["import type {ExcelLoaderOptions} from '../excel-loader';\nimport {utils, read} from 'xlsx';\n// import {convertToArrayRow} from '@loaders.gl/schema';\n\n// local table names cache with dataUrl/tableNames array key/values\nconst dataTableNamesMap = {};\n\n/**\n * Gets local or remote Excel file data.\n * @param arrayBuffer Loaded data\n * @param options Data parse options.\n */\nexport function parseExcel(\n arrayBuffer: ArrayBuffer,\n options?: ExcelLoaderOptions\n): {[key: string]: unknown}[] {\n const dataUrl = 'dummy';\n // const dataFileType: string = dataUrl.substr(dataUrl.lastIndexOf('.')); // file extension\n\n // create Excel 'workbook'\n const workbook = read(arrayBuffer, {\n type: 'array'\n // cellDates: true\n });\n\n // load data sheets\n let dataRows: {[key: string]: unknown}[] = [];\n dataTableNamesMap[dataUrl] = [];\n if (workbook.SheetNames.length > 0) {\n if (workbook.SheetNames.length > 1) {\n // cache sheet names\n dataTableNamesMap[dataUrl] = workbook.SheetNames;\n // eslint-ignore-next-line\n // console.debug(`getData(): file: sheetNames:`, workbook.SheetNames);\n }\n\n // determine spreadsheet to load\n let sheetName = workbook.SheetNames[0];\n if (options?.excel?.sheet && workbook.SheetNames.indexOf(options?.excel?.sheet) >= 0) {\n // reset to requested table name\n sheetName = options?.excel?.sheet;\n }\n\n // get worksheet data row objects array\n const worksheet = workbook.Sheets[sheetName];\n dataRows = utils.sheet_to_json(worksheet);\n\n // const headers = dataRows.length ? Object.keys(dataRows[0]) : [];\n // if (options?.excel?.type === 'array-row-table') {\n // dataRows = dataRows.map(row => convertToArrayRow(row, headers))\n // }\n }\n\n return dataRows;\n}\n"],"mappings":"AACA,SAAQA,KAAK,EAAEC,IAAI,QAAO,MAAM;AAIhC,MAAMC,iBAAiB,GAAG,CAAC,CAAC;AAO5B,OAAO,SAASC,UAAUA,CACxBC,WAAwB,EACxBC,OAA4B,EACA;EAC5B,MAAMC,OAAO,GAAG,OAAO;EAIvB,MAAMC,QAAQ,GAAGN,IAAI,CAACG,WAAW,EAAE;IACjCI,IAAI,EAAE;EAER,CAAC,CAAC;EAGF,IAAIC,QAAoC,GAAG,EAAE;EAC7CP,iBAAiB,CAACI,OAAO,CAAC,GAAG,EAAE;EAC/B,IAAIC,QAAQ,CAACG,UAAU,CAACC,MAAM,GAAG,CAAC,EAAE;IAAA,IAAAC,cAAA,EAAAC,eAAA;IAClC,IAAIN,QAAQ,CAACG,UAAU,CAACC,MAAM,GAAG,CAAC,EAAE;MAElCT,iBAAiB,CAACI,OAAO,CAAC,GAAGC,QAAQ,CAACG,UAAU;IAGlD;IAGA,IAAII,SAAS,GAAGP,QAAQ,CAACG,UAAU,CAAC,CAAC,CAAC;IACtC,IAAIL,OAAO,aAAPA,OAAO,gBAAAO,cAAA,GAAPP,OAAO,CAAEU,KAAK,cAAAH,cAAA,eAAdA,cAAA,CAAgBI,KAAK,IAAIT,QAAQ,CAACG,UAAU,CAACO,OAAO,CAACZ,OAAO,aAAPA,OAAO,wBAAAQ,eAAA,GAAPR,OAAO,CAAEU,KAAK,cAAAF,eAAA,uBAAdA,eAAA,CAAgBG,KAAK,CAAC,IAAI,CAAC,EAAE;MAAA,IAAAE,eAAA;MAEpFJ,SAAS,GAAGT,OAAO,aAAPA,OAAO,wBAAAa,eAAA,GAAPb,OAAO,CAAEU,KAAK,cAAAG,eAAA,uBAAdA,eAAA,CAAgBF,KAAK;IACnC;IAGA,MAAMG,SAAS,GAAGZ,QAAQ,CAACa,MAAM,CAACN,SAAS,CAAC;IAC5CL,QAAQ,GAAGT,KAAK,CAACqB,aAAa,CAACF,SAAS,CAAC;EAM3C;EAEA,OAAOV,QAAQ;AACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-worker.js","names":["createLoaderWorker","ExcelLoader"],"sources":["../../../src/workers/excel-worker.ts"],"sourcesContent":["import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport {ExcelLoader} from '../index';\n\ncreateLoaderWorker(ExcelLoader);\n"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,0BAA0B;AAC3D,SAAQC,WAAW,QAAO,UAAU;AAEpCD,kBAAkB,CAACC,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Loader, LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { ObjectRowTable } from '@loaders.gl/schema';
|
|
3
|
+
export type ExcelLoaderOptions = LoaderOptions & {
|
|
4
|
+
excel?: {
|
|
5
|
+
shape: 'object-row-table';
|
|
6
|
+
sheet?: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Worker Loader for Excel files
|
|
11
|
+
*/
|
|
12
|
+
export declare const ExcelLoader: Loader<ObjectRowTable, never, ExcelLoaderOptions>;
|
|
13
|
+
export declare const _typecheckLoader: Loader;
|
|
14
|
+
//# sourceMappingURL=excel-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-loader.d.ts","sourceRoot":"","sources":["../src/excel-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAMvD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,CAAC,EAAE;QACN,KAAK,EAA4B,kBAAkB,CAAC;QACpD,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,EAAE,kBAAkB,CAczE,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAoB,CAAC"}
|
package/dist/excel-loader.js
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports._typecheckLoader = exports.ExcelLoader = void 0;
|
|
5
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
2
8
|
const DEFAULT_EXCEL_LOADER_OPTIONS = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
excel: {
|
|
10
|
+
shape: 'object-row-table',
|
|
11
|
+
sheet: undefined // Load default Sheet
|
|
12
|
+
}
|
|
7
13
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Worker Loader for Excel files
|
|
16
|
+
*/
|
|
17
|
+
exports.ExcelLoader = {
|
|
18
|
+
name: 'Excel',
|
|
19
|
+
id: 'excel',
|
|
20
|
+
module: 'excel',
|
|
21
|
+
version: VERSION,
|
|
22
|
+
worker: true,
|
|
23
|
+
extensions: ['xls', 'xlsb', 'xlsm', 'xlsx'],
|
|
24
|
+
mimeTypes: [
|
|
25
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
26
|
+
'application/vnd.ms-excel'
|
|
27
|
+
],
|
|
28
|
+
category: 'table',
|
|
29
|
+
binary: true,
|
|
30
|
+
options: DEFAULT_EXCEL_LOADER_OPTIONS
|
|
19
31
|
};
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=excel-loader.js.map
|
|
32
|
+
exports._typecheckLoader = exports.ExcelLoader;
|