gridjs-spreadsheet 25.4.0 → 25.6.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.
@@ -14,6 +14,7 @@ import java.util.concurrent.ExecutorService;
14
14
  import java.util.concurrent.Executors;
15
15
  import java.util.zip.GZIPOutputStream;
16
16
 
17
+ import org.springframework.beans.factory.annotation.Autowired;
17
18
  import org.springframework.beans.factory.annotation.Value;
18
19
  import org.springframework.core.io.InputStreamResource;
19
20
  import org.springframework.http.HttpHeaders;
@@ -35,7 +36,9 @@ import com.aspose.cells.Workbook;
35
36
  import com.aspose.gridjs.Config;
36
37
  import com.aspose.gridjs.GridCellException;
37
38
  import com.aspose.gridjs.GridInterruptMonitor;
39
+ import com.aspose.gridjs.GridJsControllerBase;
38
40
  import com.aspose.gridjs.GridJsWorkbook;
41
+ import com.aspose.gridjs.IGridJsService;
39
42
 
40
43
  import javax.servlet.http.HttpServletRequest;
41
44
  import javax.servlet.http.HttpServletResponse;
@@ -43,26 +46,26 @@ import javax.servlet.http.Part;
43
46
 
44
47
  @RestController
45
48
  @RequestMapping({"/GridJs2"})
