gridjs-spreadsheet 25.9.0 → 25.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridjs-spreadsheet",
3
- "version": "25.9.0",
3
+ "version": "25.10.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/preview.gif ADDED
Binary file
package/readme.md CHANGED
@@ -163,11 +163,11 @@ const s = new Spreadsheet("#gridjs-demo")
163
163
 
164
164
  ## Bind events
165
165
  ```javascript
166
- //single selection
166
+ // single selection
167
167
  xs.on('cell-selected', (cell, ri, ci) => {});
168
- //range selection
168
+ // range selection
169
169
  xs.on('cells-selected', (cell, { sri, sci, eri, eci }) => {});
170
- //shape/image selection
170
+ // shape/image selection
171
171
  xs.on('object-selected', (obj) => { console.log('obj id:', obj.id, ', type: ', obj.type); })
172
172
  // edited on cell
173
173
  xs.on('cell-edited', (text, ri, ci) => {});
@@ -354,6 +354,10 @@ v25.9:
354
354
 
355
355
  - Support to render pattern style for cell
356
356
 
357
+ v25.10:
358
+
359
+ - Support APIs to set customToast
360
+ - Support CSS identify for model window
357
361
 
358
362
  ## License
359
363
 
package/xspreadsheet.css CHANGED
@@ -396,6 +396,8 @@ body {
396
396
  right: 15px;
397
397
  overflow-x: scroll;
398
398
  overflow-y: hidden;
399
+ height: 12px;
400
+ /* 固定高度,避免覆盖表格内容 */
399
401
  }
400
402
  .x-spreadsheet-scrollbar.horizontal > div {
401
403
  height: 1px;
@@ -553,6 +555,19 @@ body {
553
555
  cursor: default;
554
556
  text-align: left;
555
557
  overflow: hidden;
558
+ width: max-content;
559
+ display: flex;
560
+ align-items: center;
561
+ gap: 8px;
562
+ }
563
+ .x-spreadsheet-item .x-spreadsheet-icon {
564
+ flex-shrink: 0;
565
+ }
566
+ .x-spreadsheet-item .title {
567
+ flex-grow: 1;
568
+ white-space: nowrap;
569
+ overflow: hidden;
570
+ text-overflow: ellipsis;
556
571
  }
557
572
  .x-spreadsheet-item.disabled {
558
573
  pointer-events: none;
@@ -568,17 +583,24 @@ body {
568
583
  margin: 5px 0;
569
584
  border: none;
570
585
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
586
+ display: block;
571
587
  }
572
588
  .x-spreadsheet-item .label {
573
589
  float: right;
574
590
  opacity: 0.65;
575
591
  font-size: 1em;
592
+ margin-left: auto;
593
+ padding-left: 10px;
594
+ flex-shrink: 0;
576
595
  }
577
596
  .x-spreadsheet-item .labelcnt {
578
597
  float: right;
579
598
  color: green;
580
599
  font-size: 1em;
581
600
  }
601
+ .x-spreadsheet-contextmenu .x-spreadsheet-item {
602
+ width: unset;
603
+ }
582
604
  .x-spreadsheet-item.state,
583
605
  .x-spreadsheet-header.state {
584
606
  padding-left: 35px !important;
@@ -1153,6 +1175,90 @@ body {
1153
1175
  margin-left: 5px;
1154
1176
  cursor: pointer;
1155
1177
  }
1178
+ .x-spreadsheet-form-checkbox-container {
1179
+ display: flex;
1180
+ align-items: center;
1181
+ }
1182
+ .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox-label {
1183
+ margin-right: 8px;
1184
+ user-select: none;
1185
+ cursor: pointer;
1186
+ color: rgba(0, 0, 0, 0.87);
1187
+ white-space: nowrap;
1188
+ line-height: 1.2;
1189
+ font-size: 75%;
1190
+ }
1191
+ .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox {
1192
+ width: 18px;
1193
+ height: 18px;
1194
+ margin: 0;
1195
+ cursor: pointer;
1196
+ transform: translateY(-4px);
1197
+ }
1198
+ .x-spreadsheet-search-checkbox-fields {
1199
+ display: flex;
1200
+ flex-wrap: wrap;
1201
+ align-items: center;
1202
+ gap: 25px;
1203
+ justify-content: flex-start;
1204
+ }
1205
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container {
1206
+ margin: 0;
1207
+ }
1208
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox-label {
1209
+ max-width: 150px;
1210
+ overflow: hidden;
1211
+ text-overflow: ellipsis;
1212
+ }
1213
+ @media screen and (max-width: 600px) {
1214
+ .x-spreadsheet-search-checkbox-fields {
1215
+ gap: 15px;
1216
+ }
1217
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container:nth-child(3) {
1218
+ flex-basis: 100%;
1219
+ margin-top: 8px;
1220
+ }
1221
+ }
1222
+ @media screen and (max-width: 480px) {
1223
+ .x-spreadsheet-search-checkbox-fields {
1224
+ gap: 10px;
1225
+ }
1226
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox-label {
1227
+ font-size: 12px;
1228
+ max-width: 120px;
1229
+ }
1230
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container:nth-child(n+2) {
1231
+ flex-basis: 100%;
1232
+ margin-top: 5px;
1233
+ }
1234
+ }
1235
+ @media screen and (max-width: 500px) {
1236
+ .x-spreadsheet-modal .x-spreadsheet-modal-content {
1237
+ padding: 0.5em 0.75em;
1238
+ }
1239
+ .x-spreadsheet-modal .x-spreadsheet-form-fields {
1240
+ margin-bottom: 8px;
1241
+ }
1242
+ .x-spreadsheet-modal .x-spreadsheet-form-fields .x-spreadsheet-form-field {
1243
+ margin-left: 5px;
1244
+ margin-bottom: 8px;
1245
+ }
1246
+ .x-spreadsheet-modal .x-spreadsheet-form-fields .x-spreadsheet-form-field .label {
1247
+ margin: 0 5px 0 0;
1248
+ font-size: 12px;
1249
+ }
1250
+ .x-spreadsheet-modal .x-spreadsheet-form-fields .x-spreadsheet-form-input input {
1251
+ font-size: 14px;
1252
+ padding: 0 6px;
1253
+ }
1254
+ .x-spreadsheet-modal .x-spreadsheet-buttons {
1255
+ gap: 8px;
1256
+ }
1257
+ .x-spreadsheet-modal .x-spreadsheet-buttons .x-spreadsheet-button {
1258
+ padding: 6px 12px;
1259
+ font-size: 12px;
1260
+ }
1261
+ }
1156
1262
  .x-spreadsheet-form-select {
1157
1263
  position: relative;
1158
1264
  display: inline-block;
@@ -1381,7 +1487,7 @@ form fieldset select {
1381
1487
  display: inline-block;
1382
1488
  }
1383
1489
  .x-spreadsheet-icon .x-spreadsheet-icon-img {
1384
- background-image: url(ae125bc972519a804601f2ead209255c.svg);
1490
+ background-image: url(d8a61c22046be134a6e067e41bcf53b5.svg);
1385
1491
  position: absolute;
1386
1492
  width: 262px;
1387
1493
  height: 444px;
@@ -1727,6 +1833,46 @@ form fieldset select {
1727
1833
  left: 0px;
1728
1834
  top: -108px;
1729
1835
  }
1836
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.copy {
1837
+ left: -54px;
1838
+ top: -108px;
1839
+ }
1840
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.paste {
1841
+ left: -72px;
1842
+ top: -108px;
1843
+ }
1844
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.cut {
1845
+ left: -90px;
1846
+ top: -108px;
1847
+ }
1848
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.deleteRow {
1849
+ left: -108px;
1850
+ top: -108px;
1851
+ }
1852
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.clearContent {
1853
+ left: -126px;
1854
+ top: -108px;
1855
+ }
1856
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.cellFormat {
1857
+ left: -144px;
1858
+ top: -108px;
1859
+ }
1860
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.dataValidation {
1861
+ left: -162px;
1862
+ top: -108px;
1863
+ }
1864
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.disableEdit {
1865
+ left: -180px;
1866
+ top: -108px;
1867
+ }
1868
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.lineHide {
1869
+ left: -198px;
1870
+ top: -108px;
1871
+ }
1872
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.lineUnhide {
1873
+ left: -216px;
1874
+ top: -108px;
1875
+ }
1730
1876
  .x-spreadsheet-formula-bar {
1731
1877
  height: 25px;
1732
1878
  line-height: 25px;