@fileverse-dev/fortune-core 1.3.10 → 1.3.11-mixed

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 (71) hide show
  1. package/es/api/range.js +20 -0
  2. package/es/api/sheet.js +30 -2
  3. package/es/events/keyboard.js +74 -37
  4. package/es/events/mouse.js +1 -0
  5. package/es/events/paste.js +124 -56
  6. package/es/locale/en.d.ts +3 -0
  7. package/es/locale/en.js +3 -0
  8. package/es/locale/es.d.ts +3 -0
  9. package/es/locale/es.js +3 -0
  10. package/es/locale/hi.d.ts +3 -0
  11. package/es/locale/hi.js +3 -0
  12. package/es/locale/index.d.ts +3 -0
  13. package/es/locale/zh.d.ts +3 -0
  14. package/es/locale/zh.js +3 -0
  15. package/es/locale/zh_tw.d.ts +3 -0
  16. package/es/locale/zh_tw.js +3 -0
  17. package/es/modules/ConditionFormat.js +26 -0
  18. package/es/modules/cell.js +58 -2
  19. package/es/modules/comment.js +129 -24
  20. package/es/modules/dataVerification.js +34 -1
  21. package/es/modules/dropCell.js +65 -1
  22. package/es/modules/format.js +12 -7
  23. package/es/modules/formula.js +14 -0
  24. package/es/modules/hyperlink.js +52 -5
  25. package/es/modules/merge.js +93 -1
  26. package/es/modules/moveCells.js +35 -9
  27. package/es/modules/rowcol.js +75 -2
  28. package/es/modules/searchReplace.js +58 -2
  29. package/es/modules/selection.js +152 -42
  30. package/es/modules/sort.js +74 -9
  31. package/es/modules/splitColumn.js +21 -0
  32. package/es/modules/toolbar.js +46 -3
  33. package/es/modules/validation.js +6 -3
  34. package/es/settings.d.ts +5 -0
  35. package/es/types.d.ts +2 -0
  36. package/lib/api/range.js +20 -0
  37. package/lib/api/sheet.js +29 -1
  38. package/lib/events/keyboard.js +74 -37
  39. package/lib/events/mouse.js +1 -0
  40. package/lib/events/paste.js +122 -54
  41. package/lib/locale/en.d.ts +3 -0
  42. package/lib/locale/en.js +3 -0
  43. package/lib/locale/es.d.ts +3 -0
  44. package/lib/locale/es.js +3 -0
  45. package/lib/locale/hi.d.ts +3 -0
  46. package/lib/locale/hi.js +3 -0
  47. package/lib/locale/index.d.ts +3 -0
  48. package/lib/locale/zh.d.ts +3 -0
  49. package/lib/locale/zh.js +3 -0
  50. package/lib/locale/zh_tw.d.ts +3 -0
  51. package/lib/locale/zh_tw.js +3 -0
  52. package/lib/modules/ConditionFormat.js +26 -0
  53. package/lib/modules/cell.js +58 -2
  54. package/lib/modules/comment.js +129 -24
  55. package/lib/modules/dataVerification.js +34 -1
  56. package/lib/modules/dropCell.js +65 -1
  57. package/lib/modules/format.js +12 -7
  58. package/lib/modules/formula.js +14 -0
  59. package/lib/modules/hyperlink.js +52 -5
  60. package/lib/modules/merge.js +93 -1
  61. package/lib/modules/moveCells.js +35 -9
  62. package/lib/modules/rowcol.js +75 -2
  63. package/lib/modules/searchReplace.js +58 -2
  64. package/lib/modules/selection.js +152 -42
  65. package/lib/modules/sort.js +74 -9
  66. package/lib/modules/splitColumn.js +21 -0
  67. package/lib/modules/toolbar.js +46 -3
  68. package/lib/modules/validation.js +6 -3
  69. package/lib/settings.d.ts +5 -0
  70. package/lib/types.d.ts +2 -0
  71. package/package.json +1 -1
@@ -216,19 +216,19 @@ var handleFormulaOnPaste = function handleFormulaOnPaste(ctx, d) {
216
216
  cell.f = f;
217
217
  cell.m = v.toString();
218
218
  x[c] = cell;
219
+ changes.push({
220
+ sheetId: ctx.currentSheetId,
221
+ path: ["celldata"],
222
+ value: {
223
+ r: r,
224
+ c: c,
225
+ v: d[r][c]
226
+ },
227
+ key: "".concat(r, "_").concat(c),
228
+ type: "update"
229
+ });
219
230
  }