46
- public class GridJs2Controller {
49
+ public class GridJs2Controller extends GridJsControllerBase{
47
50
  @Value("${testconfig.ListDir}")
48
51
  private String listDir;//="D:\\codebase\\customerissue\\wb\\tempfromdownload\\";
49
52
 
50
53
 
54
+ // IGridJsService
55
+ @Autowired
56
+ public GridJs2Controller(IGridJsService gridJsService) {
57
+ super(gridJsService);
58
+ }
59
+
51
60
 
52
61
  @GetMapping("/DetailFileJsonWithUid")
53
62
  public ResponseEntity<String> detailFileJsonWithUid(@RequestParam String filename, @RequestParam String uid) {
54
63
  try {
55
64
 
56
65
  Path filePath = Paths.get(listDir, filename);
57
- GridJsWorkbook wbj = new GridJsWorkbook();
58
66
 
59
67
  // Check if already in cache
60
- StringBuilder sb = wbj.getJsonByUid(uid, filename);
61
- if (sb == null) {
62
- Workbook wb = new Workbook(filePath.toString());
63
- wbj.importExcelFile(uid, wb);
64
- sb = wbj.exportToJsonStringBuilder(filename);
65
- }
68
+ StringBuilder sb = _gridJsService.detailFileJsonWithUid( filePath.toString(), uid);
66
69
 
67
70
  // Return the content as plain text with UTF-8 encoding
68
71
  return ResponseEntity.ok()
@@ -78,17 +81,12 @@ public class GridJs2Controller {
78
81
 
79
82
 
80
83
  Path filePath = Paths.get(listDir, filename);
81
- GridJsWorkbook wbj = new GridJsWorkbook();
84
+
82
85
 
83
86
  response.setContentType("application/json");
84
87
  response.setHeader("Content-Encoding", "gzip");
85
88
  try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(response.getOutputStream())) {
86
- boolean isdone= wbj.jsonToStreamByUid(gzipOutputStream,uid, filename);
87
- if (!isdone) {
88
- Workbook wb = new Workbook(filePath.toString());
89
- wbj.importExcelFile(uid,wb);
90
- wbj.jsonToStream(gzipOutputStream, filename);
91
- }
89
+ _gridJsService.detailStreamJsonWithUid(gzipOutputStream, filePath.toString(), uid);
92
90
  } catch (IOException e) {
93
91
  // TODO Auto-generated catch block
94
92
  e.printStackTrace();
@@ -107,452 +105,91 @@ public class GridJs2Controller {
107
105
 
108
106
 
109
107
  Path filePath = Paths.get(uploadDir, filename);
110
- GridJsWorkbook wbj = new GridJsWorkbook();
108
+
111
109
 
112
110
  response.setContentType("application/json");
113
111
  response.setHeader("Content-Encoding", "gzip");
114
112
  try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(response.getOutputStream())) {
115
- boolean isdone= wbj.jsonToStreamByUid(gzipOutputStream,uid, filename);
116
- if (!isdone) {
117
- Workbook wb = new Workbook(filePath.toString());
118
- wbj.importExcelFile(uid,wb);
119
- wbj.jsonToStream(gzipOutputStream, filename);
120
- }
121
- } catch (IOException e) {
122
- // TODO Auto-generated catch block
123
- e.printStackTrace();
113
+ _gridJsService.detailStreamJsonWithUid(gzipOutputStream, filePath.toString(), uid);
114
+
124
115
  } catch (Exception e) {
125
116
  // TODO Auto-generated catch block
126
117
  e.printStackTrace();
127
118
  }
128
119
  }
129
120
 
130
- @PostMapping("/LazyLoading")
121
+ @PostMapping("/LazyLoadingStreamJson")
131
122
  public void lazyLoadingStreamJson(
132
123
  @RequestParam(value = "name", required = false) String sheetName,
133
124
  @RequestParam(value = "uid", required = false) String uid,
134
125
  HttpServletResponse response) throws IOException {
135
126
 
136
- GridJsWorkbook wbj = new GridJsWorkbook();
137
127
 
138
- // 设置响应头
139
- response.setContentType(MediaType.APPLICATION_JSON_VALUE);
140
- response.setHeader(HttpHeaders.CONTENT_ENCODING, "gzip");
128
+ super.lazyLoadingStreamJson(sheetName,uid,response);
141
129
 
142
- try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(response.getOutputStream())) {
143
- try {
144
- wbj.lazyLoadingStream(gzipOutputStream, uid, sheetName);
145
- } catch (Exception e) {
146
- // TODO Auto-generated catch block
147
- e.printStackTrace();
148
- }
149
- }
150
130
  }
151
131
 
152
132
  @PostMapping("/UpdateCell")
153
133
  public ResponseEntity<String> updateCell(HttpServletRequest request) {
154
- String p = request.getParameter("p");
155
- String uid = request.getParameter("uid");
156
- GridJsWorkbook gwb = new GridJsWorkbook();
157
- String ret;
158
- try {
159
- ret = gwb.updateCell(p, uid);
160
- return new ResponseEntity<>(ret, HttpStatus.OK);
161
- } catch (Exception e) {
162
- // TODO Auto-generated catch block
163
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.OK);
164
- }
165
-
166
- }
167
-
168
- @PostMapping("/AddImage_FAIL")
169
- public ResponseEntity<String> addImageFail(HttpServletRequest request) {
170
- String uid = request.getParameter("uid");
171
- String p = request.getParameter("p");
172
- String isControl = request.getParameter("control");
173
- String ret = null;
174
- GridJsWorkbook gwb = new GridJsWorkbook();
175
134
  try {
176
- if (isControl == null) {
177
- Part filePart = request.getPart("image"); // Retrieves <input type="file" name="file">
178
- if (filePart == null || filePart.getSize() == 0) {
179
- // for add shape,need to set p.type as one of AutoShapeType
180
- ret = gwb.insertImage(uid, p, null, null);
181
-
182
- } else {
183
- try (InputStream inputStream = filePart.getInputStream()) {
184
- ret = gwb.insertImage(uid, p, inputStream, null);
185
- } catch (IOException e) {
186
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.BAD_REQUEST);
187
- }
188
- }
189
- } else {
190
- ret = gwb.insertImage(uid, p, null, null);
191
- }
192
- return new ResponseEntity<>(ret, HttpStatus.OK);
193
- } catch (Exception e) {
194
- // TODO Auto-generated catch block
195
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.OK);
135
+ return super.updateCell(request);
136
+ }catch(Exception e)
137
+ {
138
+ e.printStackTrace();
139
+ return null;
196
140
  }
197
141
  }
198
142
 
199
143
  @PostMapping("/AddImage")
