@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.js +23 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3091,7 +3091,7 @@ var __numberKey = (str) => {
|
|
|
3091
3091
|
var __codeAliasKey = (str) => {
|
|
3092
3092
|
const key = __codeKey(str);
|
|
3093
3093
|
if (key !== "") {
|
|
3094
|
-
return `${
|
|
3094
|
+
return `${defaultRuleTokenMap.get("@" /* UseAliasToken */)}${key}`;
|
|
3095
3095
|
}
|
|
3096
3096
|
return "";
|
|
3097
3097
|
};
|
|
@@ -3179,8 +3179,8 @@ var resolveCompileMacroExpr = (ctx, macroExpr, macroTokens2, currentCellIndex, t
|
|
|
3179
3179
|
if (cellValue === void 0 || cellValue.value === null) {
|
|
3180
3180
|
return;
|
|
3181
3181
|
}
|
|
3182
|
-
const value = cellValue.value;
|
|
3183
|
-
parts.push(
|
|
3182
|
+
const value = execMacroFormat(cellValue.value.toString(), formatter);
|
|
3183
|
+
parts.push(value);
|
|
3184
3184
|
});
|
|
3185
3185
|
});
|
|
3186
3186
|
}
|
|
@@ -3513,21 +3513,26 @@ var compileRowCells = function(ctx, expr, cellPoints, rowIndex, errs) {
|
|
|
3513
3513
|
return;
|
|
3514
3514
|
}
|
|
3515
3515
|
ctx.currentExpr = expr;
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3516
|
+
try {
|
|
3517
|
+
cellPoints.forEach((cellPoint, index) => {
|
|
3518
|
+
const r = cellPoint.Row;
|
|
3519
|
+
const sheet = ctx.sheet;
|
|
3520
|
+
const c = cellPoint.Column;
|
|
3521
|
+
const cell = sheet.findCell(r, c);
|
|
3522
|
+
if (cell === void 0 || cell.value !== void 0 && cell.value !== null && cell.value !== "") {
|
|
3523
|
+
return;
|
|
3524
|
+
}
|
|
3525
|
+
let templateValue = String(expr.value);
|
|
3526
|
+
const macroTokens2 = getMacroTokens(expr);
|
|
3527
|
+
templateValue = resolveFunctionExpr(ctx, templateValue, expr);
|
|
3528
|
+
templateValue = resolveCompileMacroExpr(ctx, templateValue, macroTokens2, index, cellPoints.length);
|
|
3529
|
+
templateValue = resolveAliasExpr(ctx, templateValue, index);
|
|
3530
|
+
cell.value = resolveValueExpr(ctx, templateValue);
|
|
3531
|
+
});
|
|
3532
|
+
} catch (err) {
|
|
3533
|
+
const msg = err.message;
|
|
3534
|
+
throw new Error(`expr:${expr.express}, resolve error: ${msg}`);
|
|
3535
|
+
}
|
|
3531
3536
|
};
|
|
3532
3537
|
var generateWorkSheetCellsPlaceholder = function(ctx, expr, sheet) {
|
|
3533
3538
|
const errs = [];
|