@leankylin-sheet/core 4.0.9 → 4.0.11

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/dist/context.d.ts CHANGED
@@ -19,6 +19,7 @@ export type CellOptions = {
19
19
  render: any;
20
20
  }[];
21
21
  export type Context = {
22
+ headerBgColor?: string;
22
23
  dragRangeSelect?: {
23
24
  top: number;
24
25
  left: number;
package/dist/index.esm.js CHANGED
@@ -42570,6 +42570,7 @@ function calcSelectionInfo(ctx, lang) {
42570
42570
 
42571
42571
  function defaultContext(refs) {
42572
42572
  return {
42573
+ headerBgColor: "#fff",
42573
42574
  cellOptions: [],
42574
42575
  luckysheetfile: [],
42575
42576
  defaultcolumnNum: 60,
@@ -51965,7 +51966,7 @@ var Canvas = /*#__PURE__*/function () {
51965
51966
  continue;
51966
51967
  }
51967
51968
  if (((_this$sheetCtx$config = this.sheetCtx.config) === null || _this$sheetCtx$config === void 0 ? void 0 : (_this$sheetCtx$config2 = _this$sheetCtx$config.rowhidden) === null || _this$sheetCtx$config2 === void 0 ? void 0 : _this$sheetCtx$config2[r]) == null) {
51968
- renderCtx.fillStyle = "#F8F9FA";
51969
+ renderCtx.fillStyle = this.sheetCtx.headerBgColor || "#fff";
51969
51970
  renderCtx.fillRect(0, start_r + offsetTop + firstOffset, this.sheetCtx.rowHeaderWidth - 1, end_r - start_r + 1 + lastOffset - firstOffset);
51970
51971
  renderCtx.fillStyle = "#000000";
51971
51972
  renderCtx.save();
@@ -52058,7 +52059,7 @@ var Canvas = /*#__PURE__*/function () {
52058
52059
  continue;
52059
52060
  }
52060
52061
  if (((_this$sheetCtx$config5 = this.sheetCtx.config) === null || _this$sheetCtx$config5 === void 0 ? void 0 : (_this$sheetCtx$config6 = _this$sheetCtx$config5.colhidden) === null || _this$sheetCtx$config6 === void 0 ? void 0 : _this$sheetCtx$config6[c]) == null) {
52061
- renderCtx.fillStyle = "#F8F9FA";
52062
+ renderCtx.fillStyle = this.sheetCtx.headerBgColor || "#fff";
52062
52063
  renderCtx.fillRect(start_c + offsetLeft - 1, 0, end_c - start_c, this.sheetCtx.columnHeaderHeight - 1);
52063
52064
  renderCtx.fillStyle = "#000000";
52064
52065
  renderCtx.save();
@@ -56037,6 +56038,7 @@ var index = /*#__PURE__*/Object.freeze({
56037
56038
  });
56038
56039
 
56039
56040
  var defaultSettings = {
56041
+ headerBgColor: "#fff",
56040
56042
  toolbarRightRender: undefined,
56041
56043
  onClickContentEditable: undefined,
56042
56044
  renderCustomColor: undefined,
@@ -56447,7 +56449,7 @@ function fixPositionOnFrozenCells(freeze, x, y, mouseX, mouseY) {
56447
56449
  };
56448
56450
  }
56449
56451
  function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxInput, canvas) {
56450
- var _globalCache$freezen, _ctx$hooks$beforeCell, _ctx$hooks, _flowdata$row_index;
56452
+ var _globalCache$freezen, _ctx$hooks$beforeCell, _ctx$hooks, _flowdata$row_index, _flowdata$row_index2, _flowdata$row_index2$;
56451
56453
  ctx.contextMenu = {};
56452
56454
  ctx.filterContextMenu = undefined;
56453
56455
  var flowdata = getFlowdata(ctx);
@@ -56617,7 +56619,6 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56617
56619
  }
56618
56620
  cellInput.innerHTML = vText;
56619
56621
  cancelFunctionrangeSelected(ctx);
56620
- createRangeHightlight(ctx, vText);
56621
56622
  }
56622
56623
  ctx.formulaCache.rangestart = false;
56623
56624
  ctx.formulaCache.rangedrag_column_start = false;
@@ -56663,9 +56664,6 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56663
56664
  ctx.formulaCache.rangedrag_column_start = false;
56664
56665
  ctx.formulaCache.rangedrag_row_start = false;
56665
56666
  ctx.formulaCache.selectingRangeIndex = ctx.formulaCache.rangechangeindex;
56666
- if (ctx.formulaCache.rangechangeindex > ctx.formulaRangeHighlight.length) {
56667
- createRangeHightlight(ctx, cellInput.innerHTML, ctx.formulaCache.rangechangeindex);
56668
- }
56669
56667
  createFormulaRangeSelect(ctx, {
56670
56668
  rangeIndex: ctx.formulaCache.rangechangeindex || 0,
56671
56669
  left: left,
@@ -56783,10 +56781,12 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56783
56781
  }
56784
56782
  }
56785
56783
  ctx.luckysheet_select_save = normalizeSelection(ctx, ctx.luckysheet_select_save);
56784
+ var f = ((_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : (_flowdata$row_index2$ = _flowdata$row_index2[col_index]) === null || _flowdata$row_index2$ === void 0 ? void 0 : _flowdata$row_index2$.f) || "";
56785
+ createRangeHightlight(ctx, functionHTMLGenerate(f));
56786
56786
  if (ctx.hooks.afterCellMouseDown) {
56787
56787
  setTimeout(function () {
56788
- var _ctx$hooks$afterCellM, _ctx$hooks2, _flowdata$row_index2;
56789
- (_ctx$hooks$afterCellM = (_ctx$hooks2 = ctx.hooks).afterCellMouseDown) === null || _ctx$hooks$afterCellM === void 0 ? void 0 : _ctx$hooks$afterCellM.call(_ctx$hooks2, (_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : _flowdata$row_index2[col_index], {
56788
+ var _ctx$hooks$afterCellM, _ctx$hooks2, _flowdata$row_index3;
56789
+ (_ctx$hooks$afterCellM = (_ctx$hooks2 = ctx.hooks).afterCellMouseDown) === null || _ctx$hooks$afterCellM === void 0 ? void 0 : _ctx$hooks$afterCellM.call(_ctx$hooks2, (_flowdata$row_index3 = flowdata[row_index]) === null || _flowdata$row_index3 === void 0 ? void 0 : _flowdata$row_index3[col_index], {
56790
56790
  row: row_index,
56791
56791
  column: col_index,
56792
56792
  startRow: row_pre,
@@ -56798,7 +56798,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56798
56798
  }
56799
56799
  }
56800
56800
  function handleCellDrop(ctx, globalCache, e, container) {
56801
- var _globalCache$freezen2, _flowdata$row_index3;
56801
+ var _globalCache$freezen2, _flowdata$row_index4;
56802
56802
  var afterCellDrop = ctx.hooks.afterCellDrop;
56803
56803
  if (!afterCellDrop) {
56804
56804
  return;
@@ -56825,7 +56825,7 @@ function handleCellDrop(ctx, globalCache, e, container) {
56825
56825
  var col_location = colLocation(x, ctx.visibledatacolumn);
56826
56826
  var col_pre = col_location[0];
56827
56827
  var col_index = col_location[2];
56828
- var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index3 = flowdata[row_index]) === null || _flowdata$row_index3 === void 0 ? void 0 : _flowdata$row_index3[col_index]));
56828
+ var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index4 = flowdata[row_index]) === null || _flowdata$row_index4 === void 0 ? void 0 : _flowdata$row_index4[col_index]));
56829
56829
  var box = document.querySelector(".leankylin-cell-area");
56830
56830
  if (box) {
56831
56831
  var _currentCellValue$cu;
@@ -56861,7 +56861,7 @@ function handleCellDrop(ctx, globalCache, e, container) {
56861
56861
  });
56862
56862
  }
56863
56863
  function handleCellAreaDragOver(ctx, globalCache, e, container) {
56864
- var _globalCache$freezen3, _flowdata$row_index4;
56864
+ var _globalCache$freezen3, _flowdata$row_index5;
56865
56865
  var canDrop = ctx.hooks.afterCellDrop;
56866
56866
  if (!canDrop) {
56867
56867
  return;
@@ -56890,7 +56890,7 @@ function handleCellAreaDragOver(ctx, globalCache, e, container) {
56890
56890
  var col_pre = col_location[0];
56891
56891
  var col_end = col_location[1];
56892
56892
  var col_index = col_location[2];
56893
- var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index4 = flowdata[row_index]) === null || _flowdata$row_index4 === void 0 ? void 0 : _flowdata$row_index4[col_index]));
56893
+ var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index5 = flowdata[row_index]) === null || _flowdata$row_index5 === void 0 ? void 0 : _flowdata$row_index5[col_index]));
56894
56894
  var box = document.querySelector(".leankylin-cell-area");
56895
56895
  if (box) {
56896
56896
  var _currentCellValue$cu2;
@@ -56921,7 +56921,7 @@ function handleCellAreaDragOver(ctx, globalCache, e, container) {
56921
56921
  };
56922
56922
  }
56923
56923
  function handleCellAreaMouseMove(ctx, globalCache, e, container) {
56924
- var _globalCache$freezen4, _flowdata$row_index5;
56924
+ var _globalCache$freezen4, _flowdata$row_index6;
56925
56925
  var afterCellMouseMove = ctx.hooks.afterCellMouseMove;
56926
56926
  if (!afterCellMouseMove) {
56927
56927
  return;
@@ -56946,7 +56946,7 @@ function handleCellAreaMouseMove(ctx, globalCache, e, container) {
56946
56946
  var col_location = colLocation(x, ctx.visibledatacolumn);
56947
56947
  var col_pre = col_location[0];
56948
56948
  var col_index = col_location[2];
56949
- var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index5 = flowdata[row_index]) === null || _flowdata$row_index5 === void 0 ? void 0 : _flowdata$row_index5[col_index]));
56949
+ var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index6 = flowdata[row_index]) === null || _flowdata$row_index6 === void 0 ? void 0 : _flowdata$row_index6[col_index]));
56950
56950
  var box = document.querySelector(".leankylin-cell-area");
56951
56951
  if (box) {
56952
56952
  var _currentCellValue$cu3;
package/dist/index.js CHANGED
@@ -42580,6 +42580,7 @@ function calcSelectionInfo(ctx, lang) {
42580
42580
 
42581
42581
  function defaultContext(refs) {
42582
42582
  return {
42583
+ headerBgColor: "#fff",
42583
42584
  cellOptions: [],
42584
42585
  luckysheetfile: [],
42585
42586
  defaultcolumnNum: 60,
@@ -51975,7 +51976,7 @@ var Canvas = /*#__PURE__*/function () {
51975
51976
  continue;
51976
51977
  }
51977
51978
  if (((_this$sheetCtx$config = this.sheetCtx.config) === null || _this$sheetCtx$config === void 0 ? void 0 : (_this$sheetCtx$config2 = _this$sheetCtx$config.rowhidden) === null || _this$sheetCtx$config2 === void 0 ? void 0 : _this$sheetCtx$config2[r]) == null) {
51978
- renderCtx.fillStyle = "#F8F9FA";
51979
+ renderCtx.fillStyle = this.sheetCtx.headerBgColor || "#fff";
51979
51980
  renderCtx.fillRect(0, start_r + offsetTop + firstOffset, this.sheetCtx.rowHeaderWidth - 1, end_r - start_r + 1 + lastOffset - firstOffset);
51980
51981
  renderCtx.fillStyle = "#000000";
51981
51982
  renderCtx.save();
@@ -52068,7 +52069,7 @@ var Canvas = /*#__PURE__*/function () {
52068
52069
  continue;
52069
52070
  }
52070
52071
  if (((_this$sheetCtx$config5 = this.sheetCtx.config) === null || _this$sheetCtx$config5 === void 0 ? void 0 : (_this$sheetCtx$config6 = _this$sheetCtx$config5.colhidden) === null || _this$sheetCtx$config6 === void 0 ? void 0 : _this$sheetCtx$config6[c]) == null) {
52071
- renderCtx.fillStyle = "#F8F9FA";
52072
+ renderCtx.fillStyle = this.sheetCtx.headerBgColor || "#fff";
52072
52073
  renderCtx.fillRect(start_c + offsetLeft - 1, 0, end_c - start_c, this.sheetCtx.columnHeaderHeight - 1);
52073
52074
  renderCtx.fillStyle = "#000000";
52074
52075
  renderCtx.save();
@@ -56047,6 +56048,7 @@ var index = /*#__PURE__*/Object.freeze({
56047
56048
  });
56048
56049
 
56049
56050
  var defaultSettings = {
56051
+ headerBgColor: "#fff",
56050
56052
  toolbarRightRender: undefined,
56051
56053
  onClickContentEditable: undefined,
56052
56054
  renderCustomColor: undefined,
@@ -56457,7 +56459,7 @@ function fixPositionOnFrozenCells(freeze, x, y, mouseX, mouseY) {
56457
56459
  };
56458
56460
  }
56459
56461
  function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxInput, canvas) {
56460
- var _globalCache$freezen, _ctx$hooks$beforeCell, _ctx$hooks, _flowdata$row_index;
56462
+ var _globalCache$freezen, _ctx$hooks$beforeCell, _ctx$hooks, _flowdata$row_index, _flowdata$row_index2, _flowdata$row_index2$;
56461
56463
  ctx.contextMenu = {};
56462
56464
  ctx.filterContextMenu = undefined;
56463
56465
  var flowdata = getFlowdata(ctx);
@@ -56627,7 +56629,6 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56627
56629
  }
56628
56630
  cellInput.innerHTML = vText;
56629
56631
  cancelFunctionrangeSelected(ctx);
56630
- createRangeHightlight(ctx, vText);
56631
56632
  }
56632
56633
  ctx.formulaCache.rangestart = false;
56633
56634
  ctx.formulaCache.rangedrag_column_start = false;
@@ -56673,9 +56674,6 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56673
56674
  ctx.formulaCache.rangedrag_column_start = false;
56674
56675
  ctx.formulaCache.rangedrag_row_start = false;
56675
56676
  ctx.formulaCache.selectingRangeIndex = ctx.formulaCache.rangechangeindex;
56676
- if (ctx.formulaCache.rangechangeindex > ctx.formulaRangeHighlight.length) {
56677
- createRangeHightlight(ctx, cellInput.innerHTML, ctx.formulaCache.rangechangeindex);
56678
- }
56679
56677
  createFormulaRangeSelect(ctx, {
56680
56678
  rangeIndex: ctx.formulaCache.rangechangeindex || 0,
56681
56679
  left: left,
@@ -56793,10 +56791,12 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56793
56791
  }
56794
56792
  }
56795
56793
  ctx.luckysheet_select_save = normalizeSelection(ctx, ctx.luckysheet_select_save);
56794
+ var f = ((_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : (_flowdata$row_index2$ = _flowdata$row_index2[col_index]) === null || _flowdata$row_index2$ === void 0 ? void 0 : _flowdata$row_index2$.f) || "";
56795
+ createRangeHightlight(ctx, functionHTMLGenerate(f));
56796
56796
  if (ctx.hooks.afterCellMouseDown) {
56797
56797
  setTimeout(function () {
56798
- var _ctx$hooks$afterCellM, _ctx$hooks2, _flowdata$row_index2;
56799
- (_ctx$hooks$afterCellM = (_ctx$hooks2 = ctx.hooks).afterCellMouseDown) === null || _ctx$hooks$afterCellM === void 0 ? void 0 : _ctx$hooks$afterCellM.call(_ctx$hooks2, (_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : _flowdata$row_index2[col_index], {
56798
+ var _ctx$hooks$afterCellM, _ctx$hooks2, _flowdata$row_index3;
56799
+ (_ctx$hooks$afterCellM = (_ctx$hooks2 = ctx.hooks).afterCellMouseDown) === null || _ctx$hooks$afterCellM === void 0 ? void 0 : _ctx$hooks$afterCellM.call(_ctx$hooks2, (_flowdata$row_index3 = flowdata[row_index]) === null || _flowdata$row_index3 === void 0 ? void 0 : _flowdata$row_index3[col_index], {
56800
56800
  row: row_index,
56801
56801
  column: col_index,
56802
56802
  startRow: row_pre,
@@ -56808,7 +56808,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
56808
56808
  }
56809
56809
  }
56810
56810
  function handleCellDrop(ctx, globalCache, e, container) {
56811
- var _globalCache$freezen2, _flowdata$row_index3;
56811
+ var _globalCache$freezen2, _flowdata$row_index4;
56812
56812
  var afterCellDrop = ctx.hooks.afterCellDrop;
56813
56813
  if (!afterCellDrop) {
56814
56814
  return;
@@ -56835,7 +56835,7 @@ function handleCellDrop(ctx, globalCache, e, container) {
56835
56835
  var col_location = colLocation(x, ctx.visibledatacolumn);
56836
56836
  var col_pre = col_location[0];
56837
56837
  var col_index = col_location[2];
56838
- var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index3 = flowdata[row_index]) === null || _flowdata$row_index3 === void 0 ? void 0 : _flowdata$row_index3[col_index]));
56838
+ var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index4 = flowdata[row_index]) === null || _flowdata$row_index4 === void 0 ? void 0 : _flowdata$row_index4[col_index]));
56839
56839
  var box = document.querySelector(".leankylin-cell-area");
56840
56840
  if (box) {
56841
56841
  var _currentCellValue$cu;
@@ -56871,7 +56871,7 @@ function handleCellDrop(ctx, globalCache, e, container) {
56871
56871
  });
56872
56872
  }
56873
56873
  function handleCellAreaDragOver(ctx, globalCache, e, container) {
56874
- var _globalCache$freezen3, _flowdata$row_index4;
56874
+ var _globalCache$freezen3, _flowdata$row_index5;
56875
56875
  var canDrop = ctx.hooks.afterCellDrop;
56876
56876
  if (!canDrop) {
56877
56877
  return;
@@ -56900,7 +56900,7 @@ function handleCellAreaDragOver(ctx, globalCache, e, container) {
56900
56900
  var col_pre = col_location[0];
56901
56901
  var col_end = col_location[1];
56902
56902
  var col_index = col_location[2];
56903
- var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index4 = flowdata[row_index]) === null || _flowdata$row_index4 === void 0 ? void 0 : _flowdata$row_index4[col_index]));
56903
+ var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index5 = flowdata[row_index]) === null || _flowdata$row_index5 === void 0 ? void 0 : _flowdata$row_index5[col_index]));
56904
56904
  var box = document.querySelector(".leankylin-cell-area");
56905
56905
  if (box) {
56906
56906
  var _currentCellValue$cu2;
@@ -56931,7 +56931,7 @@ function handleCellAreaDragOver(ctx, globalCache, e, container) {
56931
56931
  };
56932
56932
  }
56933
56933
  function handleCellAreaMouseMove(ctx, globalCache, e, container) {
56934
- var _globalCache$freezen4, _flowdata$row_index5;
56934
+ var _globalCache$freezen4, _flowdata$row_index6;
56935
56935
  var afterCellMouseMove = ctx.hooks.afterCellMouseMove;
56936
56936
  if (!afterCellMouseMove) {
56937
56937
  return;
@@ -56956,7 +56956,7 @@ function handleCellAreaMouseMove(ctx, globalCache, e, container) {
56956
56956
  var col_location = colLocation(x, ctx.visibledatacolumn);
56957
56957
  var col_pre = col_location[0];
56958
56958
  var col_index = col_location[2];
56959
- var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index5 = flowdata[row_index]) === null || _flowdata$row_index5 === void 0 ? void 0 : _flowdata$row_index5[col_index]));
56959
+ var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index6 = flowdata[row_index]) === null || _flowdata$row_index6 === void 0 ? void 0 : _flowdata$row_index6[col_index]));
56960
56960
  var box = document.querySelector(".leankylin-cell-area");
56961
56961
  if (box) {
56962
56962
  var _currentCellValue$cu3;
@@ -79,6 +79,7 @@ export type Hooks = {
79
79
  afterUpdateSheetName?: (id: string, oldName: string, newName: string) => void;
80
80
  };
81
81
  export type Settings = {
82
+ headerBgColor?: string;
82
83
  toolbarRightRender?: any;
83
84
  onClickContentEditable?: any;
84
85
  renderCustomColor?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "4.0.9",
3
+ "version": "4.0.11",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "build": "father-build"
14
14
  },
15
15
  "dependencies": {
16
- "@leankylin-sheet/formula-parser": "4.0.9",
16
+ "@leankylin-sheet/formula-parser": "4.0.11",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",