200
- public ResponseEntity<String> handleFileUpload(@RequestParam(value = "image", required = false) MultipartFile file,
144
+ public ResponseEntity<String> addImage(
145
+ @RequestParam(value = "image", required = false) MultipartFile file,
201
146
  @RequestParam("uid") String uid,
202
147
  @RequestParam("p") String p,
203
148
  @RequestParam(value = "control", required = false) String isControl) {
204
- String ret = null;
205
- GridJsWorkbook gwb = new GridJsWorkbook();
206
- try {
207
- if (isControl == null) {
208
- if (file != null && !file.isEmpty()) {
209
- try (InputStream inputStream = file.getInputStream()) {
210
- // Files.copy(inputStream, Paths.get("D:\\tmpdel\\tmp\\gridjsjava\\upload\\123.png"));
211
- ret = gwb.insertImage(uid, p, inputStream, null);
212
149
 
213
- } catch (IOException e) {
214
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.BAD_REQUEST);
215
- }
216
-
217
-
218
- } else {
219
- // for add shape,need to set p.type as one of AutoShapeType
220
- ret = gwb.insertImage(uid, p, null, null);
221
-
222
- }
223
- } else {
224
- ret = gwb.insertImage(uid, p, null, null);
225
- }
226
-
227
- return new ResponseEntity<>(ret, HttpStatus.OK);
228
- } catch (Exception e) {
229
- e.printStackTrace();
230
- return ResponseEntity.internalServerError().body("Error occurred while uploading file");
231
- }
150
+ return super.addImage(file,uid,p,isControl);
232
151
  }
233
152
 
234
153
  @PostMapping("/CopyImage")
235
154
  public ResponseEntity<String> copyImage(HttpServletRequest request) {
236
- String uid = request.getParameter("uid");
237
- String p = request.getParameter("p");
238
- GridJsWorkbook gwb = new GridJsWorkbook();
239
- try {
240
- String ret = gwb.copyImageOrShape(uid, p);
241
-
242
- return new ResponseEntity<>(ret, HttpStatus.OK);
243
- } catch (Exception e) {
244
- // TODO Auto-generated catch block
245
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.OK);
246
- }
155
+ return super.copyImage(request);
247
156
  }
248
157
 
249
- private static InputStream getStreamFromUrl(String url) throws IOException {
250
- URL imageUrl = new URL(url);
251
- URLConnection connection = imageUrl.openConnection();
252
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
253
- byte[] buffer = new byte[1024];
254
- int bytesRead;
255
- try (InputStream in = connection.getInputStream()) {
256
- while ((bytesRead = in.read(buffer)) != -1) {
257
- baos.write(buffer, 0, bytesRead);
258
- }
259
- }
260
- return new ByteArrayInputStream(baos.toByteArray());
261
- }
262
158
 
263
159
  @PostMapping("/AddImageByURL")
264
160
  public ResponseEntity<String> addImageByUrl(HttpServletRequest request) {
265
- String uid = request.getParameter("uid");
266
- String p = request.getParameter("p");
267
- String imageUrl = request.getParameter("imageurl");
268
- String ret = null;
269
- GridJsWorkbook gwb = new GridJsWorkbook();
270
- try {
271
- if (imageUrl != null) {
272
- try (InputStream stream = getStreamFromUrl(imageUrl)) {
273
- ret = gwb.insertImage(uid, p, stream, imageUrl);
274
- } catch (IOException e) {
275
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.BAD_REQUEST);
276
- }
277
- } else {
278
- return new ResponseEntity<>(gwb.errorJson("image url is null"), HttpStatus.BAD_REQUEST);
279
- }
280
-
281
- return new ResponseEntity<>(ret, HttpStatus.OK);
282
- } catch (Exception e) {
283
- // TODO Auto-generated catch block
284
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.OK);
285
- }
161
+ return super.addImageByUrl(request);
286
162
  }
287
163
 
288
164
  @GetMapping("/Image")