220
231
  d[r] = x;
221
- changes.push({
222
- sheetId: ctx.currentSheetId,
223
- path: ["celldata"],
224
- value: {
225
- r: r,
226
- c: c,
227
- v: d[r][c]
228
- },
229
- key: "".concat(r, "_").concat(c),
230
- type: "update"
231
- });
232
232
  }
233
233
  }
234
234
  if ((_b = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _b === void 0 ? void 0 : _b.updateCellYdoc) {
@@ -236,7 +236,7 @@ var handleFormulaOnPaste = function handleFormulaOnPaste(ctx, d) {
236
236
  }
237
237
  };
238
238
  function pasteHandler(ctx, data, borderInfo) {
239
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
239
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
240
240
  if (ctx.luckysheet_selection_range) {
241
241
  ctx.luckysheet_selection_range = [];
242
242
  }
@@ -362,7 +362,9 @@ function pasteHandler(ctx, data, borderInfo) {
362
362
  ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)].config = cfg;
363
363
  }
364
364
  (0, _refresh.jfrefreshgrid)(ctx, null, undefined);
365
- handleFormulaOnPaste(ctx, d);
365
+ if (data.includes("=")) {
366
+ handleFormulaOnPaste(ctx, d);
367
+ }
366
368
  } else {
367
369
  data = data.replace(/\r/g, "");
368
370
  var dataChe = [];
@@ -418,25 +420,39 @@ function pasteHandler(ctx, data, borderInfo) {
418
420
  }
419
421
  }
