gridjs-spreadsheet 26.5.3 → 26.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.
package/example/pom.xml CHANGED
@@ -17,7 +17,7 @@
17
17
  </repositories>
18
18
  <groupId>com.aspose.gridjs</groupId>
19
19
  <artifactId>gridjsdemo</artifactId>
20
- <version>26.5</version>
20
+ <version>26.6</version>
21
21
  <name>gridjsdemo</name>
22
22
  <description>GridJs Demo project for Spring Boot</description>
23
23
  <properties>
@@ -72,10 +72,7 @@ html, body {
72
72
 
73
73
  <script>
74
74
 
75
- function vtrace() {
76
- let stack = (new Error()).stack
77
- console.log(stack);
78
- }
75
+
79
76
 
80
77
 
81
78
 
@@ -165,7 +162,8 @@ html, body {
165
162
  const imageuploadurl2 = "/GridJs2/AddImageByURL";
166
163
  const imagecopyurl = "/GridJs2/CopyImage"; // x.spreadsheet.locale('zh-cn');
167
164
  const lazyLoadingUrl = "/GridJs2/LazyLoadingStreamJson";
168
- xs = x_spreadsheet('#gridjs-demo-uid', option).loadData(sheets).change((cdata) => {
165
+ const activeSheetName = jsondata.actname;
166
+ xs = x_spreadsheet('#gridjs-demo-uid', option).loadData(sheets,activeSheetName).change((cdata) => {
169
167
  console.log(cdata);
170
168
  console.log(xs.validate());
171
169
  }
@@ -218,80 +216,21 @@ html, body {
218
216
  xs.setLazyLoadingUrl(lazyLoadingUrl);
219
217
  xs.setOpenFileUrl("/gridjsdemo/list");
220
218
 
221
- let activeSheetName = jsondata.actname;
222
-
223
- if (xs.bottombar.dataNames.indexOf(activeSheetName) >= 0) {
224
- xs.setActiveSheetByName(activeSheetName).setActiveCell(jsondata.actrow, jsondata.actcol);
225
219
 
220
+ if (xs.getActiveSheetName() == activeSheetName) {
221
+ xs.setActiveCell(jsondata.actrow, jsondata.actcol);
226
222
  } else {
227
- //some times if the active sheet is invisible or chartworksheet ,just use the first worksheet
228
- activeSheetName = xs.bottombar.dataNames[0];
229
- xs.setActiveSheetByName(activeSheetName).setActiveCell(0, 0);
223
+ // some times if the activeSheetName sheet is invisible or chartworksheet ,just use the first visible worksheet as active sheet
224
+ // set A1 as default active cell
225
+ xs.setActiveCell(0, 0);
230
226
  }
231
227
 
232
228
 
233
229
  }
234
230
 
235
- function ColorReverse(OldColorValue) {
236
- var OldColorValue = '0x' + OldColorValue.replace(/#/g, "");
237
- var str = '000000' + (0xFFFFFF - OldColorValue).toString(16);
238
- return '#' + str.substring(str.length - 6, str.length);
239
- }
240
- function save() {
241
- if (!xs.buffer.isFinish()) {
242
- alert('updating is inprogress,please try later');
243
- return;
244
- }
245
- let datas = xs.datas;
246
- delete datas.history;
247
- delete datas.search;
248
- delete datas.images;
249
- delete datas.shapes;
250
-
251
- var jsondata = {
252
- sheetname: xs.sheet.data.name,
253
- actrow: xs.sheet.data.selector.ri,
254
- actcol: xs.sheet.data.selector.ci,
255
- datas: xs.getUpdateDatas(),
256
- };
257
-
258
- const data = {
259
- p: JSON.stringify(jsondata),
260
- uid: uniqueid,
261
- };
262
231
 
263
232
 
264
- $.ajax({
265
- url: local + '/GridJs2/Download',
266
- type: 'post',
267
-
268
- data: data,
269
- success: function (datar, stutas, xhr) {
270
- console.log(datar);
271
- if (datar.startsWith('{')) {
272
- var ret = JSON.parse(datar);
273
- if (ret.err) {
274
- alert(ret.err);
275
- }
276
- } else {
277
- // window.location = local + '/GridJs2/Download2/' + datar;
278
- window.location = datar;
279
- }
280
- },
281
- });
282
-
283
-
284
- }
285
-
286
233
  </script>
287
234
 
288
- <div style="display: none;z-index: 999;">
289
- <div title='text highlight' id="textselectform">
290
- <div>
291
- <textarea id='textselect' name='textselect' rows='4' cols='50'>
292
- </textarea>
293
- </div>
294
- </div>'
295
- </div>
296
235
  </body>
297
236
  </html>
@@ -73,10 +73,7 @@ html, body {
73
73
 
74
74
  <script>
75
75
 
76
- function vtrace() {
77
- let stack = (new Error()).stack
78
- console.log(stack);
79
- }
76
+
80
77
 
81
78
 
82
79
 
@@ -166,7 +163,8 @@ html, body {
166
163
  const imageuploadurl2 = "/GridJs2/AddImageByURL";
167
164
  const imagecopyurl = "/GridJs2/CopyImage"; // x.spreadsheet.locale('zh-cn');
168
165
  const lazyLoadingUrl = "/GridJs2/LazyLoadingStreamJson";
169
- xs = x_spreadsheet('#gridjs-demo-uid', option).loadData(sheets).change((cdata) => {
166
+ const activeSheetName = jsondata.actname;
167
+ xs = x_spreadsheet('#gridjs-demo-uid', option).loadData(sheets,activeSheetName).change((cdata) => {
170
168
  console.log(cdata);
171
169
  console.log(xs.validate());
172
170
  }
@@ -219,80 +217,21 @@ html, body {
219
217
  xs.setLazyLoadingUrl(lazyLoadingUrl);
220
218
  xs.setOpenFileUrl("/gridjsdemo/list");
221
219
 
222
- let activeSheetName = jsondata.actname;
223
-
224
- if (xs.bottombar.dataNames.indexOf(activeSheetName) >= 0) {
225
- xs.setActiveSheetByName(activeSheetName).setActiveCell(jsondata.actrow, jsondata.actcol);
226
220
 
227
- } else {
228
- //some times if the active sheet is invisible or chartworksheet ,just use the first worksheet
229
- activeSheetName = xs.bottombar.dataNames[0];
230
- xs.setActiveSheetByName(activeSheetName).setActiveCell(0, 0);
231
- }
221
+ if (xs.getActiveSheetName() == activeSheetName) {
222
+ xs.setActiveCell(jsondata.actrow, jsondata.actcol);
223
+ } else {
224
+ // some times if the activeSheetName sheet is invisible or chartworksheet ,just use the first visible worksheet as active sheet
225
+ // set A1 as default active cell
226
+ xs.setActiveCell(0, 0);
227
+ }
232
228
 
233
229
 
234
230
  }
235
231
 
236
- function ColorReverse(OldColorValue) {
237
- var OldColorValue = '0x' + OldColorValue.replace(/#/g, "");
238
- var str = '000000' + (0xFFFFFF - OldColorValue).toString(16);
239
- return '#' + str.substring(str.length - 6, str.length);
240
- }
241
- function save() {
242
- if (!xs.buffer.isFinish()) {
243
- alert('updating is inprogress,please try later');
244
- return;
245
- }
246
- let datas = xs.datas;
247
- delete datas.history;
248
- delete datas.search;
249
- delete datas.images;
250
- delete datas.shapes;
251
-
252
- var jsondata = {
253
- sheetname: xs.sheet.data.name,
254
- actrow: xs.sheet.data.selector.ri,
255
- actcol: xs.sheet.data.selector.ci,
256
- datas: xs.getUpdateDatas(),
257
- };
258
-
259
- const data = {
260
- p: JSON.stringify(jsondata),
261
- uid: uniqueid,
262
- };
263
-
264
-
265
- $.ajax({
266
- url: local + '/GridJs2/Download',
267
- type: 'post',
268
-
269
- data: data,
270
- success: function (datar, stutas, xhr) {
271
- console.log(datar);
272
- if (datar.startsWith('{')) {
273
- var ret = JSON.parse(datar);
274
- if (ret.err) {
275
- alert(ret.err);
276
- }
277
- } else {
278
- // window.location = local + '/GridJs2/Download2/' + datar;
279
- window.location = datar;
280
- }
281
- },
282
- });
283
-
284
-
285
- }
232
+
286
233
 
287
234
  </script>
288
-
289
- <div style="display: none;z-index: 999;">
290
- <div title='text highlight' id="textselectform">
291
- <div>
292
- <textarea id='textselect' name='textselect' rows='4' cols='50'>
293
- </textarea>
294
- </div>
295
- </div>'
296
- </div>
235
+
297
236
  </body>
298
237
  </html>
package/index.d.ts CHANGED
@@ -75,7 +75,6 @@ declare module 'gridjs-spreadsheet' {
75
75
  export type REDACTION_DELETED = 'redaction-deleted';
76
76
  export type REDACTION_UPDATED = 'redaction-updated';
77
77
  export type REDACTION_REASON_INSERTED = 'redactionReason-inserted';
78
- export type REDACTION_REASON_CLEARED = 'redactionReason-cleared';
79
78
  export type REDACTION_TRANSPARENCY_TOGGLED = 'redactionTransparency-toggled';
80
79
  export type CUSTOM_BUTTON = 'custom-button';
81
80
  export type UPDATE_SERVER_ERROR = 'updateServerError';
@@ -245,10 +244,6 @@ declare module 'gridjs-spreadsheet' {
245
244
  envt: REDACTION_REASON_INSERTED,
246
245
  callback: (reason: string) => void
247
246
  ): void;
248
- (
249
- envt: REDACTION_REASON_CLEARED,
250
- callback: () => void
251
- ): void;
252
247
  (
253
248
  envt: REDACTION_TRANSPARENCY_TOGGLED,
254
249
  callback: (isTransparent: boolean) => void
@@ -376,6 +371,12 @@ declare module 'gridjs-spreadsheet' {
376
371
  * remove current sheet
377
372
  */
378
373
  deleteSheet(): void;
374
+ /**
375
+ * move sheet to a new tab index
376
+ * @param fromIndex current sheet index
377
+ * @param toIndex target sheet index
378
+ */
379
+ moveSheet(fromIndex: number, toIndex: number): this;
379
380
 
380
381
  /**
381
382
  * insert a redaction shape on a target shape/image
@@ -424,8 +425,28 @@ declare module 'gridjs-spreadsheet' {
424
425
  /**
425
426
  * load data
426
427
  * @param json
428
+ * @param activeSheetName optional sheet name to activate after loading
429
+ */
430
+ loadData(json: Record<string, any>, activeSheetName?: string): this;
431
+ /**
432
+ * set active sheet by index
433
+ * @param id sheet index
434
+ * @param isReActive force re-activate even if already active
435
+ */
436
+ setActiveSheet(id: number, isReActive?: boolean): this;
437
+ /**
438
+ * set active sheet by name
439
+ * @param sheetname sheet name
440
+ * @param isReActive force re-activate even if already active
441
+ */
442
+ setActiveSheetByName(sheetname: string, isReActive?: boolean): this;
443
+ /**
444
+ * set active cell
445
+ * @param rowIndex row index
446
+ * @param colIndex column index
447
+ * @param scrollToCell whether to scroll the active cell into view, defaults to true
427
448
  */
428
- loadData(json: Record<string, any>): void;
449
+ setActiveCell(rowIndex: number, colIndex: number, scrollToCell?: boolean): this;
429
450
  /**
430
451
  * get data
431
452
  */
package/package.json CHANGED
@@ -1,47 +1,45 @@
1
1
  {
2
2
  "name": "gridjs-spreadsheet",
3
- "version": "26.5.3",
3
+ "version": "26.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",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
10
- "keywords": [
11
- "XLS",
12
- "XLSX",
13
- "XLSB",
14
- "CSV",
15
- "to",
16
- "convert",
17
- "PDF",
18
- "JPG",
19
- "PNG",
20
- "HTML",
21
- "ODS",
22
- "Numbers",
23
- "XLSM",
24
- "Spreadsheet",
25
- "Markdown",
26
- "XPS",
27
- "DOCX",
28
- "PPTX",
29
- "MHTML",
30
- "SVG",
31
- "CHM",
32
- "JSON",
33
- "SQL",
34
- "XML",
35
- "Online excel",
36
- "spread-sheets",
37
- "javascript spreadsheet",
38
- "javascript excel",
39
- "excel io",
40
- "sheets",
41
- "sheet",
42
- "javascript",
43
- "excel"
44
- ],
10
+ "keywords": [
11
+ "excel",
12
+ "spreadsheet",
13
+ "web-excel",
14
+ "online-excel",
15
+ "excel-viewer",
16
+ "excel-editor",
17
+ "javascript-excel",
18
+ "javascript-spreadsheet",
19
+ "excel-component",
20
+ "spreadsheet-ui",
21
+ "react-spreadsheet",
22
+ "vue-excel",
23
+ "typescript",
24
+ "xlsx",
25
+ "xls",
26
+ "csv",
27
+ "ods",
28
+ "numbers",
29
+ "xlsm",
30
+ "xlsb",
31
+ "excel-io",
32
+ "redact",
33
+ "redaction",
34
+ "data-redaction",
35
+ "collaborative-editing",
36
+ "excel-api",
37
+ "data-table",
38
+ "datagrid",
39
+ "convert-pdf",
40
+ "convert-html",
41
+ "sheets"
42
+ ],
45
43
  "author": "Aspose Cells Team",
46
44
  "dependencies": {
47
45
  "jquery": "~ 3.6.0",
package/readme.md CHANGED
@@ -1,6 +1,10 @@
1
- # gridjs-spreadsheet
1
+ # gridjs-spreadsheet | Lightweight Online Excel Editor & Web Spreadsheet API
2
2
 
3
- > 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
3
+ > **GridJs-Spreadsheet** is a high-performance, lightweight JavaScript library for building online Excel editors and web-based spreadsheet applications. It provides seamless Excel viewing, editing, and cross-platform deployment with an easy-to-use API.
4
+
5
+ ## Why Choose GridJs-Spreadsheet?
6
+
7
+ Whether you are building a collaborative document platform, an internal data management tool, or an Excel viewer for your web app, GridJs-Spreadsheet offers a comprehensive solution.
4
8
 
5
9
  - [API](#api)
6
10
  - [Preview](#preview)
@@ -220,42 +224,42 @@ xs.cellStyle(ri, ci);
220
224
 
221
225
  ## Features
222
226
 
223
- - Localization/Multiple language UI
224
- - Paint format
225
- - Clear format
226
- - Format
227
- - Number Format
228
- - Font/Font size/ bold/italic/Underline/Strike
229
- - Highlight
230
- - Shape/Image resize/rotate/position ajustment
231
- - Text color/Align/wrapping
232
- - Fill color
233
- - RichText
234
- - Borders
235
- - Merge cells
236
- - Freeze cell
237
- - Copy, Cut, Paste
238
- - Autofill
239
- - Insert/Delete row, column
240
- - Filter row, column
241
- - Zoom in/out
242
- - Sort
243
- - Search
244
- - Formula
245
- - Resize row-height, col-width
246
- - Switch/add/delete sheets
247
- - Condition Format
248
- - Comment
249
- - Add/delete Links
250
- - Print
251
- - Data validations
252
- - Insert picture from web page
253
- - Display chart/shapes
254
- - Display form controls /activeX controls
255
- - Insert/Delete form controls
256
- - Insert/Delete common shapes for autoshape
257
- - Support display two colors gradient in fill effects
258
- - Mobile compatibility
227
+ ### Rich Editing & Formatting
228
+ - Font/Font size/ bold/italic/Underline/Strike
229
+ - Text color/Align/wrapping
230
+ - Fill color / Highlight
231
+ - Number Format / RichText
232
+ - Borders / Condition Format
233
+ - Paint format / Clear format
234
+
235
+ ### Data Management & Analysis
236
+ - Formula support
237
+ - Filter / Sort row and column
238
+ - Data validations
239
+ - Copy, Cut, Paste / Autofill
240
+ - Merge cells / Freeze cell
241
+ - Insert/Delete row, column
242
+ - Resize row-height, col-width
243
+ - Zoom in/out
244
+ - Search
245
+
246
+ ### Visuals & Objects
247
+ - Display chart/shapes
248
+ - Display condition icons
249
+ - Shape/Image resize/rotate/position adjustment
250
+ - Insert/Delete/Copy common shapes for autoshape
251
+ - Insert/Delete/Copy Image
252
+ - Display form controls / ActiveX controls
253
+ - Insert/Delete form controls
254
+ - Support display two colors gradient in fill effects
255
+
256
+ ### Security & Advanced Tools
257
+ - Redact sensitive data
258
+ - Add/delete Comment
259
+ - Add/delete Links
260
+ - Print
261
+ - Localization/Multiple language UI
262
+ - Mobile compatibility
259
263
 
260
264
 
261
265
  ## Github-Demos
@@ -416,6 +420,10 @@ v26.5.3:
416
420
 
417
421
  - Improve scroll in zoom
418
422
 
423
+ v26.6:
424
+
425
+ - Improve redaction feature
426
+
419
427
  ## License
420
428
 
421
429
  MIT
package/xspreadsheet.css CHANGED
@@ -708,6 +708,11 @@ body {
708
708
  .x-spreadsheet-contextmenu .x-spreadsheet-item {
709
709
  width: unset;
710
710
  }
711
+ .x-spreadsheet-contextmenu .x-spreadsheet-item.disabled {
712
+ pointer-events: none;
713
+ opacity: 0.5;
714
+ cursor: default;
715
+ }
711
716
  .x-spreadsheet-item.state,
712
717
  .x-spreadsheet-header.state {
713
718
  padding-left: 35px !important;
@@ -948,6 +953,16 @@ body {
948
953
  background-color: #fff;
949
954
  color: #3c763d !important;
950
955
  }
956
+ .x-spreadsheet-menu > li.x-spreadsheet-dragging {
957
+ opacity: 0.65;
958
+ cursor: grabbing;
959
+ }
960
+ .x-spreadsheet-menu > li.x-spreadsheet-drag-target-before {
961
+ box-shadow: inset 3px 0 0 #3c763d;
962
+ }
963
+ .x-spreadsheet-menu > li.x-spreadsheet-drag-target-after {
964
+ box-shadow: inset -3px 0 0 #3c763d;
965
+ }
951
966
  .x-spreadsheet-menu > li .x-spreadsheet-icon {
952
967
  margin: 0 6px;
953
968
  }