289
165
  public ResponseEntity<InputStreamResource> getImage(HttpServletRequest request) {
290
- String fileId = request.getParameter("id");
291
- String uid = request.getParameter("uid");
292
- try {
293
- InputStream imageStream = GridJsWorkbook.getImageStream(uid, fileId);
294
- if (imageStream == null) {
295
- return ResponseEntity.notFound().build();
296
- }
297
-
298
- return ResponseEntity.ok()
299
- .contentType(MediaType.IMAGE_PNG)
300
- .body(new InputStreamResource(imageStream));
301
- } catch (Exception e) {
302
- e.printStackTrace();
303
- return ResponseEntity.notFound().build();
304
- }
305
- }
306
- /*
307
- @GetMapping("/ImageTest")
308
- public ResponseEntity<InputStreamResource> getImageTest(HttpServletRequest request) {
309
- try {
310
- // Load the image file from the classpath (resources folder)
311
- String fileId = request.getParameter("id");
312
- String uid = request.getParameter("uid");
313
-
314
- InputStream imageStream = GridJsWorkbook.getImageStream(uid, fileId);
315
- if (imageStream == null) {
316
- return ResponseEntity.notFound().build();
317
- }
318
-
319
- // Set the headers for the response
320
- HttpHeaders headers = new HttpHeaders();
321
- headers.add("Content-Type", "image/jpeg");
322
-
323
- // Return the InputStreamResource with the headers
324
- return ResponseEntity
325
- .ok()
326
- .headers(headers)
327
- .body(new InputStreamResource(imageStream));
328
- } catch (Exception e) {
329
- e.printStackTrace();
330
- return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
331
- }
332
- }
333
-
334
- @GetMapping("/PImage")
335
- public ResponseEntity<InputStreamResource> getPImage(HttpServletRequest request) {
336
- String fileId = request.getParameter("id");
337
- String uid = request.getParameter("uid");
338
- try {
339
- InputStream imageStream = GridJsWorkbook.getImageStream(uid, fileId);
340
- if (imageStream == null) {
341
- return ResponseEntity.notFound().build();
342
- }
343
- InputStreamResource resource = new InputStreamResource(imageStream);
344
- MediaType mediaType = MediaType.IMAGE_PNG;
345
- return ResponseEntity.ok()
346
- .contentType(mediaType)
347
- .header(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + fileId + "\"")
348
- .body(resource);
349
- } catch (Exception e) {
350
- e.printStackTrace();
351
- return ResponseEntity.notFound().build();
352
- }
353
- }
354
-
355
- @GetMapping("/pimages/{imageName}")
356
- public ResponseEntity<InputStreamResource> getImage(@PathVariable("imageName") String imageName) {
357
- try {
358
- // Read the image file
359
- FileInputStream fis = new FileInputStream("C:\\Users\\peter\\Pictures\\test\\" + imageName);
360
- InputStreamResource resource = new InputStreamResource(fis);
361
-
362
- // Set the content type based on the image type (JPEG, PNG, etc.)
363
- MediaType mediaType = MediaType.IMAGE_JPEG; // Change this based on your image type
364
-
365
- // Create the response entity with the appropriate headers
366
- return ResponseEntity.ok()
367
- .contentType(mediaType)
368
- .header(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + imageName + "\"")
369
- .body(resource);
370
- } catch (IOException e) {
371
- // Handle the exception, e.g., log it
372
- e.printStackTrace();
373
- return ResponseEntity.notFound().build();
374
- }
375
- }
376
- */
377
-
378
- @GetMapping("/Ole")
379
- public ResponseEntity<?> getOle(HttpServletRequest request) {
380
- int oleId = Integer.parseInt(request.getParameter("id"));
381
- String uid = request.getParameter("uid");
382
- String sheet = request.getParameter("sheet");
383
-
384
- GridJsWorkbook gwb = new GridJsWorkbook();
385
- String[] filename = new String[1];
386
- try {
387
- byte[] fileByte = gwb.getOle(uid, sheet, oleId, filename);
388
-
389
- if (filename != null) {
390
- return ResponseEntity.ok()
391
- .contentType( (getMimeType(filename[0])))
392
- .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + filename[0] + "\"")
393
- .body(fileByte);
394
- } else {
395
- return ResponseEntity.notFound().build();
396
- }
397
- } catch (Exception e) {
398
- // TODO Auto-generated catch block
399
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.OK);
400
- }
166
+ return super.getImage(request);
401
167
  }
402
168
 
403
169
 
