@file-viewer/renderer-spreadsheet 2.1.20 → 2.1.22
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/spreadsheet.js +10 -2
- package/package.json +2 -2
package/dist/spreadsheet.js
CHANGED
|
@@ -52,10 +52,17 @@ const asModuleRecord = (value) => {
|
|
|
52
52
|
? value
|
|
53
53
|
: null;
|
|
54
54
|
};
|
|
55
|
+
const getEVirtTableGlobalCandidate = () => {
|
|
56
|
+
const globalRecord = typeof globalThis === 'undefined'
|
|
57
|
+
? null
|
|
58
|
+
: globalThis;
|
|
59
|
+
return globalRecord === null || globalRecord === void 0 ? void 0 : globalRecord.EVirtTable;
|
|
60
|
+
};
|
|
55
61
|
export const resolveEVirtTableConstructor = (module) => {
|
|
56
62
|
const record = asModuleRecord(module);
|
|
57
63
|
const defaultRecord = asModuleRecord(record === null || record === void 0 ? void 0 : record.default);
|
|
58
64
|
const moduleExportsRecord = asModuleRecord(record === null || record === void 0 ? void 0 : record['module.exports']);
|
|
65
|
+
const globalCandidate = getEVirtTableGlobalCandidate();
|
|
59
66
|
const candidates = [
|
|
60
67
|
module,
|
|
61
68
|
record === null || record === void 0 ? void 0 : record.default,
|
|
@@ -65,6 +72,7 @@ export const resolveEVirtTableConstructor = (module) => {
|
|
|
65
72
|
defaultRecord === null || defaultRecord === void 0 ? void 0 : defaultRecord.EVirtTable,
|
|
66
73
|
moduleExportsRecord === null || moduleExportsRecord === void 0 ? void 0 : moduleExportsRecord.default,
|
|
67
74
|
moduleExportsRecord === null || moduleExportsRecord === void 0 ? void 0 : moduleExportsRecord.EVirtTable,
|
|
75
|
+
globalCandidate,
|
|
68
76
|
];
|
|
69
77
|
const constructor = candidates.find(isEVirtTableConstructor);
|
|
70
78
|
if (!constructor) {
|
|
@@ -74,7 +82,7 @@ export const resolveEVirtTableConstructor = (module) => {
|
|
|
74
82
|
return constructor;
|
|
75
83
|
};
|
|
76
84
|
const loadEVirtTable = async () => {
|
|
77
|
-
const module = await import('e-virt-table');
|
|
85
|
+
const module = await import('e-virt-table/dist/index.es.js');
|
|
78
86
|
return resolveEVirtTableConstructor(module);
|
|
79
87
|
};
|
|
80
88
|
const getTargetWindow = (target) => {
|
|
@@ -83,7 +91,7 @@ const getTargetWindow = (target) => {
|
|
|
83
91
|
const getDocumentBaseUrl = (target) => {
|
|
84
92
|
return target.ownerDocument.baseURI ||
|
|
85
93
|
target.ownerDocument.URL ||
|
|
86
|
-
'
|
|
94
|
+
'file:///';
|
|
87
95
|
};
|
|
88
96
|
const callListener = (listener, event) => {
|
|
89
97
|
if (!listener) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@file-viewer/renderer-spreadsheet",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Standalone spreadsheet renderer plugin for Flyfish File Viewer powered by styled-exceljs and e-virt-table.",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"LICENSE"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@file-viewer/core": "^2.1.
|
|
71
|
+
"@file-viewer/core": "^2.1.22",
|
|
72
72
|
"e-virt-table": "^1.3.26",
|
|
73
73
|
"styled-exceljs": "0.21.1",
|
|
74
74
|
"tinycolor2": "^1.6.0"
|