gridjs-spreadsheet 26.6.2 → 26.7.1
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/angular.d.ts +67 -0
- package/angular.js +174 -0
- package/example/README.md +242 -41
- package/example/angular-gridjs/.nvmrc +1 -0
- package/example/angular-gridjs/angular.json +66 -0
- package/example/angular-gridjs/package.json +31 -0
- package/example/angular-gridjs/proxy.conf.json +12 -0
- package/example/angular-gridjs/src/app/api.ts +7 -0
- package/example/angular-gridjs/src/app/app.component.html +57 -0
- package/example/angular-gridjs/src/app/app.component.ts +153 -0
- package/example/angular-gridjs/src/app/routing.ts +52 -0
- package/example/angular-gridjs/src/favicon.ico +0 -0
- package/example/angular-gridjs/src/index.html +12 -0
- package/example/angular-gridjs/src/main.ts +7 -0
- package/example/angular-gridjs/src/styles.css +37 -0
- package/example/angular-gridjs/tsconfig.app.json +9 -0
- package/example/angular-gridjs/tsconfig.json +29 -0
- package/example/pom.xml +3 -3
- package/example/react-gridjs/index.html +12 -0
- package/example/react-gridjs/package.json +20 -0
- package/example/react-gridjs/src/App.jsx +188 -0
- package/example/react-gridjs/src/api.js +7 -0
- package/example/react-gridjs/src/main.jsx +9 -0
- package/example/react-gridjs/src/routing.js +51 -0
- package/example/react-gridjs/src/styles.css +37 -0
- package/example/react-gridjs/vite.config.js +16 -0
- package/example/src/main/java/com/aspose/gridjs/demo/controller/DataController.java +80 -2
- package/example/src/main/java/com/aspose/gridjs/demo/controller/GridJs2Controller.java +12 -0
- package/example/vanilla-gridjs/npm/index.html +29 -0
- package/example/vanilla-gridjs/npm/main.js +8 -0
- package/example/vanilla-gridjs/npm/package.json +16 -0
- package/example/vanilla-gridjs/npm/vite.config.js +11 -0
- package/example/vanilla-gridjs/script/index.html +32 -0
- package/example/vanilla-gridjs/script/main.js +9 -0
- package/example/vanilla-gridjs/script/package.json +12 -0
- package/example/vanilla-gridjs/script/vite.config.js +11 -0
- package/example/vanilla-gridjs/shared/demo-app.js +205 -0
- package/example/vanilla-gridjs/shared/styles.css +36 -0
- package/example/vue-gridjs/index.html +12 -0
- package/example/vue-gridjs/package.json +19 -0
- package/example/vue-gridjs/src/App.vue +199 -0
- package/example/vue-gridjs/src/api.js +7 -0
- package/example/vue-gridjs/src/main.js +9 -0
- package/example/vue-gridjs/src/routing.js +51 -0
- package/example/vue-gridjs/src/styles.css +37 -0
- package/example/vue-gridjs/vite.config.js +21 -0
- package/index.d.ts +58 -1
- package/index.js +1 -1
- package/package.json +170 -50
- package/react.d.ts +27 -0
- package/react.js +111 -0
- package/readme.md +470 -318
- package/shared.d.ts +66 -0
- package/shared.js +204 -0
- package/vue.d.ts +20 -0
- package/vue.js +125 -0
- package/xspreadsheet.css +7 -0
- package/xspreadsheet.js +3 -3
- package/example/.mvn/wrapper/maven-wrapper.properties +0 -18
- package/example/src/test/java/com/aspose/gridjs/demo/GridjsdemoApplicationTests.java +0 -1441
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
// Root demo component.
|
|
3
|
+
// Renders either:
|
|
4
|
+
// - the start page (demo picker + sample file list + upload box), or
|
|
5
|
+
// - the full-page spreadsheet editor once a workbook has been selected.
|
|
6
|
+
// Which one is shown is driven entirely by the URL (see ./routing.js).
|
|
7
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
8
|
+
import { GridJsSpreadsheet } from 'gridjs-spreadsheet/vue';
|
|
9
|
+
import { DEMO_PERMANENT, DEMO_HIGHLIGHT, makeUid, readRoute, pushWorkbookRoute } from './routing';
|
|
10
|
+
import { fetchJson } from './api';
|
|
11
|
+
|
|
12
|
+
// Sample workbooks listed on the start page.
|
|
13
|
+
const files = ref([]);
|
|
14
|
+
const directory = ref('');
|
|
15
|
+
// The workbook selected via the URL; null means "show the start page".
|
|
16
|
+
const current = ref(readRoute());
|
|
17
|
+
// Which demo mode is active (only relevant while on the start page).
|
|
18
|
+
const demoType = ref(current.value?.demo || DEMO_PERMANENT);
|
|
19
|
+
const workbookData = ref(null);
|
|
20
|
+
const status = ref('Loading workbook list...');
|
|
21
|
+
const hasWorkbook = computed(() => Boolean(current.value));
|
|
22
|
+
// Forces the <GridJsSpreadsheet> to remount whenever a different workbook is loaded.
|
|
23
|
+
const workbookKey = computed(() => (workbookData.value?.uniqueid || workbookData.value?.filename || '') + (current.value?.demo || ''));
|
|
24
|
+
|
|
25
|
+
function logEvent(message) {
|
|
26
|
+
console.log('[GridJS Event]', message);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Loads the list of sample workbooks available on the server.
|
|
30
|
+
async function loadFiles() {
|
|
31
|
+
try {
|
|
32
|
+
const result = await fetchJson('/gridjsdemo/api/files');
|
|
33
|
+
files.value = result.files || [];
|
|
34
|
+
directory.value = result.directory || '';
|
|
35
|
+
status.value = 'Ready';
|
|
36
|
+
} catch (error) {
|
|
37
|
+
status.value = 'Failed to load files: ' + error.message;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Navigates to a workbook: updates the URL and local state together.
|
|
42
|
+
function openWorkbook(workbook) {
|
|
43
|
+
const normalized = { ...workbook, demo: workbook.demo || demoType.value };
|
|
44
|
+
pushWorkbookRoute(normalized);
|
|
45
|
+
current.value = normalized;
|
|
46
|
+
demoType.value = normalized.demo;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function openFile(file) {
|
|
50
|
+
openWorkbook({ file, storedFile: file, demo: demoType.value, uid: makeUid(file), fromUpload: '' });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Fetches workbook data for the GridJsSpreadsheet component whenever `current`
|
|
54
|
+
// changes. Which endpoint is used depends on the demo mode:
|
|
55
|
+
// - permanent: uid-based endpoint, backend caches parsed data per uid.
|
|
56
|
+
// - highlight: plain endpoint, re-parses the file on every load.
|
|
57
|
+
async function loadWorkbook() {
|
|
58
|
+
if (!current.value?.file) {
|
|
59
|
+
workbookData.value = null;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
workbookData.value = null;
|
|
63
|
+
status.value = 'Loading ' + current.value.file + '...';
|
|
64
|
+
try {
|
|
65
|
+
const demo = current.value.demo || DEMO_PERMANENT;
|
|
66
|
+
const params = new URLSearchParams({
|
|
67
|
+
filename: current.value.storedFile || current.value.file,
|
|
68
|
+
fromUpload: current.value.fromUpload || '',
|
|
69
|
+
});
|
|
70
|
+
let endpoint = '/GridJs2/DetailStreamJson';
|
|
71
|
+
if (current.value.fromUpload) {
|
|
72
|
+
params.set('uid', current.value.uid || makeUid(current.value.file));
|
|
73
|
+
endpoint = '/GridJs2/DetailStreamJsonWithUidFromUpload';
|
|
74
|
+
} else if (demo === DEMO_PERMANENT) {
|
|
75
|
+
params.set('uid', current.value.uid || makeUid(current.value.file));
|
|
76
|
+
endpoint = '/GridJs2/DetailStreamJsonWithUid';
|
|
77
|
+
}
|
|
78
|
+
const payload = await fetchJson(endpoint + '?' + params);
|
|
79
|
+
workbookData.value = { ...payload, filename: current.value.file };
|
|
80
|
+
status.value = 'Loaded ' + current.value.file;
|
|
81
|
+
} catch (error) {
|
|
82
|
+
status.value = 'Workbook load failed: ' + error.message;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function upload(event) {
|
|
87
|
+
const file = event.target.files?.[0];
|
|
88
|
+
if (!file) return;
|
|
89
|
+
const form = new FormData();
|
|
90
|
+
form.append('file', file);
|
|
91
|
+
form.append('client', 'vue');
|
|
92
|
+
status.value = 'Uploading ' + file.name + '...';
|
|
93
|
+
try {
|
|
94
|
+
const result = await fetchJson('/gridjsdemo/api/upload', { method: 'POST', body: form });
|
|
95
|
+
logEvent('uploaded ' + result.file);
|
|
96
|
+
// Newly uploaded files live under the server's uploads dir, flagged with fromUpload=1.
|
|
97
|
+
openWorkbook({
|
|
98
|
+
file: result.displayName || file.name,
|
|
99
|
+
storedFile: result.file,
|
|
100
|
+
demo: demoType.value,
|
|
101
|
+
uid: result.uid || makeUid(result.file),
|
|
102
|
+
fromUpload: '1',
|
|
103
|
+
});
|
|
104
|
+
} catch (error) {
|
|
105
|
+
status.value = 'Upload failed: ' + error.message;
|
|
106
|
+
} finally {
|
|
107
|
+
event.target.value = '';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Restores the previously active sheet/cell (from the workbook data) once
|
|
112
|
+
// the grid has mounted, and points the "open file" link back at the start page.
|
|
113
|
+
function onReady(instance, adapter) {
|
|
114
|
+
instance.setActiveSheetByName?.(adapter.payload?.actname)?.setActiveCell?.(adapter.payload?.actrow, adapter.payload?.actcol);
|
|
115
|
+
instance.setOpenFileUrl?.('/');
|
|
116
|
+
logEvent('ready ' + (adapter.payload?.filename || current.value?.file));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function onError(payload) {
|
|
120
|
+
console.error('GridJS Vue mount error', payload);
|
|
121
|
+
logEvent('error ' + (payload?.error?.message || payload?.message || payload?.type || 'unknown'));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Keeps state in sync when the user navigates with the browser's back/forward buttons.
|
|
125
|
+
function onPopState() {
|
|
126
|
+
current.value = readRoute();
|
|
127
|
+
if (current.value?.demo) demoType.value = current.value.demo;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
watch(current, loadWorkbook, { immediate: true });
|
|
131
|
+
onMounted(() => {
|
|
132
|
+
loadFiles();
|
|
133
|
+
window.addEventListener('popstate', onPopState);
|
|
134
|
+
});
|
|
135
|
+
onBeforeUnmount(() => window.removeEventListener('popstate', onPopState));
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<template>
|
|
139
|
+
<!-- A workbook is selected -> render the full-page spreadsheet editor. -->
|
|
140
|
+
<main v-if="hasWorkbook" class="editor-page">
|
|
141
|
+
<GridJsSpreadsheet
|
|
142
|
+
v-if="workbookData"
|
|
143
|
+
:key="workbookKey"
|
|
144
|
+
:data="workbookData"
|
|
145
|
+
height="100vh"
|
|
146
|
+
:show-toolbar="true"
|
|
147
|
+
:show-contextmenu="true"
|
|
148
|
+
@ready="onReady"
|
|
149
|
+
@change="logEvent('changed')"
|
|
150
|
+
@error="onError"
|
|
151
|
+
@cell-selected="(_, ri, ci) => logEvent('cell selected ' + ri + ',' + ci)"
|
|
152
|
+
@cell-edited="(text, ri, ci) => logEvent('cell edited ' + ri + ',' + ci)"
|
|
153
|
+
@sheet-selected="(_, name) => logEvent('sheet ' + name)"
|
|
154
|
+
/>
|
|
155
|
+
<div v-else class="editor-loading">{{ status }}</div>
|
|
156
|
+
</main>
|
|
157
|
+
|
|
158
|
+
<!-- No workbook selected -> render the start page (demo picker + file list + upload). -->
|
|
159
|
+
<div v-else class="demo-shell">
|
|
160
|
+
<header class="demo-navbar">
|
|
161
|
+
<a href="https://docs.aspose.com/cells/java/aspose-cells-gridjs/">Aspose.Cells.GridJs demo for Java</a>
|
|
162
|
+
</header>
|
|
163
|
+
|
|
164
|
+
<main class="demo-container">
|
|
165
|
+
<fieldset class="demo-selector">
|
|
166
|
+
<legend>Select a demo:</legend>
|
|
167
|
+
<label :class="demoType === DEMO_PERMANENT ? 'radio-card active' : 'radio-card'">
|
|
168
|
+
<input type="radio" name="demoType" :checked="demoType === DEMO_PERMANENT" @change="demoType = DEMO_PERMANENT" />
|
|
169
|
+
<span>permanent url load demo</span>
|
|
170
|
+
</label>
|
|
171
|
+
<label :class="demoType === DEMO_HIGHLIGHT ? 'radio-card active' : 'radio-card'">
|
|
172
|
+
<input type="radio" name="demoType" :checked="demoType === DEMO_HIGHLIGHT" @change="demoType = DEMO_HIGHLIGHT" />
|
|
173
|
+
<span>highlight and custom context menu demo</span>
|
|
174
|
+
</label>
|
|
175
|
+
</fieldset>
|
|
176
|
+
|
|
177
|
+
<section class="upload-block">
|
|
178
|
+
<h4>Upload a local file to start show workbook</h4>
|
|
179
|
+
<input type="file" accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" @change="upload" />
|
|
180
|
+
</section>
|
|
181
|
+
|
|
182
|
+
<section class="path-block">
|
|
183
|
+
<h4>The specific file path : {{ directory }}</h4>
|
|
184
|
+
<h4>Navigate one of the below file to start show workbook</h4>
|
|
185
|
+
</section>
|
|
186
|
+
|
|
187
|
+
<p class="status-message" role="status">{{ status }}</p>
|
|
188
|
+
|
|
189
|
+
<section class="file-list" aria-label="Workbook files">
|
|
190
|
+
<p v-if="status === 'Ready' && files.length === 0" class="empty-message">No workbooks found in the configured directory.</p>
|
|
191
|
+
<a v-for="file in files" :href="'/?file=' + encodeURIComponent(file)" :key="file" class="file-item" @click.prevent="openFile(file)">
|
|
192
|
+
<em>{{ file }}</em>
|
|
193
|
+
</a>
|
|
194
|
+
</section>
|
|
195
|
+
</main>
|
|
196
|
+
|
|
197
|
+
<footer class="demo-footer">© 2026 - <a href="https://products.aspose.com/cells/java">Aspose.Cells for Java</a></footer>
|
|
198
|
+
</div>
|
|
199
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Small fetch() wrapper that turns non-2xx responses into thrown Errors,
|
|
2
|
+
// so callers can just `await fetchJson(url)` and catch failures in one place.
|
|
3
|
+
export async function fetchJson(url, options) {
|
|
4
|
+
const response = await fetch(url, options);
|
|
5
|
+
if (!response.ok) throw new Error(response.status + ' ' + response.statusText);
|
|
6
|
+
return response.json();
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Entry point: just mounts the <App> root component (see ./App.vue).
|
|
2
|
+
// Shared route/API helpers live in ./routing.js and ./api.js so App.vue
|
|
3
|
+
// stays focused on component state and markup.
|
|
4
|
+
import { createApp } from 'vue';
|
|
5
|
+
import 'gridjs-spreadsheet/xspreadsheet.css';
|
|
6
|
+
import './styles.css';
|
|
7
|
+
import App from './App.vue';
|
|
8
|
+
|
|
9
|
+
createApp(App).mount('#app');
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Route (URL query string) helpers shared by the demo.
|
|
2
|
+
//
|
|
3
|
+
// The demo encodes which workbook is open directly in the URL so a page
|
|
4
|
+
// refresh or a shared link reopens the same file, e.g.:
|
|
5
|
+
// /?file=Sample.xlsx&demo=permanent&uid=uid-Sample-xlsx
|
|
6
|
+
// /?file=Sample.xlsx&demo=highlight&fromUpload=1
|
|
7
|
+
//
|
|
8
|
+
// demo:
|
|
9
|
+
// 'permanent' - loads the workbook through the uid-based streaming endpoint;
|
|
10
|
+
// the backend caches the parsed result under this uid.
|
|
11
|
+
// 'highlight' - loads the workbook through the plain streaming endpoint,
|
|
12
|
+
// used by the "highlight and custom context menu" demo.
|
|
13
|
+
export const DEMO_PERMANENT = 'permanent';
|
|
14
|
+
export const DEMO_HIGHLIGHT = 'highlight';
|
|
15
|
+
const CLIENT_PREFIX = 'vue';
|
|
16
|
+
|
|
17
|
+
// Turns a file name into a stable cache key,
|
|
18
|
+
// e.g. "Sales Report.xlsx" -> "uid-Sales-Report-xlsx".
|
|
19
|
+
export function makeUid(file) {
|
|
20
|
+
return CLIENT_PREFIX + '-uid-' + file.replace(/[^a-zA-Z0-9]/g, '-');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Reads the currently selected workbook (if any) from the URL query string.
|
|
24
|
+
// Returns null when no `file` param is present, i.e. the start page.
|
|
25
|
+
export function readRoute() {
|
|
26
|
+
const params = new URLSearchParams(window.location.search);
|
|
27
|
+
const file = params.get('file');
|
|
28
|
+
if (!file) return null;
|
|
29
|
+
const demo = params.get('demo') === DEMO_HIGHLIGHT ? DEMO_HIGHLIGHT : DEMO_PERMANENT;
|
|
30
|
+
return {
|
|
31
|
+
file,
|
|
32
|
+
storedFile: params.get('storedFile') || file,
|
|
33
|
+
demo,
|
|
34
|
+
uid: params.get('uid') || makeUid(file),
|
|
35
|
+
fromUpload: params.get('fromUpload') || '',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Pushes the given workbook selection into the URL (without a full page
|
|
40
|
+
// reload) so the browser's back/forward buttons and page refresh keep working.
|
|
41
|
+
export function pushWorkbookRoute(workbook) {
|
|
42
|
+
const params = new URLSearchParams({ file: workbook.file, demo: workbook.demo || DEMO_PERMANENT });
|
|
43
|
+
if (workbook.storedFile && workbook.storedFile !== workbook.file) {
|
|
44
|
+
params.set('storedFile', workbook.storedFile);
|
|
45
|
+
}
|
|
46
|
+
if ((workbook.demo || DEMO_PERMANENT) === DEMO_PERMANENT || workbook.fromUpload) {
|
|
47
|
+
params.set('uid', workbook.uid || makeUid(workbook.file));
|
|
48
|
+
}
|
|
49
|
+
if (workbook.fromUpload) params.set('fromUpload', workbook.fromUpload);
|
|
50
|
+
window.history.pushState(null, '', '/?' + params.toString());
|
|
51
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
:root { font-family: Arial, Helvetica, sans-serif; color: #212529; background: #f8f9fa; }
|
|
2
|
+
* { box-sizing: border-box; }
|
|
3
|
+
html, body, #root, #app { min-height: 100%; }
|
|
4
|
+
body { margin: 0; overflow-y: hidden; background: #f8f9fa; font-size: 14px; }
|
|
5
|
+
button, input { font: inherit; }
|
|
6
|
+
.demo-shell { min-height: 100dvh; display: flex; flex-direction: column; background: #f8f9fa; }
|
|
7
|
+
.demo-navbar { min-height: 44px; display: flex; align-items: center; justify-content: center; background: #fff; border-bottom: 1px solid #dee2e6; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 8px 12px; font-size: 19px; }
|
|
8
|
+
.demo-navbar a { color: #0000ee; text-decoration: underline; }
|
|
9
|
+
.demo-container { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 16px 12px; }
|
|
10
|
+
.demo-selector { border: 1px solid #adb5bd; border-radius: 4px; margin: 0 0 16px; padding: 18px 14px 14px; display: flex; align-items: center; }
|
|
11
|
+
.demo-selector legend { width: auto; font-size: 14px; padding: 0 6px; }
|
|
12
|
+
.radio-card { min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; margin-left: -1px; border: 1px solid #adb5bd; background: #f0f0f0; color: #444; font-size: 14px; cursor: pointer; position: relative; }
|
|
13
|
+
.radio-card:first-of-type { margin-left: 0; border-radius: 4px 0 0 4px; }
|
|
14
|
+
.radio-card:last-of-type { border-radius: 0 4px 4px 0; }
|
|
15
|
+
.radio-card input { width: 14px; height: 14px; margin: 0; accent-color: #0d6efd; }
|
|
16
|
+
.radio-card.active { background: #0d6efd; border-color: #0d6efd; color: #fff; z-index: 1; }
|
|
17
|
+
.upload-block { margin-top: 8px; }
|
|
18
|
+
.upload-block h4, .path-block h4 { margin: 0 0 10px; font-size: 14px; font-weight: bold; line-height: 1.3; }
|
|
19
|
+
.upload-block input[type=file] { margin-bottom: 12px; font-size: 13px; }
|
|
20
|
+
.path-block { margin-top: 4px; }
|
|
21
|
+
.file-list { min-height: 140px; max-height: 220px; overflow-y: auto; border: 1px solid #ced4da; border-radius: 4px; background: #f6f7ef; padding: 10px 12px; }
|
|
22
|
+
.file-item { display: block; margin-bottom: 10px; color: #0000ee; text-decoration: underline; font-size: 14px; font-style: italic; }
|
|
23
|
+
.file-item:hover { text-decoration: underline; }
|
|
24
|
+
.radio-card:focus-within, .file-item:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(13, 110, 253, .35); outline-offset: 2px; }
|
|
25
|
+
.status-message { min-height: 20px; margin: 8px 0; color: #495057; }
|
|
26
|
+
.empty-message { margin: 12px 4px; color: #64748b; }
|
|
27
|
+
.demo-footer { min-height: 40px; border-top: 1px solid #dee2e6; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; font-size: 13px; color: #495057; background: #f8f9fa; }
|
|
28
|
+
.demo-footer a { color: #0000ee; text-decoration: underline; }
|
|
29
|
+
.editor-page { height: 100dvh; width: 100vw; overflow: hidden; background: #fff; }
|
|
30
|
+
.editor-loading { height: 100vh; display: grid; place-items: center; color: #64748b; background: #fff; }
|
|
31
|
+
.gridjs-react-host, .gridjs-vue-host, gridjs-spreadsheet { display: block; width: 100%; height: 100vh; }
|
|
32
|
+
@media (max-width: 700px) {
|
|
33
|
+
body { overflow-y: auto; }
|
|
34
|
+
.demo-selector { flex-direction: column; align-items: stretch; }
|
|
35
|
+
.radio-card { margin-left: 0; width: 100%; }
|
|
36
|
+
.radio-card:first-of-type, .radio-card:last-of-type { border-radius: 4px; }
|
|
37
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import vue from '@vitejs/plugin-vue';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [vue()],
|
|
6
|
+
resolve: {
|
|
7
|
+
alias: {
|
|
8
|
+
vue: 'vue/dist/vue.esm-bundler.js'
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
server: {
|
|
12
|
+
proxy: {
|
|
13
|
+
'/GridJs2': 'http://127.0.0.1:8080',
|
|
14
|
+
'/gridjsdemo': 'http://127.0.0.1:8080'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
build: {
|
|
18
|
+
outDir: 'dist',
|
|
19
|
+
emptyOutDir: true
|
|
20
|
+
}
|
|
21
|
+
});
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ declare module 'gridjs-spreadsheet' {
|
|
|
6
6
|
showContextmenu?: boolean;
|
|
7
7
|
showFileName?: boolean;
|
|
8
8
|
local?:string;
|
|
9
|
+
locale?: string;
|
|
10
|
+
updateMode?: 'server' | 'client' | string;
|
|
11
|
+
updateUrl?: string;
|
|
12
|
+
token?: string;
|
|
13
|
+
loadingGif?: string;
|
|
14
|
+
showPartToolbar?: boolean;
|
|
9
15
|
view?: {
|
|
10
16
|
height: () => number;
|
|
11
17
|
width: () => number;
|
|
@@ -451,11 +457,62 @@ declare module 'gridjs-spreadsheet' {
|
|
|
451
457
|
* get data
|
|
452
458
|
*/
|
|
453
459
|
getData(): Record<string, any>;
|
|
460
|
+
/**
|
|
461
|
+
* get pending server update payloads
|
|
462
|
+
*/
|
|
463
|
+
getUpdateDatas(): Record<string, any>[];
|
|
464
|
+
/**
|
|
465
|
+
* update authorization token used by server requests
|
|
466
|
+
*/
|
|
467
|
+
refreshToken(token: string): void;
|
|
468
|
+
/**
|
|
469
|
+
* release GridJS DOM and runtime resources
|
|
470
|
+
*/
|
|
471
|
+
destroy(): void;
|
|
472
|
+
/**
|
|
473
|
+
* configure server-side workbook id
|
|
474
|
+
*/
|
|
475
|
+
setUniqueId(uid: string): void;
|
|
476
|
+
/**
|
|
477
|
+
* configure display/download file name
|
|
478
|
+
*/
|
|
479
|
+
setFileName(fname: string): void;
|
|
480
|
+
/**
|
|
481
|
+
* configure image endpoints
|
|
482
|
+
*/
|
|
483
|
+
setImageInfo(
|
|
484
|
+
imageUrl: string,
|
|
485
|
+
uploadByLocalUrl: string,
|
|
486
|
+
uploadByUrlUrl: string,
|
|
487
|
+
copyUrl: string,
|
|
488
|
+
zorder?: number,
|
|
489
|
+
loadingGifUrl?: string
|
|
490
|
+
): void;
|
|
491
|
+
/**
|
|
492
|
+
* configure file download endpoint
|
|
493
|
+
*/
|
|
494
|
+
setFileDownloadInfo(url: string): void;
|
|
495
|
+
/**
|
|
496
|
+
* configure OLE download endpoint
|
|
497
|
+
*/
|
|
498
|
+
setOleDownloadInfo(url: string): void;
|
|
499
|
+
/**
|
|
500
|
+
* configure lazy loading endpoint
|
|
501
|
+
*/
|
|
502
|
+
setLazyLoadingUrl(url: string): void;
|
|
503
|
+
/**
|
|
504
|
+
* bind server update error handler
|
|
505
|
+
*/
|
|
506
|
+
updateServerError(callback: (...args: any[]) => void): this;
|
|
507
|
+
/**
|
|
508
|
+
* bind update-cell error handler
|
|
509
|
+
*/
|
|
510
|
+
updateCellError(callback: (...args: any[]) => void): this;
|
|
454
511
|
/**
|
|
455
512
|
* bind handler to change event, including data change and user actions
|
|
456
513
|
* @param callback
|
|
457
514
|
*/
|
|
458
|
-
change(callback: (json: Record<string, any>) => void):
|
|
515
|
+
change(callback: (json: Record<string, any>) => void): this;
|
|
459
516
|
/**
|
|
460
517
|
* set locale
|
|
461
518
|
* @param lang
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = require('./xspreadsheet.js');
|
|
1
|
+
module.exports = require('./xspreadsheet.js');
|
package/package.json
CHANGED
|
@@ -1,50 +1,170 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "gridjs-spreadsheet",
|
|
3
|
-
"version": "26.
|
|
4
|
-
"description": "
|
|
5
|
-
"types": "index.d.ts",
|
|
6
|
-
"main": "xspreadsheet.js",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "gridjs-spreadsheet",
|
|
3
|
+
"version": "26.7.1",
|
|
4
|
+
"description": "Lightweight, high-performance JavaScript spreadsheet component for building online Excel editors and web spreadsheet apps. Supports React, Vue 3, and Angular with TypeScript declarations. Features include formulas, charts, formatting, data validation, copy/paste from Excel, and server-side integration.",
|
|
5
|
+
"types": "index.d.ts",
|
|
6
|
+
"main": "xspreadsheet.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"default": "./xspreadsheet.js"
|
|
11
|
+
},
|
|
12
|
+
"./xspreadsheet.css": "./xspreadsheet.css",
|
|
13
|
+
"./vue": {
|
|
14
|
+
"types": "./vue.d.ts",
|
|
15
|
+
"default": "./vue.js"
|
|
16
|
+
},
|
|
17
|
+
"./react": {
|
|
18
|
+
"types": "./react.d.ts",
|
|
19
|
+
"default": "./react.js"
|
|
20
|
+
},
|
|
21
|
+
"./angular": {
|
|
22
|
+
"types": "./angular.d.ts",
|
|
23
|
+
"default": "./angular.js"
|
|
24
|
+
},
|
|
25
|
+
"./shared": {
|
|
26
|
+
"types": "./shared.d.ts",
|
|
27
|
+
"default": "./shared.js"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"readme.md",
|
|
33
|
+
"preview.gif",
|
|
34
|
+
"xspreadsheet.js",
|
|
35
|
+
"xspreadsheet.css",
|
|
36
|
+
"*.svg",
|
|
37
|
+
"index.js",
|
|
38
|
+
"index.d.ts",
|
|
39
|
+
"shared.js",
|
|
40
|
+
"shared.d.ts",
|
|
41
|
+
"react.js",
|
|
42
|
+
"react.d.ts",
|
|
43
|
+
"vue.js",
|
|
44
|
+
"vue.d.ts",
|
|
45
|
+
"angular.js",
|
|
46
|
+
"angular.d.ts",
|
|
47
|
+
"example/.gitignore",
|
|
48
|
+
"example/README.md",
|
|
49
|
+
"example/HELP.md",
|
|
50
|
+
"example/Dockerfile",
|
|
51
|
+
"example/compose.yaml",
|
|
52
|
+
"example/pom.xml",
|
|
53
|
+
"example/mvnw",
|
|
54
|
+
"example/mvnw.cmd",
|
|
55
|
+
"example/src/main/java",
|
|
56
|
+
"example/src/main/resources",
|
|
57
|
+
"example/wb",
|
|
58
|
+
"example/react-gridjs/index.html",
|
|
59
|
+
"example/react-gridjs/package.json",
|
|
60
|
+
"example/react-gridjs/src",
|
|
61
|
+
"example/react-gridjs/vite.config.js",
|
|
62
|
+
"example/vue-gridjs/index.html",
|
|
63
|
+
"example/vue-gridjs/package.json",
|
|
64
|
+
"example/vue-gridjs/src",
|
|
65
|
+
"example/vue-gridjs/vite.config.js",
|
|
66
|
+
"example/angular-gridjs/.nvmrc",
|
|
67
|
+
"example/angular-gridjs/angular.json",
|
|
68
|
+
"example/angular-gridjs/package.json",
|
|
69
|
+
"example/angular-gridjs/proxy.conf.json",
|
|
70
|
+
"example/angular-gridjs/src",
|
|
71
|
+
"example/angular-gridjs/tsconfig.json",
|
|
72
|
+
"example/angular-gridjs/tsconfig.app.json",
|
|
73
|
+
"example/vanilla-gridjs/shared",
|
|
74
|
+
"example/vanilla-gridjs/npm/index.html",
|
|
75
|
+
"example/vanilla-gridjs/npm/main.js",
|
|
76
|
+
"example/vanilla-gridjs/npm/package.json",
|
|
77
|
+
"example/vanilla-gridjs/npm/vite.config.js",
|
|
78
|
+
"example/vanilla-gridjs/script/index.html",
|
|
79
|
+
"example/vanilla-gridjs/script/main.js",
|
|
80
|
+
"example/vanilla-gridjs/script/package.json",
|
|
81
|
+
"example/vanilla-gridjs/script/vite.config.js"
|
|
82
|
+
],
|
|
83
|
+
"keywords": [
|
|
84
|
+
"excel",
|
|
85
|
+
"spreadsheet",
|
|
86
|
+
"web-excel",
|
|
87
|
+
"online-excel",
|
|
88
|
+
"excel-viewer",
|
|
89
|
+
"excel-editor",
|
|
90
|
+
"javascript-excel",
|
|
91
|
+
"javascript-spreadsheet",
|
|
92
|
+
"excel-component",
|
|
93
|
+
"spreadsheet-ui",
|
|
94
|
+
"react-spreadsheet",
|
|
95
|
+
"vue-excel",
|
|
96
|
+
"angular-spreadsheet",
|
|
97
|
+
"vue-spreadsheet",
|
|
98
|
+
"react-excel",
|
|
99
|
+
"angular-excel",
|
|
100
|
+
"typescript",
|
|
101
|
+
"xlsx",
|
|
102
|
+
"xls",
|
|
103
|
+
"csv",
|
|
104
|
+
"ods",
|
|
105
|
+
"numbers",
|
|
106
|
+
"xlsm",
|
|
107
|
+
"xlsb",
|
|
108
|
+
"excel-io",
|
|
109
|
+
"redact",
|
|
110
|
+
"redaction",
|
|
111
|
+
"data-redaction",
|
|
112
|
+
"collaborative-editing",
|
|
113
|
+
"excel-api",
|
|
114
|
+
"data-table",
|
|
115
|
+
"datagrid",
|
|
116
|
+
"convert-pdf",
|
|
117
|
+
"convert-html",
|
|
118
|
+
"sheets",
|
|
119
|
+
"web-spreadsheet",
|
|
120
|
+
"spreadsheet-editor",
|
|
121
|
+
"excel-online",
|
|
122
|
+
"excel-formula",
|
|
123
|
+
"excel-chart",
|
|
124
|
+
"data-validation",
|
|
125
|
+
"copy-paste-excel",
|
|
126
|
+
"spreadsheet-component",
|
|
127
|
+
"open-source-excel",
|
|
128
|
+
"free-excel-editor",
|
|
129
|
+
"gridjs"
|
|
130
|
+
],
|
|
131
|
+
"author": "Aspose Cells Team",
|
|
132
|
+
"dependencies": {
|
|
133
|
+
"jszip": "~3.10.1"
|
|
134
|
+
},
|
|
135
|
+
"peerDependencies": {
|
|
136
|
+
"vue": ">=3.0.0",
|
|
137
|
+
"react": ">=16.8.0",
|
|
138
|
+
"@angular/core": ">=14.0.0",
|
|
139
|
+
"@angular/common": ">=14.0.0"
|
|
140
|
+
},
|
|
141
|
+
"peerDependenciesMeta": {
|
|
142
|
+
"vue": {
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
"react": {
|
|
146
|
+
"optional": true
|
|
147
|
+
},
|
|
148
|
+
"@angular/core": {
|
|
149
|
+
"optional": true
|
|
150
|
+
},
|
|
151
|
+
"@angular/common": {
|
|
152
|
+
"optional": true
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"engines": {
|
|
156
|
+
"node": ">=18"
|
|
157
|
+
},
|
|
158
|
+
"publishConfig": {
|
|
159
|
+
"access": "public"
|
|
160
|
+
},
|
|
161
|
+
"license": "MIT",
|
|
162
|
+
"repository": {
|
|
163
|
+
"type": "git",
|
|
164
|
+
"url": "git+https://github.com/aspose-cells/Aspose.Cells.Grid-for-.NET.git"
|
|
165
|
+
},
|
|
166
|
+
"homepage": "https://products.aspose.app/cells/editor",
|
|
167
|
+
"bugs": {
|
|
168
|
+
"url": "https://forum.aspose.com/c/cells"
|
|
169
|
+
}
|
|
170
|
+
}
|
package/react.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type Spreadsheet from 'gridjs-spreadsheet';
|
|
3
|
+
import type { GridJsAdapter } from './shared';
|
|
4
|
+
|
|
5
|
+
export interface GridJsSpreadsheetProps {
|
|
6
|
+
apiBase?: string;
|
|
7
|
+
data?: any;
|
|
8
|
+
loader?: () => Promise<any> | any;
|
|
9
|
+
mode?: 'edit' | 'read';
|
|
10
|
+
locale?: string;
|
|
11
|
+
token?: string;
|
|
12
|
+
height?: string | number;
|
|
13
|
+
showToolbar?: boolean;
|
|
14
|
+
showContextmenu?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
onReady?: (instance: Spreadsheet, adapter: GridJsAdapter) => void;
|
|
18
|
+
onChange?: (...args: any[]) => void;
|
|
19
|
+
onError?: (payload: any) => void;
|
|
20
|
+
onCellSelected?: (...args: any[]) => void;
|
|
21
|
+
onCellEdited?: (...args: any[]) => void;
|
|
22
|
+
onSheetSelected?: (...args: any[]) => void;
|
|
23
|
+
onSheetLoaded?: (...args: any[]) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function GridJsSpreadsheet(props: GridJsSpreadsheetProps): JSX.Element;
|
|
27
|
+
export default GridJsSpreadsheet;
|