@vdhewei/xlsx-template-lib 1.3.0 → 1.3.2

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.mjs CHANGED
@@ -3013,7 +3013,7 @@ var __numberKey = (str) => {
3013
3013
  var __codeAliasKey = (str) => {
3014
3014
  const key = __codeKey(str);
3015
3015
  if (key !== "") {
3016
- return `${defaultRuleTokenParserMap.get("@" /* UseAliasToken */)}${key}`;
3016
+ return `${defaultRuleTokenMap.get("@" /* UseAliasToken */)}${key}`;
3017
3017
  }
3018
3018
  return "";
3019
3019
  };
@@ -3101,8 +3101,8 @@ var resolveCompileMacroExpr = (ctx, macroExpr, macroTokens2, currentCellIndex, t
3101
3101
  if (cellValue === void 0 || cellValue.value === null) {
3102
3102
  return;
3103
3103
  }
3104
- const value = cellValue.value;
3105
- parts.push(execMacroFormat(value.toString(), formatter));
3104
+ const value = execMacroFormat(cellValue.value.toString(), formatter);
3105
+ parts.push(value);
3106
3106
  });
3107
3107
  });
3108
3108
  }
@@ -3435,21 +3435,26 @@ var compileRowCells = function(ctx, expr, cellPoints, rowIndex, errs) {
3435
3435
  return;
3436
3436
  }
3437
3437
  ctx.currentExpr = expr;
3438
- cellPoints.forEach((cellPoint, index) => {
3439
- const r = cellPoint.Row;
3440
- const sheet = ctx.sheet;
3441
- const c = cellPoint.Column;
3442
- const cell = sheet.findCell(r, c);
3443
- if (cell === void 0 || cell.value !== void 0 && cell.value !== null && cell.value !== "") {
3444
- return;
3445
- }
3446
- let templateValue = String(expr.value);
3447
- const macroTokens2 = getMacroTokens(expr);
3448
- templateValue = resolveFunctionExpr(ctx, templateValue, expr);
3449
- templateValue = resolveCompileMacroExpr(ctx, templateValue, macroTokens2, index, cellPoints.length);
3450
- templateValue = resolveAliasExpr(ctx, templateValue, index);
3451
- cell.value = resolveValueExpr(ctx, templateValue);
3452
- });
3438
+ try {
3439
+ cellPoints.forEach((cellPoint, index) => {
3440
+ const r = cellPoint.Row;
3441
+ const sheet = ctx.sheet;
3442
+ const c = cellPoint.Column;
3443
+ const cell = sheet.findCell(r, c);
3444
+ if (cell === void 0 || cell.value !== void 0 && cell.value !== null && cell.value !== "") {
3445
+ return;
3446
+ }
3447
+ let templateValue = String(expr.value);
3448
+ const macroTokens2 = getMacroTokens(expr);
3449
+ templateValue = resolveFunctionExpr(ctx, templateValue, expr);
3450
+ templateValue = resolveCompileMacroExpr(ctx, templateValue, macroTokens2, index, cellPoints.length);
3451
+ templateValue = resolveAliasExpr(ctx, templateValue, index);
3452
+ cell.value = resolveValueExpr(ctx, templateValue);
3453
+ });
3454
+ } catch (err) {
3455
+ const msg = err.message;
3456
+ throw new Error(`expr:${expr.express}, resolve error: ${msg}`);
3457
+ }
3453
3458
  };
3454
3459
  var generateWorkSheetCellsPlaceholder = function(ctx, expr, sheet) {
3455
3460
  const errs = [];