@vdhewei/xlsx-template-lib 1.6.11 → 1.6.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/bin.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  compileRuleSheetName,
7
7
  loadWorkbook,
8
8
  toCellValue
9
- } from "./chunk-NSFBG6PV.mjs";
9
+ } from "./chunk-BPKRWKLJ.mjs";
10
10
  import "./chunk-3GDQP6AS.mjs";
11
11
 
12
12
  // src/bin.ts
@@ -4003,6 +4003,24 @@ var generateCommandsXlsxTemplateWithCompile = async function(data, values, compi
4003
4003
  await w.substituteAll(values);
4004
4004
  return w.generate(options);
4005
4005
  };
4006
+ var compileCommandsXlsxTemplate = async function(data, values, compileOptions, options) {
4007
+ if (compileOptions.sheetName === void 0 || compileOptions.sheetName === "") {
4008
+ compileOptions.sheetName = compileRuleSheetName;
4009
+ }
4010
+ const result = await ExprResolver.compile(data, compileOptions.sheetName, compileOptions);
4011
+ if (result.errs !== void 0 && result.errs.length > 0) {
4012
+ throw result.errs[0];
4013
+ }
4014
+ values = autoRegisterAlias(values, result.configure);
4015
+ result.workbook = ExprResolver.removeUnExportSheets(result.workbook, compileOptions);
4016
+ const wb = await ExprResolver.toBuffer(result.workbook);
4017
+ await saveCompile(compileOptions, wb);
4018
+ const w = await Workbook.parse(wb, options);
4019
+ w.setQueryFunctionHandler(commandExtendQuery);
4020
+ await w.substituteAll(values);
4021
+ await w.generate(options);
4022
+ return wb;
4023
+ };
4006
4024
  var compileAll = async (buf, compileOpts, renderData) => {
4007
4025
  if (compileOpts === void 0 || compileOpts.sheetName === "") {
4008
4026
  return buf;
@@ -4213,8 +4231,9 @@ export {
4213
4231
  mergeMap,
4214
4232
  autoRegisterAlias,
4215
4233
  generateCommandsXlsxTemplateWithCompile,
4234
+ compileCommandsXlsxTemplate,
4216
4235
  compileAll,
4217
4236
  XlsxRender,
4218
4237
  ZipXlsxTemplateApp
4219
4238
  };
4220
- //# sourceMappingURL=chunk-NSFBG6PV.mjs.map
4239
+ //# sourceMappingURL=chunk-BPKRWKLJ.mjs.map