gridjs-spreadsheet 26.6.1 → 26.7.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.
Files changed (61) hide show
  1. package/{a08275ef8caf83cc1c2eae91f17663e8.svg → 1f345d060b26fa53bc9d78c36441afd6.svg} +106 -26
  2. package/angular.d.ts +67 -0
  3. package/angular.js +174 -0
  4. package/example/README.md +242 -41
  5. package/example/angular-gridjs/.nvmrc +1 -0
  6. package/example/angular-gridjs/angular.json +66 -0
  7. package/example/angular-gridjs/package.json +31 -0
  8. package/example/angular-gridjs/proxy.conf.json +12 -0
  9. package/example/angular-gridjs/src/app/api.ts +7 -0
  10. package/example/angular-gridjs/src/app/app.component.html +57 -0
  11. package/example/angular-gridjs/src/app/app.component.ts +153 -0
  12. package/example/angular-gridjs/src/app/routing.ts +52 -0
  13. package/example/angular-gridjs/src/favicon.ico +0 -0
  14. package/example/angular-gridjs/src/index.html +12 -0
  15. package/example/angular-gridjs/src/main.ts +7 -0
  16. package/example/angular-gridjs/src/styles.css +37 -0
  17. package/example/angular-gridjs/tsconfig.app.json +9 -0
  18. package/example/angular-gridjs/tsconfig.json +29 -0
  19. package/example/pom.xml +3 -3
  20. package/example/react-gridjs/index.html +12 -0
  21. package/example/react-gridjs/package.json +20 -0
  22. package/example/react-gridjs/src/App.jsx +188 -0
  23. package/example/react-gridjs/src/api.js +7 -0
  24. package/example/react-gridjs/src/main.jsx +9 -0
  25. package/example/react-gridjs/src/routing.js +51 -0
  26. package/example/react-gridjs/src/styles.css +37 -0
  27. package/example/react-gridjs/vite.config.js +16 -0
  28. package/example/src/main/java/com/aspose/gridjs/demo/controller/DataController.java +80 -2
  29. package/example/src/main/java/com/aspose/gridjs/demo/controller/GridJs2Controller.java +12 -0
  30. package/example/vanilla-gridjs/npm/index.html +29 -0
  31. package/example/vanilla-gridjs/npm/main.js +8 -0
  32. package/example/vanilla-gridjs/npm/package.json +16 -0
  33. package/example/vanilla-gridjs/npm/vite.config.js +11 -0
  34. package/example/vanilla-gridjs/script/index.html +32 -0
  35. package/example/vanilla-gridjs/script/main.js +9 -0
  36. package/example/vanilla-gridjs/script/package.json +12 -0
  37. package/example/vanilla-gridjs/script/vite.config.js +11 -0
  38. package/example/vanilla-gridjs/shared/demo-app.js +205 -0
  39. package/example/vanilla-gridjs/shared/styles.css +36 -0
  40. package/example/vue-gridjs/index.html +12 -0
  41. package/example/vue-gridjs/package.json +19 -0
  42. package/example/vue-gridjs/src/App.vue +199 -0
  43. package/example/vue-gridjs/src/api.js +7 -0
  44. package/example/vue-gridjs/src/main.js +9 -0
  45. package/example/vue-gridjs/src/routing.js +51 -0
  46. package/example/vue-gridjs/src/styles.css +37 -0
  47. package/example/vue-gridjs/vite.config.js +21 -0
  48. package/index.d.ts +528 -472
  49. package/index.js +1 -1
  50. package/package.json +143 -50
  51. package/react.d.ts +27 -0
  52. package/react.js +111 -0
  53. package/readme.md +183 -380
  54. package/shared.d.ts +66 -0
  55. package/shared.js +204 -0
  56. package/vue.d.ts +20 -0
  57. package/vue.js +125 -0
  58. package/xspreadsheet.css +365 -1
  59. package/xspreadsheet.js +5 -5
  60. package/example/.mvn/wrapper/maven-wrapper.properties +0 -18
  61. package/example/src/test/java/com/aspose/gridjs/demo/GridjsdemoApplicationTests.java +0 -1441
@@ -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
+ });