xlsx-svelte-viewer 1.4.0 → 1.5.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.
- package/README.md +5 -1
- package/dist/XlsxEditor.svelte +2 -2
- package/dist/runtime.d.ts +18 -2
- package/dist/runtime.js +15 -15
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ under `xlsx-svelte-viewer/runtime`.
|
|
|
59
59
|
|
|
60
60
|
This is an early editor, without Microsoft Excel parity or guaranteed lossless
|
|
61
61
|
saving for unsupported features. Legacy XLS input saves as XLSX. Pivot tables,
|
|
62
|
-
slicers and sparklines are not
|
|
62
|
+
slicers and sparklines are supported for the cases the feature guide lists, but sparkline style galleries are not available; macros never execute. Review core
|
|
63
63
|
diagnostics and the feature guide before relying on preservation.
|
|
64
64
|
|
|
65
65
|
## Documentation
|
|
@@ -67,6 +67,10 @@ diagnostics and the feature guide before relying on preservation.
|
|
|
67
67
|
[Framework guide](https://christophervr.github.io/ooxml/xlsx/frameworks/svelte) |
|
|
68
68
|
[Bindings](https://christophervr.github.io/ooxml/xlsx/bindings)
|
|
69
69
|
|
|
70
|
+
## Privacy and network use
|
|
71
|
+
|
|
72
|
+
The Excel packages make no network request when opening, rendering, editing or saving a document: linked pictures are not fetched, linked data is not refreshed, and fonts come from the device only, unless a reader turns on the Trust Center font download (off by default) or the host sets `googleFonts`. Hyperlinks open only when the reader follows them. Nothing collects analytics or telemetry. See [PRIVACY.md](https://github.com/ChristopherVR/ooxml/blob/main/PRIVACY.md).
|
|
73
|
+
|
|
70
74
|
## License
|
|
71
75
|
|
|
72
76
|
Apache-2.0.
|
package/dist/XlsxEditor.svelte
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
oncollaborationchange?: EditorEventHandlers['collaboration-change'];
|
|
17
17
|
onready?: EditorEventHandlers['ready'];
|
|
18
18
|
};
|
|
19
|
-
let { workbook, bytes, src, fileName, readOnly = false, locale = 'en', theme = 'auto', authorName = 'Author', showToolbar = true, showFormulaBar = true, hiddenActions = [], ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready }: Props = $props();
|
|
19
|
+
let { workbook, bytes, src, fileName, readOnly = false, locale = 'en', theme = 'auto', authorName = 'Author', validateReplace = false, showToolbar = true, showFormulaBar = true, hiddenActions = [], ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready }: Props = $props();
|
|
20
20
|
let binding: EditorBinding | undefined;
|
|
21
21
|
const handle = deferredHandle(() => binding);
|
|
22
22
|
// Live `element` and `dirty`, the same handle vocabulary as the other frameworks (`EDITOR_HANDLE_KEYS`).
|
|
@@ -49,4 +49,4 @@
|
|
|
49
49
|
export function getElement() { return binding?.element; }
|
|
50
50
|
export { element, dirty };
|
|
51
51
|
</script>
|
|
52
|
-
<div use:attach={{ workbook, bytes, src, fileName, readOnly, locale, theme, authorName, showToolbar, showFormulaBar, hiddenActions, ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready }}></div>
|
|
52
|
+
<div use:attach={{ workbook, bytes, src, fileName, readOnly, locale, theme, authorName, validateReplace, showToolbar, showFormulaBar, hiddenActions, ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready }}></div>
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ooxml_core_xlsx from 'ooxml-core/xlsx';
|
|
2
2
|
import * as ooxml_core_xlsx_ui from 'ooxml-core/xlsx/ui';
|
|
3
3
|
import * as ooxml_core_collab from 'ooxml-core/collab';
|
|
4
|
-
import { EditorLocaleInput, EditorThemeMode, RibbonAddInTab, XlsxThemeColors, XlsxCollaborationOptions, ExcelCustomization, SelectionChangeDetail, FileCommandDetail, RibbonAddInCommandDetail, XlsxCollaborationState, XlsxEditorElement, SurfaceHostActions, ValidationErrorDetail, SpreadsheetToolbarProps } from 'ooxml-ui/xlsx';
|
|
4
|
+
import { EditorLocaleInput, EditorThemeMode, RibbonAddInTab, XlsxThemeColors, XlsxCollaborationOptions, ExcelCustomization, SelectionChangeDetail, FileCommandDetail, RibbonAddInCommandDetail, XlsxCollaborationState, XlsxEditorElement, SurfaceHostActions, ValidationErrorDetail, FormatCellsOperations, FindOperations, InsertFunctionOperations, ContextMenuKind, ContextMenuModel, SpreadsheetToolbarProps } from 'ooxml-ui/xlsx';
|
|
5
5
|
export * from 'ooxml-ui/xlsx';
|
|
6
6
|
export { SpreadsheetToolbarProps } from 'ooxml-ui/xlsx';
|
|
7
7
|
import { Workbook } from '@christophervr/xlsx-core';
|
|
@@ -28,6 +28,11 @@ interface EditorProps {
|
|
|
28
28
|
theme?: EditorThemeMode | undefined;
|
|
29
29
|
/** Author recorded on new comments. Default `Author`. */
|
|
30
30
|
authorName?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Replace and Replace All check each new value against the cell's data validation and leave
|
|
33
|
+
* cells it refuses unchanged. Default false: like Excel, Replace does not apply data validation.
|
|
34
|
+
*/
|
|
35
|
+
validateReplace?: boolean | undefined;
|
|
31
36
|
/** Ribbon visibility. Default true. */
|
|
32
37
|
showToolbar?: boolean | undefined;
|
|
33
38
|
/** Formula bar and name box visibility. Default true. */
|
|
@@ -106,7 +111,7 @@ interface EditorEventOptions {
|
|
|
106
111
|
interface EditorOptions extends EditorProps, EditorEventOptions {
|
|
107
112
|
}
|
|
108
113
|
/** Single source of truth for the prop keys every adapter forwards. */
|
|
109
|
-
declare const EDITOR_PROP_KEYS: readonly ["workbook", "bytes", "src", "fileName", "readOnly", "locale", "theme", "authorName", "showToolbar", "showFormulaBar", "hiddenActions", "ribbonAddIns", "themeColors", "collaboration", "storage", "fileProviders", "customization"];
|
|
114
|
+
declare const EDITOR_PROP_KEYS: readonly ["workbook", "bytes", "src", "fileName", "readOnly", "locale", "theme", "authorName", "validateReplace", "showToolbar", "showFormulaBar", "hiddenActions", "ribbonAddIns", "themeColors", "collaboration", "storage", "fileProviders", "customization"];
|
|
110
115
|
type EditorPropKey = (typeof EDITOR_PROP_KEYS)[number];
|
|
111
116
|
/** Single source of truth for the element events every adapter surfaces. */
|
|
112
117
|
declare const EDITOR_EVENT_NAMES: readonly ["workbook-change", "workbook-error", "selection-change", "dirty-change", "readonly-change", "file-command", "workbook-warning", "ribbon-action", "ribbon-customize", "sheet-change", "office-ribbon-add-in", "collaboration-change"];
|
|
@@ -216,7 +221,18 @@ declare function mountEditorSurface(host: HTMLElement, initial?: SurfaceOptions)
|
|
|
216
221
|
findReplace: boolean;
|
|
217
222
|
insertFunction: boolean;
|
|
218
223
|
validationAlert: boolean;
|
|
224
|
+
contextMenu: boolean;
|
|
225
|
+
find: boolean;
|
|
226
|
+
replace: boolean;
|
|
227
|
+
applyFormatCells: boolean;
|
|
228
|
+
insertFunctionCall: boolean;
|
|
229
|
+
};
|
|
230
|
+
workflows: {
|
|
231
|
+
formatCells: FormatCellsOperations;
|
|
232
|
+
find: FindOperations;
|
|
233
|
+
insertFunction: InsertFunctionOperations;
|
|
219
234
|
};
|
|
235
|
+
contextMenu: (menu: ContextMenuKind, sheet?: number) => ContextMenuModel;
|
|
220
236
|
labels: {
|
|
221
237
|
[k: string]: string;
|
|
222
238
|
};
|
package/dist/runtime.js
CHANGED
|
@@ -5,7 +5,7 @@ import { writable as b } from "svelte/store";
|
|
|
5
5
|
import * as x from "ooxml-ui/theme";
|
|
6
6
|
export * from "ooxml-ui/xlsx";
|
|
7
7
|
export * from "@christophervr/xlsx-core";
|
|
8
|
-
|
|
8
|
+
// \0rolldown/runtime.js
|
|
9
9
|
var S = Object.defineProperty, C = Object.getOwnPropertyDescriptor, w = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, E = (e, t) => {
|
|
10
10
|
let n = {};
|
|
11
11
|
for (var r in e) S(n, r, {
|
|
@@ -22,8 +22,7 @@ var S = Object.defineProperty, C = Object.getOwnPropertyDescriptor, w = Object.g
|
|
|
22
22
|
}, O = (e, t, n) => (D(e, t, "default"), n && D(n, t, "default")), k = /* @__PURE__ */ E({});
|
|
23
23
|
import * as A from "ooxml-ui/xlsx";
|
|
24
24
|
O(k, A);
|
|
25
|
-
|
|
26
|
-
//#region packages/bindings/src/contract.ts
|
|
25
|
+
// packages/bindings/src/contract.ts
|
|
27
26
|
var j = [
|
|
28
27
|
"workbook",
|
|
29
28
|
"bytes",
|
|
@@ -33,6 +32,7 @@ var j = [
|
|
|
33
32
|
"locale",
|
|
34
33
|
"theme",
|
|
35
34
|
"authorName",
|
|
35
|
+
"validateReplace",
|
|
36
36
|
"showToolbar",
|
|
37
37
|
"showFormulaBar",
|
|
38
38
|
"hiddenActions",
|
|
@@ -73,6 +73,10 @@ var j = [
|
|
|
73
73
|
forward: "changed",
|
|
74
74
|
fallback: "Author"
|
|
75
75
|
},
|
|
76
|
+
validateReplace: {
|
|
77
|
+
forward: "changed",
|
|
78
|
+
fallback: !1
|
|
79
|
+
},
|
|
76
80
|
showToolbar: {
|
|
77
81
|
forward: "changed",
|
|
78
82
|
fallback: !0
|
|
@@ -194,8 +198,7 @@ var z = [
|
|
|
194
198
|
"share",
|
|
195
199
|
"dirty"
|
|
196
200
|
];
|
|
197
|
-
|
|
198
|
-
//#region packages/bindings/src/index.ts
|
|
201
|
+
// packages/bindings/src/index.ts
|
|
199
202
|
function B(t, r = {}, i = !1) {
|
|
200
203
|
(0, k.defineXlsxEditor)();
|
|
201
204
|
let a = t.ownerDocument.createElement("xlsx-editor");
|
|
@@ -236,7 +239,9 @@ var V = [
|
|
|
236
239
|
"onOpenFormatCells",
|
|
237
240
|
"onOpenFindReplace",
|
|
238
241
|
"onOpenInsertFunction",
|
|
239
|
-
"onOpenValidationAlert"
|
|
242
|
+
"onOpenValidationAlert",
|
|
243
|
+
"onContextMenu",
|
|
244
|
+
"onContextMenuItems"
|
|
240
245
|
];
|
|
241
246
|
function H(e, t = {}) {
|
|
242
247
|
let n = t, r = (e) => ({
|
|
@@ -259,8 +264,7 @@ function H(e, t = {}) {
|
|
|
259
264
|
subscribe: (e) => a.subscribeEditorState(e)
|
|
260
265
|
});
|
|
261
266
|
}
|
|
262
|
-
|
|
263
|
-
//#region packages/bindings/src/common.ts
|
|
267
|
+
// packages/bindings/src/common.ts
|
|
264
268
|
var U = /* @__PURE__ */ E({
|
|
265
269
|
LegacyXlsError: () => d,
|
|
266
270
|
csvToWorkbook: () => f,
|
|
@@ -273,8 +277,7 @@ var U = /* @__PURE__ */ E({
|
|
|
273
277
|
sheetToCsv: () => v
|
|
274
278
|
});
|
|
275
279
|
O(U, k);
|
|
276
|
-
|
|
277
|
-
//#region packages/bindings/src/building-blocks.ts
|
|
280
|
+
// packages/bindings/src/building-blocks.ts
|
|
278
281
|
var W = Object.freeze({
|
|
279
282
|
active: !1,
|
|
280
283
|
roomId: void 0,
|
|
@@ -392,15 +395,13 @@ function X(e, t) {
|
|
|
392
395
|
return !1;
|
|
393
396
|
}
|
|
394
397
|
}
|
|
395
|
-
|
|
396
|
-
//#region packages/bindings/src/block-theme.ts
|
|
398
|
+
// packages/bindings/src/block-theme.ts
|
|
397
399
|
function Z(e, t) {
|
|
398
400
|
if (!e || typeof e != "object" || !("ownerDocument" in e)) return;
|
|
399
401
|
let n = e, r = Reflect.get(x, "prepareOfficeUiBlock");
|
|
400
402
|
typeof r == "function" ? r(n, t, "xlsx") : (x.installOfficeUiTheme(n.ownerDocument), n.setAttribute("data-office-block", t), n.setAttribute("data-office-product", "xlsx"));
|
|
401
403
|
}
|
|
402
|
-
|
|
403
|
-
//#region packages/svelte/src/building-blocks.ts
|
|
404
|
+
// packages/svelte/src/building-blocks.ts
|
|
404
405
|
function Q(e = {}) {
|
|
405
406
|
let t = b(q()), n = K(t.set);
|
|
406
407
|
return n.update(e), y(n.destroy), {
|
|
@@ -436,5 +437,4 @@ O(/* @__PURE__ */ E({
|
|
|
436
437
|
svelteEditorOptions: () => L,
|
|
437
438
|
toolbarModel: () => Y
|
|
438
439
|
}), U);
|
|
439
|
-
//#endregion
|
|
440
440
|
export { P as EDITOR_CALLBACKS, N as EDITOR_CONTRACT, M as EDITOR_EVENT_NAMES, z as EDITOR_HANDLE_KEYS, j as EDITOR_PROP_KEYS, d as LegacyXlsError, Q as createViewerBuildingBlocks, f as csvToWorkbook, R as deferredHandle, p as detectWorkbookFormat, I as eventOptions, m as loadLegacyXls, h as loadWorkbook, B as mountEditor, H as mountEditorSurface, g as parseCsv, F as pickEditorProps, Z as prepareBlock, _ as saveWorkbook, X as selectReference, v as sheetToCsv, L as svelteEditorOptions, Y as toolbarModel };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xlsx-svelte-viewer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Svelte 5 component for the Excel spreadsheet editor. Self-contained: includes the editor, the formula engine and the legacy .xls reader.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editor",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@christophervr/xlsx-core": "^1.1.
|
|
70
|
-
"ooxml-core": "^1.
|
|
71
|
-
"ooxml-ui": "^1.
|
|
69
|
+
"@christophervr/xlsx-core": "^1.1.2",
|
|
70
|
+
"ooxml-core": "^1.50.0",
|
|
71
|
+
"ooxml-ui": "^1.50.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"svelte": "^5.0.0"
|