@chenchaolong/plugin-trade-compliance-workbench 1.0.255 → 1.0.257
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/lib/customs-formatting.d.ts.map +1 -1
- package/dist/lib/customs-formatting.js +20 -0
- package/dist/lib/customs-formatting.js.map +1 -1
- package/dist/lib/invoice/dynamic-render.d.ts +1 -1
- package/dist/lib/invoice/dynamic-render.d.ts.map +1 -1
- package/dist/lib/invoice/dynamic-render.js +42 -21
- package/dist/lib/invoice/dynamic-render.js.map +1 -1
- package/dist/lib/invoice-formatting.d.ts +2 -0
- package/dist/lib/invoice-formatting.d.ts.map +1 -1
- package/dist/lib/invoice-formatting.js +35 -8
- package/dist/lib/invoice-formatting.js.map +1 -1
- package/dist/lib/sales-batch-workbook.d.ts.map +1 -1
- package/dist/lib/sales-batch-workbook.js +7 -0
- package/dist/lib/sales-batch-workbook.js.map +1 -1
- package/dist/lib/sales-file.service.d.ts +1 -1
- package/dist/lib/sales-file.service.d.ts.map +1 -1
- package/dist/lib/sales-file.service.js +22 -4
- package/dist/lib/sales-file.service.js.map +1 -1
- package/dist/lib/workbook-borders.d.ts +12 -0
- package/dist/lib/workbook-borders.d.ts.map +1 -0
- package/dist/lib/workbook-borders.js +36 -0
- package/dist/lib/workbook-borders.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type ExcelJS from 'exceljs';
|
|
2
|
+
type BorderSide = Partial<ExcelJS.Border>;
|
|
3
|
+
type SectionBorderOptions = {
|
|
4
|
+
inner?: BorderSide;
|
|
5
|
+
outer?: BorderSide;
|
|
6
|
+
rowBoundary?: (nextRow: number) => BorderSide | undefined;
|
|
7
|
+
columnDividers?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Draw each merged region's perimeter on its physical cells for Excel and WPS. */
|
|
10
|
+
export declare function borderWorkbookSection(sheet: ExcelJS.Worksheet, firstRow: number, lastRow: number, lastColumn: number, separators?: number[], options?: SectionBorderOptions): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=workbook-borders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workbook-borders.d.ts","sourceRoot":"","sources":["../../src/lib/workbook-borders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAElC,KAAK,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AACzC,KAAK,oBAAoB,GAAG;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,CAAA;IACzD,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,EAAO,EAAE,OAAO,GAAE,oBAAyB,QA4BnL"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Draw each merged region's perimeter on its physical cells for Excel and WPS. */
|
|
2
|
+
export function borderWorkbookSection(sheet, firstRow, lastRow, lastColumn, separators = [], options = {}) {
|
|
3
|
+
const ranges = new Map();
|
|
4
|
+
for (const merge of sheet.model.merges) {
|
|
5
|
+
const [first, last] = merge.split(':').map(address => sheet.getCell(address));
|
|
6
|
+
ranges.set(first.address, { top: Number(first.row), bottom: Number(last.row), left: Number(first.col), right: Number(last.col) });
|
|
7
|
+
}
|
|
8
|
+
const inner = options.inner ?? { style: 'thin', color: { argb: 'FF8A98A4' } };
|
|
9
|
+
const outer = options.outer ?? { style: 'medium', color: { argb: 'FF596978' } };
|
|
10
|
+
const dividers = new Set(separators);
|
|
11
|
+
const horizontal = (row) => {
|
|
12
|
+
if (row === firstRow || row === lastRow + 1 || dividers.has(row))
|
|
13
|
+
return outer;
|
|
14
|
+
return options.rowBoundary ? options.rowBoundary(row) : inner;
|
|
15
|
+
};
|
|
16
|
+
for (let row = firstRow; row <= lastRow; row++) {
|
|
17
|
+
for (let column = 1; column <= lastColumn; column++) {
|
|
18
|
+
const cell = sheet.getCell(row, column);
|
|
19
|
+
const range = ranges.get(cell.master.address);
|
|
20
|
+
const border = {};
|
|
21
|
+
const top = row === (range?.top ?? row) ? horizontal(row) : undefined;
|
|
22
|
+
const bottom = row === (range?.bottom ?? row) ? horizontal(row + 1) : undefined;
|
|
23
|
+
if (top)
|
|
24
|
+
border.top = top;
|
|
25
|
+
if (bottom)
|
|
26
|
+
border.bottom = bottom;
|
|
27
|
+
if (column === (range?.left ?? column) && (column === 1 || options.columnDividers !== false))
|
|
28
|
+
border.left = column === 1 ? outer : inner;
|
|
29
|
+
if (column === (range?.right ?? column) && (column === lastColumn || options.columnDividers !== false))
|
|
30
|
+
border.right = column === lastColumn ? outer : inner;
|
|
31
|
+
// ExcelJS initially shares the style object across merged cells.
|
|
32
|
+
cell.style = { ...cell.style, border };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=workbook-borders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workbook-borders.js","sourceRoot":"","sources":["../../src/lib/workbook-borders.ts"],"names":[],"mappings":"AAUA,mFAAmF;AACnF,MAAM,UAAU,qBAAqB,CAAC,KAAwB,EAAE,QAAgB,EAAE,OAAe,EAAE,UAAkB,EAAE,aAAuB,EAAE,EAAE,UAAgC,EAAE;IAClL,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwE,CAAA;IAC9F,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACvC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG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