420
422
  if (originCell) {
421
- if (originCell.ct && originCell.ct.t === "d" && !isUrl) {
422
- var df = (0, _validation.detectDateFormat)(originalValueStr);
423
- if (df) {
424
- var dateObj = new Date(df.year, df.month - 1, df.day, df.hours, df.minutes, df.seconds);
425
- originCell.v = (0, _format.datenum_local)(dateObj);
426
- } else {
427
- originCell.v = originalValueStr;
428
- }
429
- } else {
430
- originCell.v = isUrl ? originalValueStr : value;
431
- }
432
- if (originCell.ct != null && originCell.ct.fa != null) {
433
- if (originCell.ct.t === "d" && typeof originCell.v !== "number") {
434
- originCell.m = String(originCell.v);
423
+ if (!isUrl) {
424
+ var generated = (0, _format.genarate)(originalValueStr);
425
+ if (generated) {
426
+ var genM = generated[0],
427
+ genCt = generated[1],
428
+ genV = generated[2];
429
+ if ((genCt === null || genCt === void 0 ? void 0 : genCt.t) === "d") {
430
+ originCell.v = genV;
431
+ originCell.m = genM !== null && genM !== void 0 ? genM : originalValueStr;
432
+ originCell.ct = genCt;
433
+ } else {
434
+ originCell.v = value;
435
+ if (originCell.ct != null && originCell.ct.fa != null) {
436
+ if (originCell.ct.t === "d" && typeof originCell.v !== "number") {
437
+ originCell.m = String(originCell.v);
438
+ } else {
439
+ originCell.m = (0, _format.update)(originCell.ct.fa, originCell.v);
440
+ }
441
+ } else {
442
+ originCell.m = typeof originCell.v === "boolean" ? String(originCell.v) : originCell.v;
443
+ }
444
+ }
435
445
  } else {
436
- originCell.m = (0, _format.update)(originCell.ct.fa, originCell.v);
446
+ originCell.v = value;
447
+ if (originCell.ct != null && originCell.ct.fa != null) {
448
+ originCell.m = (0, _format.update)(originCell.ct.fa, originCell.v);
449
+ } else {
450
+ originCell.m = typeof originCell.v === "boolean" ? String(originCell.v) : originCell.v;
451
+ }
437
452
  }
438
453
  } else {
439
- originCell.m = typeof originCell.v === "boolean" ? String(originCell.v) : originCell.v;
454
+ originCell.v = originalValueStr;
455
+ originCell.m = originalValueStr;
440
456
  }
441
457
  if (originCell.f != null && originCell.f.length > 0) {
442
458
  originCell.f = "";
@@ -463,19 +479,24 @@ function pasteHandler(ctx, data, borderInfo) {
463
479
  t: "s"
464
480
  };
465
481
  } else {
466
- cell.v = originalValueStr;
467
- cell.m = originalValueStr;
468
- cell.ct = {
469
- fa: "General",
470
- t: "g"
471
- };
472
482
  if (/^0x?[a-fA-F0-9]+$/.test(value)) {
483
+ cell.v = value;
473
484
  cell.m = value;
474
485
  cell.ct = {
475
486
  fa: "@",
476
487
  t: "s"
477
488
  };
478
- cell.v = value;
489
+ } else {
490
+ var _m = (_j = (0, _format.genarate)(originalValueStr)) !== null && _j !== void 0 ? _j : [],
491
+ m = _m[0],
492
+ ct = _m[1],
493
+ v = _m[2];
494
+ cell.v = v !== null && v !== void 0 ? v : originalValueStr;
495
+ cell.m = m != null ? String(m) : originalValueStr;
496
+ cell.ct = ct !== null && ct !== void 0 ? ct : {
497
+ fa: "General",
498
+ t: "g"
499
+ };
479
500
  }
480
501
  }
481
502
  if (isUrl && url) {
@@ -492,27 +513,29 @@ function pasteHandler(ctx, data, borderInfo) {
492
513
  }
493
514
  x[c + curC] = cell;
494
515
  }
495
- changes.push(changes.push({
516
+ changes.push({
496
517
  sheetId: ctx.currentSheetId,
497
518
  path: ["celldata"],
498
519
  value: {
499
- r: r,
500
- c: c,
501
- v: d[r][c]
520
+ r: r + curR,
521
+ c: c + curC,
522
+ v: d[r + curR][c + curC]
502
523
  },
503
- key: "".concat(r, "_").concat(c),
524
+ key: "".concat(r + curR, "_").concat(c + curC),
504
525
  type: "update"
505
- }));
526
+ });
506
527
  }
507
528
  d[r + curR] = x;
508
529
  }
509
- if ((_j = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _j === void 0 ? void 0 : _j.updateCellYdoc) {
510
- (_k = ctx.hooks) === null || _k === void 0 ? void 0 : _k.updateCellYdoc(changes);
530
+ if ((_k = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _k === void 0 ? void 0 : _k.updateCellYdoc) {
531
+ (_l = ctx.hooks) === null || _l === void 0 ? void 0 : _l.updateCellYdoc(changes);
511
532
  }
512
533
  last.row = [curR, curR + rlen - 1];
513
534
  last.column = [curC, curC + clen - 1];
514
535
  (0, _refresh.jfrefreshgrid)(ctx, null, undefined);
515
- handleFormulaOnPaste(ctx, d);
536
+ if (data.includes("=")) {
537
+ handleFormulaOnPaste(ctx, d);
538
+ }
516
539
  }
517
540
  }
518
541
  function setCellHyperlink(ctx, id, r, c, link) {
@@ -523,7 +546,7 @@ function setCellHyperlink(ctx, id, r, c, link) {
523
546
  ctx.luckysheetfile[index].hyperlink["".concat(r, "_").concat(c)] = link;
524
547
  }
525
548
  function pasteHandlerOfCutPaste(ctx, copyRange) {
526
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
549
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
527
550
  var allowEdit = (0, _utils.isAllowEdit)(ctx);
528
551
  if (!allowEdit || ctx.isFlvReadOnly) return;
529
552
  if (!copyRange) return;
@@ -566,6 +589,7 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
566
589
  if (addr > 0 || addc > 0) {
567
590
  (0, _sheet.expandRowsAndColumns)(d, addr, addc);
568
591
  }
592
+ var changes = [];
569
593
  var borderInfoCompute = (0, _border.getBorderInfoCompute)(ctx, copySheetId);
570
594
  var c_dataVerification = _lodash.default.cloneDeep(ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, copySheetId)].dataVerification) || {};
571
595
  var dataVerification = _lodash.default.cloneDeep(ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)].dataVerification) || {};
@@ -597,6 +621,17 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
597
621
  delete cell.mc;
598
622
  }
599
623
  d[i][j] = null;