404
170
  @GetMapping("/ImageUrl")
405
171
  public ResponseEntity<String> getImageUrl(@RequestParam String id, @RequestParam String uid) {
406
- if (GridJsWorkbook.CacheImp != null) {
407
- return ResponseEntity.ok(GridJsWorkbook.getImageUrl(uid, id, "."));
408
- } else {
409
- String file = uid + "." + id;
410
- return ResponseEntity.ok("/GridJs2/GetZipFile?f=" + file);
411
- }
412
- }
413
-
414
- @GetMapping("/GetZipFile")
415
- public ResponseEntity<StreamingResponseBody> getZipFile(@RequestParam String f) {
416
- Path filePath = Paths.get(Config.getFileCacheDirectory(), f);
417
-
418
- if (!Files.exists(filePath)) {
419
- return ResponseEntity.notFound().build();
420
- }
421
-
422
- StreamingResponseBody responseBody = outputStream -> {
423
- try (InputStream inputStream = Files.newInputStream(filePath)) {
424
- byte[] buffer = new byte[1024];
425
- int bytesRead;
426
- while ((bytesRead = inputStream.read(buffer)) != -1) {
427
- outputStream.write(buffer, 0, bytesRead);
428
- }
429
- }
430
- };
431
-
432
- return ResponseEntity.ok()
433
- .contentType(MediaType.APPLICATION_OCTET_STREAM)
434
- .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + f + "\"")
435
- .body(responseBody);
172
+ return super.getImageUrl(id, uid);
436
173
  }
437
174
 
