@leankylin-sheet/react 2.0.11 → 2.0.12

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/index.esm.js CHANGED
@@ -6341,7 +6341,8 @@ var numberThousands = function numberThousands(num, groupSeparator, precision) {
6341
6341
  };
6342
6342
  var CalcInfo = function CalcInfo() {
6343
6343
  var _useContext = useContext(WorkbookContext),
6344
- context = _useContext.context;
6344
+ context = _useContext.context,
6345
+ settings = _useContext.settings;
6345
6346
  var data = useMemo(function () {
6346
6347
  var _context$luckysheet_s;
6347
6348
  var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
@@ -6388,12 +6389,15 @@ var CalcInfo = function CalcInfo() {
6388
6389
  };
6389
6390
  }, [context.luckysheet_select_save]);
6390
6391
  var labelMap = {
6391
- sum: "总和",
6392
6392
  count: "计数",
6393
+ sum: "总和",
6393
6394
  average: "平均值",
6394
6395
  max: "最大值",
6395
6396
  min: "最小值"
6396
6397
  };
6398
+ if (settings.renderCalcInfo) {
6399
+ return settings.renderCalcInfo(data, context.luckysheet_select_save);
6400
+ }
6397
6401
  if (!data) {
6398
6402
  return null;
6399
6403
  }
@@ -6406,7 +6410,7 @@ var CalcInfo = function CalcInfo() {
6406
6410
  style: {
6407
6411
  marginRight: 10
6408
6412
  }
6409
- }, labelMap[key], ": ", numberThousands(data[key], ",", 2));
6413
+ }, labelMap[key], ":", key === "count" ? data[key] : numberThousands(data[key], ",", 2));
6410
6414
  }));
6411
6415
  };
6412
6416
 
package/dist/index.js CHANGED
@@ -6351,7 +6351,8 @@ var numberThousands = function numberThousands(num, groupSeparator, precision) {
6351
6351
  };
6352
6352
  var CalcInfo = function CalcInfo() {
6353
6353
  var _useContext = React.useContext(WorkbookContext),
6354
- context = _useContext.context;
6354
+ context = _useContext.context,
6355
+ settings = _useContext.settings;
6355
6356
  var data = React.useMemo(function () {
6356
6357
  var _context$luckysheet_s;
6357
6358
  var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
@@ -6398,12 +6399,15 @@ var CalcInfo = function CalcInfo() {
6398
6399
  };
6399
6400
  }, [context.luckysheet_select_save]);
6400
6401
  var labelMap = {
6401
- sum: "总和",
6402
6402
  count: "计数",
6403
+ sum: "总和",
6403
6404
  average: "平均值",
6404
6405
  max: "最大值",
6405
6406
  min: "最小值"
6406
6407
  };
6408
+ if (settings.renderCalcInfo) {
6409
+ return settings.renderCalcInfo(data, context.luckysheet_select_save);
6410
+ }
6407
6411
  if (!data) {
6408
6412
  return null;
6409
6413
  }
@@ -6416,7 +6420,7 @@ var CalcInfo = function CalcInfo() {
6416
6420
  style: {
6417
6421
  marginRight: 10
6418
6422
  }
6419
- }, labelMap[key], ": ", numberThousands(data[key], ",", 2));
6423
+ }, labelMap[key], ":", key === "count" ? data[key] : numberThousands(data[key], ",", 2));
6420
6424
  }));
6421
6425
  };
6422
6426
 
package/dist/index.umd.js CHANGED
@@ -108583,7 +108583,8 @@
108583
108583
  };
108584
108584
  var CalcInfo = function CalcInfo() {
108585
108585
  var _useContext = React.useContext(WorkbookContext),
108586
- context = _useContext.context;
108586
+ context = _useContext.context,
108587
+ settings = _useContext.settings;
108587
108588
  var data = React.useMemo(function () {
108588
108589
  var _context$luckysheet_s;
108589
108590
  var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
@@ -108630,12 +108631,15 @@
108630
108631
  };
108631
108632
  }, [context.luckysheet_select_save]);
108632
108633
  var labelMap = {
108633
- sum: "总和",
108634
108634
  count: "计数",
108635
+ sum: "总和",
108635
108636
  average: "平均值",
108636
108637
  max: "最大值",
108637
108638
  min: "最小值"
108638
108639
  };
108640
+ if (settings.renderCalcInfo) {
108641
+ return settings.renderCalcInfo(data, context.luckysheet_select_save);
108642
+ }
108639
108643
  if (!data) {
108640
108644
  return null;
108641
108645
  }
@@ -108648,7 +108652,7 @@
108648
108652
  style: {
108649
108653
  marginRight: 10
108650
108654
  }
108651
- }, labelMap[key], ": ", numberThousands$1(data[key], ",", 2));
108655
+ }, labelMap[key], ":", key === "count" ? data[key] : numberThousands$1(data[key], ",", 2));
108652
108656
  }));
108653
108657
  };
108654
108658