624
+ changes.push({
625
+ sheetId: ctx.currentSheetId,
626
+ path: ["celldata"],
627
+ value: {
628
+ r: i,
629
+ c: j,
630
+ v: null
631
+ },
632
+ key: "".concat(i, "_").concat(j),
633
+ type: "update"
634
+ });
600
635
  delete dataVerification["".concat(i, "_").concat(j)];
601
636
  (_f = ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)].hyperlink) === null || _f === void 0 ? true : delete _f["".concat(i, "_").concat(j)];
602
637
  }
@@ -696,6 +731,17 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
696
731
  value = copyData[h - minh][c - minc];
697
732
  }
698
733
  x[c] = _lodash.default.cloneDeep(value);
734
+ changes.push({
735
+ sheetId: ctx.currentSheetId,
736
+ path: ["celldata"],
737
+ value: {
738
+ r: h,
739
+ c: c,
740
+ v: d[h][c]
741
+ },
742
+ key: "".concat(h, "_").concat(c),
743
+ type: "update"
744
+ });
699
745
  if (value != null && copyHasMC && ((_k = x[c]) === null || _k === void 0 ? void 0 : _k.mc)) {
700
746
  if (x[c].mc.rs != null) {
701
747
  x[c].mc.r = h;
@@ -716,6 +762,9 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
716
762
  }
717
763
  last.row = [minh, maxh];
718
764
  last.column = [minc, maxc];
765
+ if (changes.length > 0 && ((_l = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _l === void 0 ? void 0 : _l.updateCellYdoc)) {
766
+ ctx.hooks.updateCellYdoc(changes);
767
+ }
719
768
  if (copyRowlChange) {}
720
769
  var source;
721
770
  var target;
@@ -798,7 +847,7 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
798
847
  }
799
848
  source_curCdformat[i].cellrange = emptyRange;
800
849
  if (emptyRange2.length > 0) {
801
- var ruleObj = (_l = source_curCdformat[i]) !== null && _l !== void 0 ? _l : {};
850
+ var ruleObj = (_m = source_curCdformat[i]) !== null && _m !== void 0 ? _m : {};
802
851
  ruleObj.cellrange = emptyRange2;
803
852
  ruleArr.push(ruleObj);
804
853
  }
@@ -902,7 +951,7 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
902
951
  }
903
952
  }
904
953
  function pasteHandlerOfCopyPaste(ctx, copyRange) {
905
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
954
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
906
955
  var allowEdit = (0, _utils.isAllowEdit)(ctx);
907
956
  if (!allowEdit || ctx.isFlvReadOnly) return;
908
957
  if (!copyRange) return;
@@ -993,6 +1042,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
993
1042
  if (addr > 0 || addc > 0) {
994
1043
  (0, _sheet.expandRowsAndColumns)(d, addr, addc);
995
1044
  }
1045
+ var changes = [];
996
1046
  var borderInfoCompute = (0, _border.getBorderInfoCompute)(ctx, copySheetIndex);
997
1047
  var c_dataVerification = _lodash.default.cloneDeep(ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, copySheetIndex)].dataVerification) || {};
998
1048
  var dataVerification = null;
@@ -1082,6 +1132,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1082
1132
  value.m = "Loading...";
1083
1133
  }
1084
1134
  }
1135
+ var afterHookCalled = false;
1085
1136
  if (!_lodash.default.isNil(value) && !_lodash.default.isNil(value.f)) {
1086
1137
  var adjustedFormula = value.f;
1087
1138
  var isError = false;
@@ -1134,6 +1185,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1134
1185
  v: arr.length === 1 ? funcV[1] : value.v,
1135
1186
  m: funcV[1] instanceof Promise ? "[object Promise]" : funcV[1]
1136
1187
  }));
1188
+ afterHookCalled = true;
1137
1189
  }
1138
1190
  }
1139
1191
  if (!_lodash.default.isNil(value.spl)) {}
@@ -1154,6 +1206,19 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1154
1206
  };
1155
1207
  }
1156
1208
  }
1209
+ if (!(((_k = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _k === void 0 ? void 0 : _k.afterUpdateCell) && afterHookCalled)) {
1210
+ changes.push({
1211
+ sheetId: ctx.currentSheetId,
1212
+ path: ["celldata"],
1213
+ value: {
1214
+ r: h,
1215
+ c: c,
1216
+ v: d[h][c]
1217
+ },
1218
+ key: "".concat(h, "_").concat(c),
1219
+ type: "update"
1220
+ });
1221
+ }
1157
1222
  }
