gridjs-spreadsheet 25.9.0 → 25.11.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.11.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
@@ -127,6 +127,7 @@ const s = new Spreadsheet("#gridjs-demo")
127
127
  showToolbar: true,
128
128
  showGrid: true,
129
129
  showContextmenu: true,
130
+ local: 'en',
130
131
  view: {
131
132
  height: () => document.documentElement.clientHeight,
132
133
  width: () => document.documentElement.clientWidth,
@@ -163,11 +164,11 @@ const s = new Spreadsheet("#gridjs-demo")
163
164
 
164
165
  ## Bind events
165
166
  ```javascript
166
- //single selection
167
+ // single selection
167
168
  xs.on('cell-selected', (cell, ri, ci) => {});
168
- //range selection
169
+ // range selection
169
170
  xs.on('cells-selected', (cell, { sri, sci, eri, eci }) => {});
170
- //shape/image selection
171
+ // shape/image selection
171
172
  xs.on('object-selected', (obj) => { console.log('obj id:', obj.id, ', type: ', obj.type); })
172
173
  // edited on cell
173
174
  xs.on('cell-edited', (text, ri, ci) => {});
@@ -354,6 +355,15 @@ v25.9:
354
355
 
355
356
  - Support to render pattern style for cell
356
357
 
358
+ v25.10:
359
+
360
+ - Support APIs to set customToast
361
+ - Support CSS identify for model window
362
+
363
+ v25.11:
364
+
365
+ - Support fill color settings for charts
366
+ - Support 'Fill Color ' 'Font Color' button dropdown selection and click to fill.
357
367
 
358
368
  ## License
359
369
 
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;
@@ -779,6 +801,14 @@ body {
779
801
  .x-spreadsheet-bottombar-actions .x-spreadsheet-dropdown {
780
802
  margin: 0 6px;
781
803
  }
804
+ .x-spreadsheet-bottombar-actions .x-spreadsheet-dropdown-content .x-spreadsheet-item {
805
+ width: 180px !important;
806
+ max-width: 180px;
807
+ display: block;
808
+ white-space: nowrap;
809
+ overflow: hidden;
810
+ text-overflow: ellipsis;
811
+ }
782
812
  .x-spreadsheet-menu > li {
783
813
  flex-shrink: 0;
784
814
  line-height: 1.25em;
@@ -1153,6 +1183,90 @@ body {
1153
1183
  margin-left: 5px;
1154
1184
  cursor: pointer;
1155
1185
  }
1186
+ .x-spreadsheet-form-checkbox-container {
1187
+ display: flex;
1188
+ align-items: center;
1189
+ }
1190
+ .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox-label {
1191
+ margin-right: 8px;
1192
+ user-select: none;
1193
+ cursor: pointer;
1194
+ color: rgba(0, 0, 0, 0.87);
1195
+ white-space: nowrap;
1196
+ line-height: 1.2;
1197
+ font-size: 75%;
1198
+ }
1199
+ .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox {
1200
+ width: 18px;
1201
+ height: 18px;
1202
+ margin: 0;
1203
+ cursor: pointer;
1204
+ transform: translateY(-4px);
1205
+ }
1206
+ .x-spreadsheet-search-checkbox-fields {
1207
+ display: flex;
1208
+ flex-wrap: wrap;
1209
+ align-items: center;
1210
+ gap: 25px;
1211
+ justify-content: flex-start;
1212
+ }
1213
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container {
1214
+ margin: 0;
1215
+ }
1216
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox-label {
1217
+ max-width: 150px;
1218
+ overflow: hidden;
1219
+ text-overflow: ellipsis;
1220
+ }
1221
+ @media screen and (max-width: 600px) {
1222
+ .x-spreadsheet-search-checkbox-fields {
1223
+ gap: 15px;
1224
+ }
1225
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container:nth-child(3) {
1226
+ flex-basis: 100%;
1227
+ margin-top: 8px;
1228
+ }
1229
+ }
1230
+ @media screen and (max-width: 480px) {
1231
+ .x-spreadsheet-search-checkbox-fields {
1232
+ gap: 10px;
1233
+ }
1234
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container .x-spreadsheet-form-checkbox-label {
1235
+ font-size: 12px;
1236
+ max-width: 120px;
1237
+ }
1238
+ .x-spreadsheet-search-checkbox-fields .x-spreadsheet-form-checkbox-container:nth-child(n+2) {
1239
+ flex-basis: 100%;
1240
+ margin-top: 5px;
1241
+ }
1242
+ }
1243
+ @media screen and (max-width: 500px) {
1244
+ .x-spreadsheet-modal .x-spreadsheet-modal-content {
1245
+ padding: 0.5em 0.75em;
1246
+ }
1247
+ .x-spreadsheet-modal .x-spreadsheet-form-fields {
1248
+ margin-bottom: 8px;
1249
+ }
1250
+ .x-spreadsheet-modal .x-spreadsheet-form-fields .x-spreadsheet-form-field {
1251
+ margin-left: 5px;
1252
+ margin-bottom: 8px;
1253
+ }
1254
+ .x-spreadsheet-modal .x-spreadsheet-form-fields .x-spreadsheet-form-field .label {
1255
+ margin: 0 5px 0 0;
1256
+ font-size: 12px;
1257
+ }
1258
+ .x-spreadsheet-modal .x-spreadsheet-form-fields .x-spreadsheet-form-input input {
1259
+ font-size: 14px;
1260
+ padding: 0 6px;
1261
+ }
1262
+ .x-spreadsheet-modal .x-spreadsheet-buttons {
1263
+ gap: 8px;
1264
+ }
1265
+ .x-spreadsheet-modal .x-spreadsheet-buttons .x-spreadsheet-button {
1266
+ padding: 6px 12px;
1267
+ font-size: 12px;
1268
+ }
1269
+ }
1156
1270
  .x-spreadsheet-form-select {
1157
1271
  position: relative;
1158
1272
  display: inline-block;
@@ -1163,6 +1277,24 @@ body {
1163
1277
  color: rgba(0, 0, 0, 0.87);
1164
1278
  user-select: none;
1165
1279
  box-shadow: inset 0 1px 2px hsla(0, 0%, 4%, 0.06);
1280
+ transition: box-shadow 0.2s ease;
1281
+ }
1282
+ .x-spreadsheet-form-select::after {
1283
+ content: '';
1284
+ position: absolute;
1285
+ top: 50%;
1286
+ right: 10px;
1287
+ width: 0;
1288
+ height: 0;
1289
+ border-left: 5px solid transparent;
1290
+ border-right: 5px solid transparent;
1291
+ border-top: 6px solid #6c757d;
1292
+ pointer-events: none;
1293
+ transform: translateY(-50%);
1294
+ transition: transform 0.2s ease;
1295
+ }
1296
+ .x-spreadsheet-form-select.open::after {
1297
+ transform: translateY(-50%) rotate(180deg);
1166
1298
  }
1167
1299
  .x-spreadsheet-form-select .input-text {
1168
1300
  text-overflow: ellipsis;
@@ -1171,7 +1303,9 @@ body {
1171
1303
  width: auto;
1172
1304
  height: 30px;
1173
1305
  line-height: 30px;
1174
- padding: 0 8px;
1306
+ padding: 0 26px 0 10px;
1307
+ display: flex;
1308
+ align-items: center;
1175
1309
  }
1176
1310
  .x-spreadsheet-form-fields {
1177
1311
  display: flex;
@@ -1188,7 +1322,6 @@ body {
1188
1322
  }
1189
1323
  .x-spreadsheet-form-field {
1190
1324
  display: block;
1191
- vertical-align: middle;
1192
1325
  margin-left: 10px;
1193
1326
  margin-bottom: 10px;
1194
1327
  }
@@ -1203,6 +1336,96 @@ body {
1203
1336
  color: #f04134;
1204
1337
  font-size: 0.9em;
1205
1338
  }
1339
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-content {
1340
+ background: linear-gradient(180deg, #f9fbff 0%, #ffffff 45%);
1341
+ padding: 24px;
1342
+ }
1343
+ .x-spreadsheet-modal-link .x-spreadsheet-item {
1344
+ cursor: pointer;
1345
+ width: 100%;
1346
+ }
1347
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-body {
1348
+ display: flex;
1349
+ flex-direction: column;
1350
+ gap: 18px;
1351
+ }
1352
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section {
1353
+ padding: 18px 20px;
1354
+ display: flex;
1355
+ flex-direction: column;
1356
+ gap: 20px;
1357
+ }
1358
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-field,
1359
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-field {
1360
+ width: 100%;
1361
+ }
1362
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-field-group {
1363
+ display: grid;
1364
+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
1365
+ gap: 16px;
1366
+ }
1367
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-field-group > .x-spreadsheet-form-fields {
1368
+ width: 100%;
1369
+ }
1370
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-field {
1371
+ display: flex;
1372
+ flex-wrap: wrap;
1373
+ align-items: center;
1374
+ }
1375
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-field .label {
1376
+ flex: 0 0 120px;
1377
+ margin-bottom: 6px;
1378
+ }
1379
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-field .tip {
1380
+ flex: 0 0 100%;
1381
+ margin-left: 120px;
1382
+ font-size: 12px;
1383
+ }
1384
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-input,
1385
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-select {
1386
+ flex: 1;
1387
+ width: 100%;
1388
+ }
1389
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-input input {
1390
+ width: 100%;
1391
+ }
1392
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-actions {
1393
+ padding: 18px 24px 0;
1394
+ margin: 0 -24px -8px;
1395
+ border-top: 1px solid #e3e8ef;
1396
+ background: #fff;
1397
+ }
1398
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-actions .x-spreadsheet-buttons {
1399
+ padding: 0;
1400
+ }
1401
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-actions .x-spreadsheet-button {
1402
+ min-width: 90px;
1403
+ }
1404
+ @media screen and (max-width: 520px) {
1405
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-content {
1406
+ padding: 16px;
1407
+ }
1408
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section {
1409
+ padding: 14px 16px;
1410
+ gap: 16px;
1411
+ }
1412
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-field {
1413
+ flex-direction: column;
1414
+ align-items: stretch;
1415
+ }
1416
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-field .label {
1417
+ flex: none;
1418
+ width: 100%;
1419
+ margin-bottom: 4px;
1420
+ }
1421
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-section .x-spreadsheet-form-field .tip {
1422
+ margin-left: 0;
1423
+ }
1424
+ .x-spreadsheet-modal-link .x-spreadsheet-modal-link-actions {
1425
+ padding: 16px 16px 0;
1426
+ margin: 0 -16px -8px;
1427
+ }
1428
+ }
1206
1429
  .x-spreadsheet-dimmer {
1207
1430
  display: none;
1208
1431
  position: absolute;
@@ -1381,7 +1604,7 @@ form fieldset select {
1381
1604
  display: inline-block;
1382
1605
  }
1383
1606
  .x-spreadsheet-icon .x-spreadsheet-icon-img {
1384
- background-image: url(ae125bc972519a804601f2ead209255c.svg);
1607
+ background-image: url(d8a61c22046be134a6e067e41bcf53b5.svg);
1385
1608
  position: absolute;
1386
1609
  width: 262px;
1387
1610
  height: 444px;
@@ -1727,6 +1950,46 @@ form fieldset select {
1727
1950
  left: 0px;
1728
1951
  top: -108px;
1729
1952
  }
1953
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.copy {
1954
+ left: -54px;
1955
+ top: -108px;
1956
+ }
1957
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.paste {
1958
+ left: -72px;
1959
+ top: -108px;
1960
+ }
1961
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.cut {
1962
+ left: -90px;
1963
+ top: -108px;
1964
+ }
1965
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.deleteRow {
1966
+ left: -108px;
1967
+ top: -108px;
1968
+ }
1969
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.clearContent {
1970
+ left: -126px;
1971
+ top: -108px;
1972
+ }
1973
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.cellFormat {
1974
+ left: -144px;
1975
+ top: -108px;
1976
+ }
1977
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.dataValidation {
1978
+ left: -162px;
1979
+ top: -108px;
1980
+ }
1981
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.disableEdit {
1982
+ left: -180px;
1983
+ top: -108px;
1984
+ }
1985
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.lineHide {
1986
+ left: -198px;
1987
+ top: -108px;
1988
+ }
1989
+ .x-spreadsheet-icon .x-spreadsheet-icon-img.lineUnhide {
1990
+ left: -216px;
1991
+ top: -108px;
1992
+ }
1730
1993
  .x-spreadsheet-formula-bar {
1731
1994
  height: 25px;
1732
1995
  line-height: 25px;
@@ -1993,7 +2256,6 @@ input[type=number]::-webkit-outer-spin-button {
1993
2256
  }
1994
2257
  .x-spreadsheet-bar-label {
1995
2258
  flex: 0 0 auto;
1996
- display: inline-block;
1997
2259
  width: 60px;
1998
2260
  height: 100%;
1999
2261
  box-sizing: border-box;