438
- public static MediaType getMimeType(String fileName) {
439
- Path filePath = Paths.get(fileName);
440
- try {
441
- // Probe the content type of the file
442
- String mimeType = Files.probeContentType(filePath);
443
-
444
- // If the MIME type couldn't be determined, default to binary
445
- if (mimeType == null) {
446
- mimeType = "application/octet-stream";
447
- }
448
-
449
- // Parse and return the MediaType
450
- return MediaType.parseMediaType(mimeType);
451
-
452
- } catch (IOException e) {
453
- e.printStackTrace();
454
- // Return a default MediaType in case of an error
455
- return MediaType.APPLICATION_OCTET_STREAM;
456
- }
175
+ @GetMapping("/Ole")
176
+ public ResponseEntity<?> getOle(HttpServletRequest request) {
177
+ return super.getOle(request);
457
178
  }
458
179
 
459
180
  @GetMapping("/GetFile")
460
- public ResponseEntity<byte[]> getFile(@RequestParam("id") String fileid,@RequestParam("filename") String filename) throws IOException {
461
-
462
- MediaType mimeType = getMimeType(filename);
463
-
464
- // try {
465
- // TimeUnit.SECONDS.sleep(3); // simulate network lag
466
- // } catch (InterruptedException e) {
467
- // Thread.currentThread().interrupt();
468
- // }
469
- Path filePath = Paths.get(Config.getFileCacheDirectory(), fileid.replace('/', '.')+"."+filename);
470
- byte[] bytes = Files.readAllBytes(filePath);
471
- return ResponseEntity.ok()
472
- .contentType(mimeType)
473
- .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + filename)
474
- .body(bytes);
475
- }
476
-
477
-
478
- //this is for the way that implment GridCacheForStream
479
- @GetMapping("/GetFileUseCacheStream")
480
- public ResponseEntity<InputStreamResource> getFileUseCacheStream(@RequestParam("id") String fileid) throws IOException {
481
-
482
- MediaType mimeType = getMimeType(fileid);
483
- String name = fileid.replace('/', '.');
484
-
485
-
486
- InputStream inputStream = GridJsWorkbook.CacheImp.loadStream(fileid);
487
- if (inputStream == null) {
488
- // Handle the case where the file is not found
489
- return ResponseEntity.notFound().build();
181
+ public ResponseEntity<?> getFile(@RequestParam("id") String id) {
182
+ return super.getFile(id);
490
183
  }
491
184
 
492
- HttpHeaders headers = new HttpHeaders();
493
- headers.setContentType(mimeType);
494
- headers.setContentDispositionFormData("attachment", name);
495
-
496
- return ResponseEntity.ok()
497
- .headers(headers)
498
- .body(new InputStreamResource(inputStream));
499
-
185
+ @PostMapping("/Download")
186
+ public ResponseEntity<String> download(HttpServletRequest request) {
187
+ return super.download(request);
500
188
  }
501
189
 
502
190
 
503
191
 
504
- private static void InterruptMonitor(GridInterruptMonitor monitor,int milliseconds)
505
- {
506
192
 
507
- try
508
- {
509
- Thread.sleep(milliseconds);
510
-
511
- (monitor).interrupt();
512
- }
513
- catch (Exception e)
514
- {
515
- System.out.println("Succeeded for load in give time.");
516
- }
517
- }
518
-
519
- @PostMapping("/Download")
520
- public ResponseEntity<String> download(HttpServletRequest request) {
521
- String p = request.getParameter("p");
522
- String uid = request.getParameter("uid");
523
- String filename = request.getParameter("file");
524
-
525
- GridJsWorkbook gwb = new GridJsWorkbook();
526
- try {
527
- gwb.mergeExcelFileFromJson(uid, p);
528
-
529
- GridInterruptMonitor m = new GridInterruptMonitor();
530
- gwb.setInterruptMonitorForSave(m);
531
-
532
- ExecutorService executor = Executors.newSingleThreadExecutor();
533
- executor.submit(() -> InterruptMonitor(m, 30 * 1000));
534
-
535
- try {
536
- gwb.saveToCacheWithFileName(uid, filename, null);
537
- } catch (Exception ex) {
538
- if (ex instanceof GridCellException) {
539
- return ResponseEntity
540
- .ok(((GridCellException) ex).getMessage() + ((GridCellException) ex).getCode());
541
- }
542
- }
543
-
544
- String fileUrl = null;
545
- if (GridJsWorkbook.CacheImp != null) {
546
- fileUrl = GridJsWorkbook.CacheImp.getFileUrl(uid + "/" + filename);
547
- } else {
548
- fileUrl = "/GridJs2/GetFile?id=" + uid + "&filename=" + filename;
549
- }
550
- return ResponseEntity.ok("\""+fileUrl+"\"");
551
- } catch (Exception e) {
552
- // TODO Auto-generated catch block
553
- return new ResponseEntity<>(gwb.errorJson(e.getMessage()), HttpStatus.OK);
554
- }
555
- }
556
193
 
557
194
 
558
195
  }
@@ -164,7 +164,7 @@ html, body {
164
164
  const imageuploadurl1 = "/GridJs2/AddImage";
165
165
  const imageuploadurl2 = "/GridJs2/AddImageByURL";
166
166
  const imagecopyurl = "/GridJs2/CopyImage"; // x.spreadsheet.locale('zh-cn');
167
- const lazyLoadingUrl = "/GridJs2/LazyLoading";
167
+ const lazyLoadingUrl = "/GridJs2/LazyLoadingStreamJson";
168
168
  xs = x_spreadsheet('#gridjs-demo-uid', option).loadData(sheets).change((cdata) => {
169
169
  console.log(cdata);
170
170
  console.log(xs.validate());
@@ -165,7 +165,7 @@ html, body {
165
165
  const imageuploadurl1 = "/GridJs2/AddImage";
166
166
  const imageuploadurl2 = "/GridJs2/AddImageByURL";
167
167
  const imagecopyurl = "/GridJs2/CopyImage"; // x.spreadsheet.locale('zh-cn');
168
- const lazyLoadingUrl = "/GridJs2/LazyLoading";
168
+ const lazyLoadingUrl = "/GridJs2/LazyLoadingStreamJson";
169
169
  xs = x_spreadsheet('#gridjs-demo-uid', option).loadData(sheets).change((cdata) => {
170
170
  console.log(cdata);
171
171
  console.log(xs.validate());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridjs-spreadsheet",
3
- "version": "25.4.0",
3
+ "version": "25.6.0",
4
4
  "description": "this is the client side script for GridJs which is a lightweight, scalable, and customizable toolkit that provides cross-platform web applications, enables convenient development for editing or viewing Excel/Spreadsheet files, offers simple deployment, and provides easy-to-use APIs based on JSON format.",
5
5
  "types": "index.d.ts",
6
6
  "main": "xspreadsheet.js",
package/readme.md CHANGED
@@ -327,6 +327,16 @@ v25.4:
327
327
 
328
328
  - support show statistics information in the lower right corner when cells are selected
329
329
 
330
+ v25.5:
331
+
332
+ - add support for Polish menus.
333
+ - support APIs for insert/delete rows/columns
334
+
335
+ v25.6:
336
+
337
+ - support APIs for resize rows/columns
338
+ - support APIs for hide/unhide rows/columns
339
+
330
340
  ## License
331
341
 
332
342
  MIT
package/xspreadsheet.css CHANGED
@@ -145,14 +145,14 @@ body {
145
145
  height: 60px;
146
146
  margin: 10px;
147
147
  background-repeat: no-repeat;
148
- background-image: url(9ab1b217edd126e8925e88cc8f25a154.svg);
148
+ background-image: url(555f60323063f2b68b6eac7ce9c45b19.svg);
149
149
  }
150
150
  .x-spreadsheet-banner-icon-s {
151
151
  width: 30px;
152
152
  height: 30px;
153
153
  margin: 5px;
154
154
  background-repeat: no-repeat;
155
- background-image: url(9ab1b217edd126e8925e88cc8f25a154.svg);
155
+ background-image: url(555f60323063f2b68b6eac7ce9c45b19.svg);
156
156
  }
157
157
  .x-spreadsheet-banner-filename {
158
158
  width: max-content;
@@ -484,6 +484,14 @@ body {
484
484
  .x-spreadsheet-selector .x-spreadsheet-selector-autofill {
485
485
  border: 1px dashed rgba(0, 0, 0, 0.45);
486
486
  }
487
+ .x-spreadsheet-selector .x-spreadsheet-selector-userlabel {
488
+ position: absolute;
489
+ top: -20px;
490
+ /* 比父级 div 向上偏移 20px */
491
+ left: 0;
492
+ /* 固定在父级 div 的左边 */
493
+ padding: 4px 8px;
494
+ }
487
495
  .x-spreadsheet-selector .x-spreadsheet-selector-corner {
488
496
  pointer-events: auto;
489
497
  position: absolute;
@@ -1294,7 +1302,7 @@ form fieldset select {
1294
1302
  display: inline-block;
1295
1303
  }
1296
1304
  .x-spreadsheet-icon .x-spreadsheet-icon-img {
1297
- background-image: url(2922578eabb1a88d1974da56c65189ba.svg);
1305
+ background-image: url(a3b683289420fd8ec937908397907279.svg);
1298
1306
  position: absolute;
1299
1307
  width: 262px;
1300
1308
  height: 444px;
@@ -1687,10 +1695,31 @@ form fieldset select {
1687
1695
  z-index: 1000;
1688
1696
  display: flex;
1689
1697
  flex-direction: column;
1690
- width: 50%;
1691
- height: 50%;
1698
+ min-width: 20%;
1692
1699
  overflow: hidden;
1693
1700
  }
1701
+ .x-spreadsheet-modal-radio-container {
1702
+ display: flex;
1703
+ flex-direction: column;
1704
+ gap: 10px;
1705
+ padding: 10px 0;
1706
+ align-items: flex-start;
1707
+ }
1708
+ .x-spreadsheet-modal-radio-option {
1709
+ display: flex;
1710
+ align-items: center;
1711
+ cursor: pointer;
1712
+ }
1713
+ .x-spreadsheet-modal-radio-option input[type="radio"] {
1714
+ margin-right: 8px;
1715
+ width: 16px;
1716
+ height: 16px;
1717
+ padding: 0;
1718
+ }
1719
+ .x-spreadsheet-modal-radio-option label {
1720
+ font-size: 14px;
1721
+ margin: 0;
1722
+ }
1694
1723
  @media screen and (max-width: 480px) {
1695
1724
  .x-spreadsheet-modal-component {
1696
1725
  width: 90% !important;