1158
1223
  d[h] = x;
1159
1224
  }
@@ -1165,7 +1230,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1165
1230
  var a_file = ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)];
1166
1231
  var ruleArr_cf = _lodash.default.cloneDeep(c_file.luckysheet_conditionformat_save);
1167
1232
  if (!_lodash.default.isNil(ruleArr_cf) && ruleArr_cf.length > 0) {
1168
- cdformat = (_k = _lodash.default.cloneDeep(a_file.luckysheet_conditionformat_save)) !== null && _k !== void 0 ? _k : [];
1233
+ cdformat = (_l = _lodash.default.cloneDeep(a_file.luckysheet_conditionformat_save)) !== null && _l !== void 0 ? _l : [];
1169
1234
  for (var i = 0; i < ruleArr_cf.length; i += 1) {
1170
1235
  var cf_range = ruleArr_cf[i].cellrange;
1171
1236
  var emptyRange = [];
@@ -1201,8 +1266,8 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1201
1266
  file.config = cfg;
1202
1267
  file.luckysheet_conditionformat_save = cdformat;
1203
1268
  file.dataVerification = __assign(__assign({}, file.dataVerification), dataVerification);
1204
- if (((_l = ctx.luckysheet_select_save) === null || _l === void 0 ? void 0 : _l.length) === 1 && ((_m = ctx.luckysheet_copy_save) === null || _m === void 0 ? void 0 : _m.copyRange.length) === 1) {
1205
- var srcIndex = (0, _utils.getSheetIndex)(ctx, (_o = ctx.luckysheet_copy_save) === null || _o === void 0 ? void 0 : _o.dataSheetId);
1269
+ if (((_m = ctx.luckysheet_select_save) === null || _m === void 0 ? void 0 : _m.length) === 1 && ((_o = ctx.luckysheet_copy_save) === null || _o === void 0 ? void 0 : _o.copyRange.length) === 1) {
1270
+ var srcIndex = (0, _utils.getSheetIndex)(ctx, (_p = ctx.luckysheet_copy_save) === null || _p === void 0 ? void 0 : _p.dataSheetId);
1206
1271
  var targetSheetIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
1207
1272
  var srcHyperlinks = ctx.luckysheetfile[srcIndex].hyperlink;
1208
1273
  var srcData = ctx.luckysheetfile[srcIndex].data;
@@ -1213,7 +1278,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1213
1278
  var isSingleCell = copyh === 1 && copyc === 1;
1214
1279
  var cachedSrcLinkKey = isSingleCell ? "".concat(c_r1, "_").concat(c_c1) : null;
1215
1280
  var cachedSrcLink = isSingleCell && srcHyperlinks ? srcHyperlinks[cachedSrcLinkKey] : null;
1216
- var cachedSrcCell = isSingleCell && srcData ? (_p = srcData[c_r1]) === null || _p === void 0 ? void 0 : _p[c_c1] : null;
1281
+ var cachedSrcCell = isSingleCell && srcData ? (_q = srcData[c_r1]) === null || _q === void 0 ? void 0 : _q[c_c1] : null;
1217
1282
  for (var th = 1; th <= timesH; th += 1) {
1218
1283
  for (var tc = 1; tc <= timesC; tc += 1) {
1219
1284
  var linkMth = minh + (th - 1) * copyh;
@@ -1233,7 +1298,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1233
1298
  if (!srcLink) continue;
1234
1299
  var targetKey = "".concat(h, "_").concat(c);
1235
1300
  targetHyperlinks[targetKey] = srcLink;
1236
- var cell = (_q = d[h]) === null || _q === void 0 ? void 0 : _q[c];
1301
+ var cell = (_r = d[h]) === null || _r === void 0 ? void 0 : _r[c];
1237
1302
  if (cell) {
1238
1303
  var srcCell = void 0;
1239
1304
  if (isSingleCell && cachedSrcCell) {
@@ -1241,7 +1306,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1241
1306
  } else {
1242
1307
  var srcRow = c_r1 + (h - linkMth);
1243
1308
  var srcCol = c_c1 + (c - linkMtc);
1244
- srcCell = (_r = srcData === null || srcData === void 0 ? void 0 : srcData[srcRow]) === null || _r === void 0 ? void 0 : _r[srcCol];
1309
+ srcCell = (_s = srcData === null || srcData === void 0 ? void 0 : srcData[srcRow]) === null || _s === void 0 ? void 0 : _s[srcCol];
1245
1310
  }
1246
1311
  cell.hl = {
1247
1312
  r: h,
@@ -1261,6 +1326,9 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
1261
1326
  }
1262
1327
  }
1263
1328
  }
1329
+ if (changes.length > 0 && ((_t = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _t === void 0 ? void 0 : _t.updateCellYdoc)) {
1330
+ ctx.hooks.updateCellYdoc(changes);
1331
+ }
1264
1332
  if (copyRowlChange || addr > 0 || addc > 0) {
1265
1333
  (0, _refresh.jfrefreshgrid)(ctx, d, ctx.luckysheet_select_save);
1266
1334
  } else {
@@ -530,6 +530,8 @@ declare const _default: {
530
530
  conditionformat_equal_title: string;
531
531
  conditionformat_textContains: string;
532
532
  conditionformat_textContains_title: string;
533
+ conditionformat_empty: string;
534
+ conditionformat_empty_title: string;
533
535
  conditionformat_occurrenceDate: string;
534
536
  conditionformat_occurrenceDate_title: string;
535
537
  conditionformat_duplicateValue: string;
@@ -633,6 +635,7 @@ declare const _default: {
633
635
  between2: string;
634
636
  contain: string;
635
637
  textContains: string;
638
+ empty: string;
636
639
  duplicateValue: string;
637
640
  uniqueValue: string;
638
641
  top: string;
package/lib/locale/en.js CHANGED
@@ -9634,6 +9634,8 @@ var _default = exports.default = {
9634
9634
  conditionformat_equal_title: "Format cells equal to",
9635
9635
  conditionformat_textContains: "Conditional format - Text Contains",
9636
9636
  conditionformat_textContains_title: "Format cells containing the following text",
9637
+ conditionformat_empty: "Conditional format - Empty",
9638
+ conditionformat_empty_title: "Format cells that are empty",
9637
9639
  conditionformat_occurrenceDate: "Conditional format - Occurrence Date",
9638
9640
  conditionformat_occurrenceDate_title: "Format cells containing the following dates",
9639
9641
  conditionformat_duplicateValue: "Conditional format - Duplicate Value",
@@ -9737,6 +9739,7 @@ var _default = exports.default = {
9737
9739
  between2: "",
9738
9740
  contain: "Contain",
9739
9741
  textContains: "Text contains",
9742
+ empty: "Empty",
9740
9743
  duplicateValue: "Duplicate value",
9741
9744
  uniqueValue: "Unique value",
9742
9745
  top: "Top",
@@ -688,6 +688,8 @@ declare const _default: {
688
688
  conditionformat_equal_title: string;
689
689
  conditionformat_textContains: string;
690
690
  conditionformat_textContains_title: string;
691
+ conditionformat_empty: string;
692
+ conditionformat_empty_title: string;
691
693
  conditionformat_occurrenceDate: string;
692
694
  conditionformat_occurrenceDate_title: string;
693
695
  conditionformat_duplicateValue: string;
@@ -789,6 +791,7 @@ declare const _default: {
789
791
  between2: string;
790
792
  contain: string;
791
793
  textContains: string;
794
+ empty: string;
792
795
  duplicateValue: string;
793
796
  uniqueValue: string;
794
797
  top: string;
package/lib/locale/es.js CHANGED
@@ -9571,6 +9571,8 @@ var _default = exports.default = {
9571
9571
  conditionformat_equal_title: "Dar formato a celdas iguales a",
9572
9572
  conditionformat_textContains: "Conditionformat-TextContains",
9573
9573
  conditionformat_textContains_title: "Dar formato a las celdas que contienen el siguiente texto",
9574
+ conditionformat_empty: "Conditional format - Empty",
9575
+ conditionformat_empty_title: "Dar formato a las celdas vacías",
9574
9576
  conditionformat_occurrenceDate: "Conditionformat-OccurrenceDate",
9575
9577
  conditionformat_occurrenceDate_title: "Dar formato a celdas que contienen las siguientes fechas",
9576
9578
  conditionformat_duplicateValue: "Conditionformat-DuplicateValue",
@@ -9672,6 +9674,7 @@ var _default = exports.default = {
9672
9674
  between2: "",
9673
9675
  contain: "Contiene",
9674
9676
  textContains: "Texto contiene",
9677
+ empty: "Vacío",
9675
9678
  duplicateValue: "Valor duplicado",
9676
9679
  uniqueValue: "Valor Unico",
9677
9680
  top: "Mejor",
@@ -563,6 +563,8 @@ declare const _default: {
563
563
  conditionformat_equal_title: string;
564
564
  conditionformat_textContains: string;
565
565
  conditionformat_textContains_title: string;
566
+ conditionformat_empty: string;
567
+ conditionformat_empty_title: string;
566
568
  conditionformat_occurrenceDate: string;
567
569
  conditionformat_occurrenceDate_title: string;
568
570
  conditionformat_duplicateValue: string;
@@ -664,6 +666,7 @@ declare const _default: {
664
666
  between2: string;
665
667
  contain: string;
666
668
  textContains: string;
669
+ empty: string;
667
670
  duplicateValue: string;
668
671
  uniqueValue: string;
669
672
  top: string;
package/lib/locale/hi.js CHANGED
@@ -10084,6 +10084,8 @@ var _default = exports.default = {
10084
10084
  conditionformat_equal_title: "के बराबर कोशिकाओं को प्रारूपित करें",
10085
10085
  conditionformat_textContains: "Conditionformat-TextContains",
10086
10086
  conditionformat_textContains_title: "निम्नलिखित पाठ वाली कोशिकाओं को प्रारूपित करें",
10087
+ conditionformat_empty: "Conditional format - Empty",
10088
+ conditionformat_empty_title: "खाली कोशिकाओं को प्रारूपित करें",
10087
10089
  conditionformat_occurrenceDate: "Conditionformat-OccurrenceDate",
10088
10090
  conditionformat_occurrenceDate_title: "निम्नलिखित तिथियों वाली कोशिकाओं को प्रारूपित करें",
10089
10091
  conditionformat_duplicateValue: "Conditionformat-DuplicateValue",
@@ -10185,6 +10187,7 @@ var _default = exports.default = {
10185
10187
  between2: "",
10186
10188
  contain: "शामिल",
10187
10189
  textContains: "पाठ शामिल है",
10190
+ empty: "खाली",
10188
10191
  duplicateValue: "डुप्लिकेट मान",
10189
10192
  uniqueValue: "अद्वितीय मान",
10190
10193
  top: "शीर्ष",
@@ -583,6 +583,8 @@ declare function locale(ctx: Context): {
583
583
  conditionformat_equal_title: string;
584
584
  conditionformat_textContains: string;
585
585
  conditionformat_textContains_title: string;
586
+ conditionformat_empty: string;
587
+ conditionformat_empty_title: string;
586
588
  conditionformat_occurrenceDate: string;
587
589
  conditionformat_occurrenceDate_title: string;
588
590
  conditionformat_duplicateValue: string;
@@ -685,6 +687,7 @@ declare function locale(ctx: Context): {
685
687
  between2: string;
686
688
  contain: string;
687
689
  textContains: string;
690
+ empty: string;
688
691
  duplicateValue: string;
689
692
  uniqueValue: string;
690
693
  top: string;
@@ -582,6 +582,8 @@ declare const _default: {
582
582
  conditionformat_equal_title: string;
583
583
  conditionformat_textContains: string;
584
584
  conditionformat_textContains_title: string;
585
+ conditionformat_empty: string;
586
+ conditionformat_empty_title: string;
585
587
  conditionformat_occurrenceDate: string;
586
588
  conditionformat_occurrenceDate_title: string;
587
589
  conditionformat_duplicateValue: string;
@@ -684,6 +686,7 @@ declare const _default: {
684
686
  between2: string;
685
687
  contain: string;
686
688
  textContains: string;
689
+ empty: string;
687
690
  duplicateValue: string;
688
691
  uniqueValue: string;
689
692
  top: string;
package/lib/locale/zh.js CHANGED
@@ -10103,6 +10103,8 @@ var _default = exports.default = {
10103
10103
  conditionformat_equal_title: "为等于以下值的单元格设置格式",
10104
10104
  conditionformat_textContains: "条件格式——文本包含",
10105
10105
  conditionformat_textContains_title: "为包含以下文本的单元格设置格式",
10106
+ conditionformat_empty: "条件格式——空值",
10107
+ conditionformat_empty_title: "为空单元格设置格式",
10106
10108
  conditionformat_occurrenceDate: "条件格式——发生日期",
10107
10109
  conditionformat_occurrenceDate_title: "为包含以下日期的单元格设置格式",
10108
10110
  conditionformat_duplicateValue: "条件格式——重复值",
@@ -10205,6 +10207,7 @@ var _default = exports.default = {
10205
10207
  between2: "之间",
10206
10208
  contain: "包含",
10207
10209
  textContains: "文本包含",
10210
+ empty: "空值",
10208
10211
  duplicateValue: "重复值",
10209
10212
  uniqueValue: "唯一值",
10210
10213
  top: "前",
@@ -726,6 +726,8 @@ declare const _default: {
726
726
  conditionformat_equal_title: string;
727
727
  conditionformat_textContains: string;
728
728
  conditionformat_textContains_title: string;
729
+ conditionformat_empty: string;
730
+ conditionformat_empty_title: string;
729
731
  conditionformat_occurrenceDate: string;
730
732
  conditionformat_occurrenceDate_title: string;
731
733
  conditionformat_duplicateValue: string;
@@ -828,6 +830,7 @@ declare const _default: {
828
830
  between2: string;
829
831
  contain: string;
830
832
  textContains: string;
833
+ empty: string;
831
834
  duplicateValue: string;
832
835
  uniqueValue: string;
833
836
  top: string;
@@ -9618,6 +9618,8 @@ var _default = exports.default = {
9618
9618
  conditionformat_equal_title: "為等於以下值的儲存格設定格式",
9619
9619
  conditionformat_textContains: "條件格式——文字包含",
9620
9620
  conditionformat_textContains_title: "為包含以下文字的儲存格設定格式",
9621
+ conditionformat_empty: "條件格式——空值",
9622
+ conditionformat_empty_title: "為空儲存格設定格式",
9621
9623
  conditionformat_occurrenceDate: "條件格式——發生日期",
9622
9624
  conditionformat_occurrenceDate_title: "為包含以下日期的儲存格設定格式",
9623
9625
  conditionformat_duplicateValue: "條件格式——重複值",
@@ -9720,6 +9722,7 @@ var _default = exports.default = {
9720
9722
  between2: "之間",
9721
9723
  contain: "包含",
9722
9724
  textContains: "文字包含",
9725
+ empty: "空值",
9723
9726
  duplicateValue: "重複值",
9724
9727
  uniqueValue: "唯一值",
9725
9728
  top: "前",
@@ -706,6 +706,32 @@ function compute(ctx, ruleArr, d) {
706
706
  }
707
707
  }
708
708
  }
709
+ } else if (conditionName === "empty") {
710
+ for (var r = cellrange[s].row[0]; r <= cellrange[s].row[1]; r += 1) {
711
+ for (var c = cellrange[s].column[0]; c <= cellrange[s].column[1]; c += 1) {
712
+ var cell = _lodash.default.isNil(d[r]) || _lodash.default.isNil(d[r][c]) ? null : d[r][c];
713
+ var isEmpty = _lodash.default.isNil(cell) || _lodash.default.isNil(cell.v) || (0, _validation.isRealNull)(cell.v);
714
+ if (isEmpty) {
715
+ if ("".concat(r, "_").concat(c) in computeMap) {
716
+ computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
717
+ computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
718
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
719
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
720
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
721
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
722
+ } else {
723
+ computeMap["".concat(r, "_").concat(c)] = {
724
+ textColor: textColor_1,
725
+ cellColor: cellColor_1,
726
+ bold: bold_1,
727
+ italic: italic_1,
728
+ underline: underline_1,
729
+ strikethrough: strikethrough_1
730
+ };
731
+ }
732
+ }
733
+ }
734
+ }
709
735
  } else if (conditionName === "between") {
710
736
  for (var r = cellrange[s].row[0]; r <= cellrange[s].row[1]; r += 1) {
711
737
  for (var c = cellrange[s].column[0]; c <= cellrange[s].column[1]; c += 1) {