@pdfme/schemas 3.2.3-dev.1 → 4.0.0-alpha.0
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/cjs/__tests__/text.test.js +5 -4
- package/dist/cjs/__tests__/text.test.js.map +1 -1
- package/dist/cjs/__tests__/utils.test.js +3 -0
- package/dist/cjs/__tests__/utils.test.js.map +1 -1
- package/dist/cjs/src/barcodes/propPanel.js +11 -11
- package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
- package/dist/cjs/src/barcodes/uiRender.js +1 -1
- package/dist/cjs/src/barcodes/uiRender.js.map +1 -1
- package/dist/cjs/src/graphics/image.js +5 -11
- package/dist/cjs/src/graphics/image.js.map +1 -1
- package/dist/cjs/src/graphics/svg.js +2 -3
- package/dist/cjs/src/graphics/svg.js.map +1 -1
- package/dist/cjs/src/index.js +6 -1
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/shapes/line.js +5 -9
- package/dist/cjs/src/shapes/line.js.map +1 -1
- package/dist/cjs/src/shapes/rectAndEllipse.js +3 -2
- package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/cjs/src/tables/cell.js +125 -0
- package/dist/cjs/src/tables/cell.js.map +1 -0
- package/dist/cjs/src/tables/classes.js +467 -0
- package/dist/cjs/src/tables/classes.js.map +1 -0
- package/dist/cjs/src/tables/dynamicTemplate.js +71 -0
- package/dist/cjs/src/tables/dynamicTemplate.js.map +1 -0
- package/dist/cjs/src/tables/helper.js +171 -0
- package/dist/cjs/src/tables/helper.js.map +1 -0
- package/dist/cjs/src/tables/index.js +12 -0
- package/dist/cjs/src/tables/index.js.map +1 -0
- package/dist/cjs/src/tables/pdfRender.js +95 -0
- package/dist/cjs/src/tables/pdfRender.js.map +1 -0
- package/dist/cjs/src/tables/propPanel.js +87 -0
- package/dist/cjs/src/tables/propPanel.js.map +1 -0
- package/dist/cjs/src/tables/tableHelper.js +231 -0
- package/dist/cjs/src/tables/tableHelper.js.map +1 -0
- package/dist/cjs/src/tables/types.js +3 -0
- package/dist/cjs/src/tables/types.js.map +1 -0
- package/dist/cjs/src/tables/uiRender.js +321 -0
- package/dist/cjs/src/tables/uiRender.js.map +1 -0
- package/dist/cjs/src/text/helper.js +21 -6
- package/dist/cjs/src/text/helper.js.map +1 -1
- package/dist/cjs/src/text/index.js +0 -1
- package/dist/cjs/src/text/index.js.map +1 -1
- package/dist/cjs/src/text/pdfRender.js +5 -8
- package/dist/cjs/src/text/pdfRender.js.map +1 -1
- package/dist/cjs/src/text/propPanel.js +6 -4
- package/dist/cjs/src/text/propPanel.js.map +1 -1
- package/dist/cjs/src/text/uiRender.js +18 -17
- package/dist/cjs/src/text/uiRender.js.map +1 -1
- package/dist/cjs/src/utils.js +9 -1
- package/dist/cjs/src/utils.js.map +1 -1
- package/dist/esm/__tests__/text.test.js +5 -4
- package/dist/esm/__tests__/text.test.js.map +1 -1
- package/dist/esm/__tests__/utils.test.js +3 -0
- package/dist/esm/__tests__/utils.test.js.map +1 -1
- package/dist/esm/src/barcodes/propPanel.js +11 -11
- package/dist/esm/src/barcodes/propPanel.js.map +1 -1
- package/dist/esm/src/barcodes/uiRender.js +1 -1
- package/dist/esm/src/barcodes/uiRender.js.map +1 -1
- package/dist/esm/src/graphics/image.js +4 -10
- package/dist/esm/src/graphics/image.js.map +1 -1
- package/dist/esm/src/graphics/svg.js +2 -3
- package/dist/esm/src/graphics/svg.js.map +1 -1
- package/dist/esm/src/index.js +3 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/shapes/line.js +5 -9
- package/dist/esm/src/shapes/line.js.map +1 -1
- package/dist/esm/src/shapes/rectAndEllipse.js +3 -2
- package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/esm/src/tables/cell.js +120 -0
- package/dist/esm/src/tables/cell.js.map +1 -0
- package/dist/esm/src/tables/classes.js +460 -0
- package/dist/esm/src/tables/classes.js.map +1 -0
- package/dist/esm/src/tables/dynamicTemplate.js +66 -0
- package/dist/esm/src/tables/dynamicTemplate.js.map +1 -0
- package/dist/esm/src/tables/helper.js +163 -0
- package/dist/esm/src/tables/helper.js.map +1 -0
- package/dist/esm/src/tables/index.js +10 -0
- package/dist/esm/src/tables/index.js.map +1 -0
- package/dist/esm/src/tables/pdfRender.js +88 -0
- package/dist/esm/src/tables/pdfRender.js.map +1 -0
- package/dist/esm/src/tables/propPanel.js +84 -0
- package/dist/esm/src/tables/propPanel.js.map +1 -0
- package/dist/esm/src/tables/tableHelper.js +226 -0
- package/dist/esm/src/tables/tableHelper.js.map +1 -0
- package/dist/esm/src/tables/types.js +2 -0
- package/dist/esm/src/tables/types.js.map +1 -0
- package/dist/esm/src/tables/uiRender.js +314 -0
- package/dist/esm/src/tables/uiRender.js.map +1 -0
- package/dist/esm/src/text/helper.js +19 -5
- package/dist/esm/src/text/helper.js.map +1 -1
- package/dist/esm/src/text/index.js +0 -1
- package/dist/esm/src/text/index.js.map +1 -1
- package/dist/esm/src/text/pdfRender.js +6 -9
- package/dist/esm/src/text/pdfRender.js.map +1 -1
- package/dist/esm/src/text/propPanel.js +6 -4
- package/dist/esm/src/text/propPanel.js.map +1 -1
- package/dist/esm/src/text/uiRender.js +19 -18
- package/dist/esm/src/text/uiRender.js.map +1 -1
- package/dist/esm/src/utils.js +6 -0
- package/dist/esm/src/utils.js.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/shapes/rectAndEllipse.d.ts +13 -27
- package/dist/types/src/tables/cell.d.ts +4 -0
- package/dist/types/src/tables/classes.d.ts +68 -0
- package/dist/types/src/tables/dynamicTemplate.d.ts +13 -0
- package/dist/types/src/tables/helper.d.ts +252 -0
- package/dist/types/src/tables/index.d.ts +4 -0
- package/dist/types/src/tables/pdfRender.d.ts +3 -0
- package/dist/types/src/tables/propPanel.d.ts +3 -0
- package/dist/types/src/tables/tableHelper.d.ts +11 -0
- package/dist/types/src/tables/types.d.ts +91 -0
- package/dist/types/src/tables/uiRender.d.ts +3 -0
- package/dist/types/src/text/helper.d.ts +8 -1
- package/dist/types/src/utils.d.ts +2 -0
- package/package.json +1 -1
- package/src/barcodes/propPanel.ts +12 -12
- package/src/barcodes/uiRender.ts +1 -1
- package/src/graphics/image.ts +6 -11
- package/src/graphics/svg.ts +2 -3
- package/src/index.ts +5 -0
- package/src/shapes/line.ts +4 -9
- package/src/shapes/rectAndEllipse.ts +4 -4
- package/src/tables/cell.ts +157 -0
- package/src/tables/classes.ts +398 -0
- package/src/tables/dynamicTemplate.ts +81 -0
- package/src/tables/helper.ts +198 -0
- package/src/tables/index.ts +12 -0
- package/src/tables/pdfRender.ts +115 -0
- package/src/tables/propPanel.ts +90 -0
- package/src/tables/tableHelper.ts +322 -0
- package/src/tables/types.ts +88 -0
- package/src/tables/uiRender.ts +362 -0
- package/src/text/helper.ts +30 -6
- package/src/text/index.ts +0 -1
- package/src/text/pdfRender.ts +7 -11
- package/src/text/propPanel.ts +6 -4
- package/src/text/uiRender.ts +18 -18
- package/src/utils.ts +8 -0
@@ -0,0 +1,163 @@
|
|
1
|
+
import { DEFAULT_ALIGNMENT, DEFAULT_FONT_SIZE, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_LEFT, VERTICAL_ALIGN_TOP, VERTICAL_ALIGN_MIDDLE, VERTICAL_ALIGN_BOTTOM, } from '../text/constants';
|
2
|
+
import { HEX_COLOR_PATTERN } from '../constants.js';
|
3
|
+
export const getDefaultCellStyles = () => ({
|
4
|
+
fontName: undefined,
|
5
|
+
alignment: DEFAULT_ALIGNMENT,
|
6
|
+
verticalAlignment: VERTICAL_ALIGN_MIDDLE,
|
7
|
+
fontSize: DEFAULT_FONT_SIZE,
|
8
|
+
lineHeight: DEFAULT_LINE_HEIGHT,
|
9
|
+
characterSpacing: DEFAULT_CHARACTER_SPACING,
|
10
|
+
fontColor: DEFAULT_FONT_COLOR,
|
11
|
+
backgroundColor: '',
|
12
|
+
borderColor: '#888888',
|
13
|
+
borderWidth: { top: 0.1, bottom: 0.1, left: 0.1, right: 0.1 },
|
14
|
+
padding: { top: 5, bottom: 5, left: 5, right: 5 },
|
15
|
+
});
|
16
|
+
const getBoxDimensionProp = (step = 1) => {
|
17
|
+
const getCommonProp = () => ({
|
18
|
+
type: 'number',
|
19
|
+
widget: 'inputNumber',
|
20
|
+
props: { min: 0, step },
|
21
|
+
span: 6,
|
22
|
+
});
|
23
|
+
return {
|
24
|
+
top: { title: 'Top', ...getCommonProp() },
|
25
|
+
right: { title: 'Right', ...getCommonProp() },
|
26
|
+
bottom: { title: 'Bottom', ...getCommonProp() },
|
27
|
+
left: { title: 'Left', ...getCommonProp() },
|
28
|
+
};
|
29
|
+
};
|
30
|
+
export const getCellPropPanelSchema = (arg) => {
|
31
|
+
const { i18n, fallbackFontName, fontNames, isBody } = arg;
|
32
|
+
return {
|
33
|
+
fontName: {
|
34
|
+
title: i18n('schemas.text.fontName'),
|
35
|
+
type: 'string',
|
36
|
+
widget: 'select',
|
37
|
+
default: fallbackFontName,
|
38
|
+
props: { options: fontNames.map((name) => ({ label: name, value: name })) },
|
39
|
+
span: 12,
|
40
|
+
},
|
41
|
+
fontSize: {
|
42
|
+
title: i18n('schemas.text.size'),
|
43
|
+
type: 'number',
|
44
|
+
widget: 'inputNumber',
|
45
|
+
props: { min: 0 },
|
46
|
+
span: 6,
|
47
|
+
},
|
48
|
+
characterSpacing: {
|
49
|
+
title: i18n('schemas.text.spacing'),
|
50
|
+
type: 'number',
|
51
|
+
widget: 'inputNumber',
|
52
|
+
props: { min: 0 },
|
53
|
+
span: 6,
|
54
|
+
},
|
55
|
+
alignment: {
|
56
|
+
title: i18n('schemas.text.textAlign'),
|
57
|
+
type: 'string',
|
58
|
+
widget: 'select',
|
59
|
+
props: {
|
60
|
+
options: [
|
61
|
+
{ label: i18n('schemas.left'), value: ALIGN_LEFT },
|
62
|
+
{ label: i18n('schemas.center'), value: ALIGN_CENTER },
|
63
|
+
{ label: i18n('schemas.right'), value: ALIGN_RIGHT },
|
64
|
+
],
|
65
|
+
},
|
66
|
+
span: 8,
|
67
|
+
},
|
68
|
+
verticalAlignment: {
|
69
|
+
title: i18n('schemas.text.verticalAlign'),
|
70
|
+
type: 'string',
|
71
|
+
widget: 'select',
|
72
|
+
props: {
|
73
|
+
options: [
|
74
|
+
{ label: i18n('schemas.top'), value: VERTICAL_ALIGN_TOP },
|
75
|
+
{ label: i18n('schemas.middle'), value: VERTICAL_ALIGN_MIDDLE },
|
76
|
+
{ label: i18n('schemas.bottom'), value: VERTICAL_ALIGN_BOTTOM },
|
77
|
+
],
|
78
|
+
},
|
79
|
+
span: 8,
|
80
|
+
},
|
81
|
+
lineHeight: {
|
82
|
+
title: i18n('schemas.text.lineHeight'),
|
83
|
+
type: 'number',
|
84
|
+
widget: 'inputNumber',
|
85
|
+
props: { step: 0.1, min: 0 },
|
86
|
+
span: 8,
|
87
|
+
},
|
88
|
+
fontColor: {
|
89
|
+
title: i18n('schemas.textColor'),
|
90
|
+
type: 'string',
|
91
|
+
widget: 'color',
|
92
|
+
rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
|
93
|
+
},
|
94
|
+
borderColor: {
|
95
|
+
title: i18n('schemas.borderColor'),
|
96
|
+
type: 'string',
|
97
|
+
widget: 'color',
|
98
|
+
rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
|
99
|
+
},
|
100
|
+
backgroundColor: {
|
101
|
+
title: i18n('schemas.backgroundColor'),
|
102
|
+
type: 'string',
|
103
|
+
widget: 'color',
|
104
|
+
rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
|
105
|
+
},
|
106
|
+
...(isBody
|
107
|
+
? {
|
108
|
+
alternateBackgroundColor: {
|
109
|
+
title: i18n('schemas.table.alternateBackgroundColor'),
|
110
|
+
type: 'string',
|
111
|
+
widget: 'color',
|
112
|
+
rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
|
113
|
+
},
|
114
|
+
}
|
115
|
+
: {}),
|
116
|
+
'-': { type: 'void', widget: 'Divider' },
|
117
|
+
borderWidth: {
|
118
|
+
title: i18n('schemas.borderWidth'),
|
119
|
+
type: 'object',
|
120
|
+
widget: 'lineTitle',
|
121
|
+
span: 24,
|
122
|
+
properties: getBoxDimensionProp(0.1),
|
123
|
+
},
|
124
|
+
'--': { type: 'void', widget: 'Divider' },
|
125
|
+
padding: {
|
126
|
+
title: i18n('schemas.padding'),
|
127
|
+
type: 'object',
|
128
|
+
widget: 'lineTitle',
|
129
|
+
span: 24,
|
130
|
+
properties: getBoxDimensionProp(),
|
131
|
+
},
|
132
|
+
};
|
133
|
+
};
|
134
|
+
export const getColumnStylesPropPanelSchema = ({ head, i18n, }) => ({
|
135
|
+
alignment: {
|
136
|
+
type: 'object',
|
137
|
+
widget: 'lineTitle',
|
138
|
+
title: i18n('schemas.text.textAlign'),
|
139
|
+
column: 3,
|
140
|
+
properties: head.reduce((acc, cur, i) => Object.assign(acc, {
|
141
|
+
[i]: {
|
142
|
+
title: cur || 'Column ' + String(i + 1),
|
143
|
+
type: 'string',
|
144
|
+
widget: 'select',
|
145
|
+
props: {
|
146
|
+
options: [
|
147
|
+
{ label: i18n('schemas.left'), value: ALIGN_LEFT },
|
148
|
+
{ label: i18n('schemas.center'), value: ALIGN_CENTER },
|
149
|
+
{ label: i18n('schemas.right'), value: ALIGN_RIGHT },
|
150
|
+
],
|
151
|
+
},
|
152
|
+
},
|
153
|
+
}), {}),
|
154
|
+
},
|
155
|
+
});
|
156
|
+
export const getBody = (value) => JSON.parse(value || '[]');
|
157
|
+
export const getBodyWithRange = (value, range) => {
|
158
|
+
const body = getBody(value);
|
159
|
+
if (!range)
|
160
|
+
return body;
|
161
|
+
return body.slice(range.start, range.end);
|
162
|
+
};
|
163
|
+
//# sourceMappingURL=helper.js.map
|
@@ -0,0 +1 @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AAG,CAAC,CAAC;AAC5C,CAAC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { pdfRender } from './pdfRender.js';
|
2
|
+
import { uiRender } from './uiRender.js';
|
3
|
+
import { propPanel } from './propPanel.js';
|
4
|
+
const tableSchema = {
|
5
|
+
pdf: pdfRender,
|
6
|
+
ui: uiRender,
|
7
|
+
propPanel,
|
8
|
+
};
|
9
|
+
export default tableSchema;
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tables/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,GAAwB;IACvC,GAAG,EAAE,SAAS;IACd,EAAE,EAAE,QAAQ;IACZ,SAAS;CACV,CAAC;AACF,eAAe,WAAW,CAAC"}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import { rectangle } from '../shapes/rectAndEllipse';
|
2
|
+
import cell from './cell';
|
3
|
+
import { getBodyWithRange } from './helper';
|
4
|
+
import { createSingleTable } from './tableHelper';
|
5
|
+
const rectanglePdfRender = rectangle.pdf;
|
6
|
+
const cellPdfRender = cell.pdf;
|
7
|
+
async function drawCell(arg, cell) {
|
8
|
+
// TODO Not considering the table border
|
9
|
+
// The cell's position and size should indeed be shifted to accommodate the table border
|
10
|
+
await cellPdfRender({
|
11
|
+
...arg,
|
12
|
+
value: cell.raw,
|
13
|
+
schema: {
|
14
|
+
type: 'cell',
|
15
|
+
position: { x: cell.x, y: cell.y },
|
16
|
+
width: cell.width,
|
17
|
+
height: cell.height,
|
18
|
+
fontName: cell.styles.fontName,
|
19
|
+
alignment: cell.styles.alignment,
|
20
|
+
verticalAlignment: cell.styles.verticalAlignment,
|
21
|
+
fontSize: cell.styles.fontSize,
|
22
|
+
lineHeight: cell.styles.lineHeight,
|
23
|
+
characterSpacing: cell.styles.characterSpacing,
|
24
|
+
backgroundColor: cell.styles.backgroundColor,
|
25
|
+
fontColor: cell.styles.textColor,
|
26
|
+
borderColor: cell.styles.lineColor,
|
27
|
+
borderWidth: cell.styles.lineWidth,
|
28
|
+
padding: cell.styles.cellPadding,
|
29
|
+
},
|
30
|
+
});
|
31
|
+
}
|
32
|
+
async function drawRow(arg, table, row, cursor, columns) {
|
33
|
+
cursor.x = table.settings.margin.left;
|
34
|
+
for (const column of columns) {
|
35
|
+
const cell = row.cells[column.index];
|
36
|
+
if (!cell) {
|
37
|
+
cursor.x += column.width;
|
38
|
+
continue;
|
39
|
+
}
|
40
|
+
cell.x = cursor.x;
|
41
|
+
cell.y = cursor.y;
|
42
|
+
await drawCell(arg, cell);
|
43
|
+
cursor.x += column.width;
|
44
|
+
}
|
45
|
+
cursor.y += row.height;
|
46
|
+
}
|
47
|
+
async function drawTableBorder(arg, table, startPos, cursor) {
|
48
|
+
const lineWidth = table.settings.tableLineWidth;
|
49
|
+
const lineColor = table.settings.tableLineColor;
|
50
|
+
if (!lineWidth || !lineColor)
|
51
|
+
return;
|
52
|
+
await rectanglePdfRender({
|
53
|
+
...arg,
|
54
|
+
schema: {
|
55
|
+
type: 'rectangle',
|
56
|
+
borderWidth: lineWidth,
|
57
|
+
borderColor: lineColor,
|
58
|
+
color: '',
|
59
|
+
position: { x: startPos.x, y: startPos.y },
|
60
|
+
width: table.getWidth(),
|
61
|
+
height: cursor.y - startPos.y,
|
62
|
+
readOnly: true,
|
63
|
+
},
|
64
|
+
});
|
65
|
+
}
|
66
|
+
async function drawTable(arg, table) {
|
67
|
+
const settings = table.settings;
|
68
|
+
const startY = settings.startY;
|
69
|
+
const margin = settings.margin;
|
70
|
+
const cursor = { x: margin.left, y: startY };
|
71
|
+
const startPos = Object.assign({}, cursor);
|
72
|
+
if (settings.showHead) {
|
73
|
+
for (const row of table.head) {
|
74
|
+
await drawRow(arg, table, row, cursor, table.columns);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
for (const row of table.body) {
|
78
|
+
await drawRow(arg, table, row, cursor, table.columns);
|
79
|
+
}
|
80
|
+
await drawTableBorder(arg, table, startPos, cursor);
|
81
|
+
}
|
82
|
+
export const pdfRender = async (arg) => {
|
83
|
+
const { value, schema } = arg;
|
84
|
+
const body = getBodyWithRange(value, schema.__bodyRange);
|
85
|
+
const table = await createSingleTable(body, arg);
|
86
|
+
await drawTable(arg, table);
|
87
|
+
};
|
88
|
+
//# sourceMappingURL=pdfRender.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pdfRender.js","sourceRoot":"","sources":["../../../../src/tables/pdfRender.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIlD,MAAM,kBAAkB,GAAG,SAAS,CAAC,GAAG,CAAC;AACzC,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC;AAE/B,KAAK,UAAU,QAAQ,CAAC,GAAgC,EAAE,IAAU;IAClE,wCAAwC;IACxC,wFAAwF;IACxF,MAAM,aAAa,CAAC;QAClB,GAAG,GAAG;QACN,KAAK,EAAE,IAAI,CAAC,GAAG;QACf,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE;YAClC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC9B,SAAS,EAAE,IAAI,CAAC,MA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AAC,IAAI,EAAE;QAC5B,MAAM,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;KACvD;IAED,MAAM,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAE,GAAgC,EAAE,EAAE;IAClE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAC9B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjD,MAAM,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC,CAAC"}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { getFallbackFontName, DEFAULT_FONT_NAME } from '@pdfme/common';
|
2
|
+
import { getDefaultCellStyles, getCellPropPanelSchema, getColumnStylesPropPanelSchema, } from './helper.js';
|
3
|
+
import { HEX_COLOR_PATTERN } from '../constants.js';
|
4
|
+
export const propPanel = {
|
5
|
+
schema: ({ activeSchema, options, i18n }) => {
|
6
|
+
// @ts-ignore
|
7
|
+
const head = (activeSchema.head || []);
|
8
|
+
const font = options.font || { [DEFAULT_FONT_NAME]: { data: '', fallback: true } };
|
9
|
+
const fontNames = Object.keys(font);
|
10
|
+
const fallbackFontName = getFallbackFontName(font);
|
11
|
+
return {
|
12
|
+
tableStyles: {
|
13
|
+
title: i18n('schemas.table.tableStyle'),
|
14
|
+
type: 'object',
|
15
|
+
widget: 'Card',
|
16
|
+
span: 24,
|
17
|
+
properties: {
|
18
|
+
borderWidth: {
|
19
|
+
title: i18n('schemas.borderWidth'),
|
20
|
+
type: 'number',
|
21
|
+
widget: 'inputNumber',
|
22
|
+
props: { min: 0, step: 0.1 },
|
23
|
+
step: 1,
|
24
|
+
},
|
25
|
+
borderColor: {
|
26
|
+
title: i18n('schemas.borderColor'),
|
27
|
+
type: 'string',
|
28
|
+
widget: 'color',
|
29
|
+
rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
|
30
|
+
},
|
31
|
+
},
|
32
|
+
},
|
33
|
+
headStyles: {
|
34
|
+
title: i18n('schemas.table.headStyle'),
|
35
|
+
type: 'object',
|
36
|
+
widget: 'Card',
|
37
|
+
span: 24,
|
38
|
+
properties: getCellPropPanelSchema({ i18n, fallbackFontName, fontNames }),
|
39
|
+
},
|
40
|
+
bodyStyles: {
|
41
|
+
title: i18n('schemas.table.bodyStyle'),
|
42
|
+
type: 'object',
|
43
|
+
widget: 'Card',
|
44
|
+
span: 24,
|
45
|
+
properties: getCellPropPanelSchema({ i18n, fallbackFontName, fontNames, isBody: true }),
|
46
|
+
},
|
47
|
+
columnStyles: {
|
48
|
+
title: i18n('schemas.table.columnStyle'),
|
49
|
+
type: 'object',
|
50
|
+
widget: 'Card',
|
51
|
+
span: 24,
|
52
|
+
properties: getColumnStylesPropPanelSchema({ head, i18n }),
|
53
|
+
},
|
54
|
+
};
|
55
|
+
},
|
56
|
+
defaultSchema: {
|
57
|
+
type: 'table',
|
58
|
+
position: { x: 0, y: 0 },
|
59
|
+
width: 150,
|
60
|
+
height: 20,
|
61
|
+
content: JSON.stringify([
|
62
|
+
['Alice', 'New York', 'Alice is a freelance web designer and developer'],
|
63
|
+
['Bob', 'Paris', 'Bob is a freelance illustrator and graphic designer'],
|
64
|
+
]),
|
65
|
+
showHead: true,
|
66
|
+
head: ['Name', 'City', 'Description'],
|
67
|
+
headWidthPercentages: [30, 30, 40],
|
68
|
+
tableStyles: {
|
69
|
+
borderColor: '#000000',
|
70
|
+
borderWidth: 0.3,
|
71
|
+
},
|
72
|
+
headStyles: Object.assign(getDefaultCellStyles(), {
|
73
|
+
fontColor: '#ffffff',
|
74
|
+
backgroundColor: '#2980ba',
|
75
|
+
borderColor: '',
|
76
|
+
borderWidth: { top: 0, right: 0, bottom: 0, left: 0 },
|
77
|
+
}),
|
78
|
+
bodyStyles: Object.assign(getDefaultCellStyles(), {
|
79
|
+
alternateBackgroundColor: '#f5f5f5',
|
80
|
+
}),
|
81
|
+
columnStyles: {},
|
82
|
+
},
|
83
|
+
};
|
84
|
+
//# sourceMappingURL=propPanel.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/tables/propPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,CAAC,MAAM,SAAS,GAA2B;IAC/C,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;QAC1C,aAAa;QACb,MAAM,IAAI,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,EAAE,CAAa,CAAC;QACnD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;QACnF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACnD,OAAO;YACL,WAAW,EAAE;gBACX,KAAK,EAAE,IAAI,CAAC,0BAA0B,CAAC;gBACvC,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE;gBACR,UAAU,EAAE;oBACV,WAAW,EAAE;wBACX,KA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AC,EAAE,CAAC,EAAE;QACxB,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;YACtB,CAAC,OAAO,EAAE,UAAU,EAAE,iDAAiD,CAAC;YACxE,CAAC,KAAK,EAAE,OAAO,EAAE,qDAAqD,CAAC;SACxE,CAAC;QACF,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC;QACrC,oBAAoB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;QAClC,WAAW,EAAE;YACX,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,GAAG;SACjB;QACD,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,EAAE;YAChD,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,SAAS;YAC1B,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;SACtD,CAAC;QACF,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,EAAE;YAChD,wBAAwB,EAAE,SAAS;SACpC,CAAC;QACF,YAAY,EAAE,EAAE;KACjB;CACF,CAAC"}
|
@@ -0,0 +1,226 @@
|
|
1
|
+
import { isBlankPdf, getDefaultFont, getFallbackFontName, } from '@pdfme/common';
|
2
|
+
import { cloneDeep } from '../utils';
|
3
|
+
import { Cell, Column, Row, Table } from './classes';
|
4
|
+
function parseSection(sectionName, sectionRows, columns, styleProps, fallbackFontName) {
|
5
|
+
const rowSpansLeftForColumn = {};
|
6
|
+
const result = sectionRows.map((rawRow, rowIndex) => {
|
7
|
+
let skippedRowForRowSpans = 0;
|
8
|
+
const cells = {};
|
9
|
+
let colSpansAdded = 0;
|
10
|
+
let columnSpansLeft = 0;
|
11
|
+
for (const column of columns) {
|
12
|
+
if (rowSpansLeftForColumn[column.index] == null ||
|
13
|
+
rowSpansLeftForColumn[column.index].left === 0) {
|
14
|
+
if (columnSpansLeft === 0) {
|
15
|
+
let rawCell;
|
16
|
+
if (Array.isArray(rawRow)) {
|
17
|
+
rawCell = rawRow[column.index - colSpansAdded - skippedRowForRowSpans];
|
18
|
+
}
|
19
|
+
else {
|
20
|
+
rawCell = rawRow[column.index];
|
21
|
+
}
|
22
|
+
const styles = cellStyles(sectionName, column, rowIndex, styleProps, fallbackFontName);
|
23
|
+
const cell = new Cell(rawCell, styles, sectionName);
|
24
|
+
cells[column.index] = cell;
|
25
|
+
columnSpansLeft = 0;
|
26
|
+
rowSpansLeftForColumn[column.index] = {
|
27
|
+
left: 0,
|
28
|
+
times: columnSpansLeft,
|
29
|
+
};
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
columnSpansLeft--;
|
33
|
+
colSpansAdded++;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
rowSpansLeftForColumn[column.index].left--;
|
38
|
+
columnSpansLeft = rowSpansLeftForColumn[column.index].times;
|
39
|
+
skippedRowForRowSpans++;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
return new Row(rawRow, rowIndex, sectionName, cells);
|
43
|
+
});
|
44
|
+
return result;
|
45
|
+
}
|
46
|
+
function parseContent4Table(input, fallbackFontName) {
|
47
|
+
const content = input.content;
|
48
|
+
const columns = content.columns.map((index) => new Column(index));
|
49
|
+
const styles = input.styles;
|
50
|
+
return {
|
51
|
+
columns,
|
52
|
+
head: parseSection('head', content.head, columns, styles, fallbackFontName),
|
53
|
+
body: parseSection('body', content.body, columns, styles, fallbackFontName),
|
54
|
+
};
|
55
|
+
}
|
56
|
+
function cellStyles(sectionName, column, rowIndex, styles, fallbackFontName) {
|
57
|
+
let sectionStyles;
|
58
|
+
if (sectionName === 'head') {
|
59
|
+
sectionStyles = styles.headStyles;
|
60
|
+
}
|
61
|
+
else if (sectionName === 'body') {
|
62
|
+
sectionStyles = styles.bodyStyles;
|
63
|
+
}
|
64
|
+
const otherStyles = Object.assign({}, styles.styles, sectionStyles);
|
65
|
+
const colStyles = styles.columnStyles[column.index] || styles.columnStyles[column.index] || {};
|
66
|
+
const rowStyles = sectionName === 'body' && rowIndex % 2 === 0
|
67
|
+
? Object.assign({}, styles.alternateRowStyles)
|
68
|
+
: {};
|
69
|
+
const defaultStyle = {
|
70
|
+
fontName: fallbackFontName,
|
71
|
+
backgroundColor: '',
|
72
|
+
textColor: '#000000',
|
73
|
+
lineHeight: 1,
|
74
|
+
characterSpacing: 0,
|
75
|
+
alignment: 'left',
|
76
|
+
verticalAlignment: 'middle',
|
77
|
+
fontSize: 10,
|
78
|
+
cellPadding: 5,
|
79
|
+
lineColor: '#000000',
|
80
|
+
lineWidth: 0,
|
81
|
+
minCellHeight: 0,
|
82
|
+
minCellWidth: 0,
|
83
|
+
};
|
84
|
+
return Object.assign(defaultStyle, otherStyles, rowStyles, colStyles);
|
85
|
+
}
|
86
|
+
function mapCellStyle(style) {
|
87
|
+
return {
|
88
|
+
fontName: style.fontName,
|
89
|
+
alignment: style.alignment,
|
90
|
+
verticalAlignment: style.verticalAlignment,
|
91
|
+
fontSize: style.fontSize,
|
92
|
+
lineHeight: style.lineHeight,
|
93
|
+
characterSpacing: style.characterSpacing,
|
94
|
+
backgroundColor: style.backgroundColor,
|
95
|
+
// ---
|
96
|
+
textColor: style.fontColor,
|
97
|
+
lineColor: style.borderColor,
|
98
|
+
lineWidth: style.borderWidth,
|
99
|
+
cellPadding: style.padding,
|
100
|
+
};
|
101
|
+
}
|
102
|
+
function createTableWithAvailableHeight(tableBody, availableHeight, args) {
|
103
|
+
let limit = availableHeight;
|
104
|
+
const newTableBody = [];
|
105
|
+
let index = 0;
|
106
|
+
while (limit > 0 && index < tableBody.length) {
|
107
|
+
const row = tableBody.slice(0, index + 1).pop();
|
108
|
+
if (!row)
|
109
|
+
break;
|
110
|
+
const rowHeight = row.height;
|
111
|
+
if (limit - rowHeight < 0) {
|
112
|
+
break;
|
113
|
+
}
|
114
|
+
newTableBody.push(row.raw);
|
115
|
+
limit -= rowHeight;
|
116
|
+
index++;
|
117
|
+
}
|
118
|
+
return createSingleTable(newTableBody, args);
|
119
|
+
}
|
120
|
+
function getTableOptions(schema, body) {
|
121
|
+
const columnStylesWidth = schema.headWidthPercentages.reduce((acc, cur, i) => ({ ...acc, [i]: { cellWidth: schema.width * (cur / 100) } }), {});
|
122
|
+
const columnStylesAlignment = Object.entries(schema.columnStyles.alignment || {}).reduce((acc, [key, value]) => ({ ...acc, [key]: { alignment: value } }), {});
|
123
|
+
const allKeys = new Set([
|
124
|
+
...Object.keys(columnStylesWidth).map(Number),
|
125
|
+
...Object.keys(columnStylesAlignment).map(Number),
|
126
|
+
]);
|
127
|
+
const columnStyles = Array.from(allKeys).reduce((acc, key) => {
|
128
|
+
const widthStyle = columnStylesWidth[key] || {};
|
129
|
+
const alignmentStyle = columnStylesAlignment[key] || {};
|
130
|
+
return { ...acc, [key]: { ...widthStyle, ...alignmentStyle } };
|
131
|
+
}, {});
|
132
|
+
return {
|
133
|
+
head: [schema.head],
|
134
|
+
body,
|
135
|
+
showHead: schema.showHead,
|
136
|
+
startY: schema.position.y,
|
137
|
+
tableWidth: schema.width,
|
138
|
+
tableLineColor: schema.tableStyles.borderColor,
|
139
|
+
tableLineWidth: schema.tableStyles.borderWidth,
|
140
|
+
headStyles: mapCellStyle(schema.headStyles),
|
141
|
+
bodyStyles: mapCellStyle(schema.bodyStyles),
|
142
|
+
alternateRowStyles: { backgroundColor: schema.bodyStyles.alternateBackgroundColor },
|
143
|
+
columnStyles,
|
144
|
+
margin: { top: 0, right: 0, left: schema.position.x, bottom: 0 },
|
145
|
+
};
|
146
|
+
}
|
147
|
+
function parseStyles(cInput) {
|
148
|
+
const styleOptions = {
|
149
|
+
styles: {},
|
150
|
+
headStyles: {},
|
151
|
+
bodyStyles: {},
|
152
|
+
alternateRowStyles: {},
|
153
|
+
columnStyles: {},
|
154
|
+
};
|
155
|
+
for (const prop of Object.keys(styleOptions)) {
|
156
|
+
if (prop === 'columnStyles') {
|
157
|
+
const current = cInput[prop];
|
158
|
+
styleOptions.columnStyles = Object.assign({}, current);
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
const allOptions = [cInput];
|
162
|
+
const styles = allOptions.map((opts) => opts[prop] || {});
|
163
|
+
styleOptions[prop] = Object.assign({}, styles[0], styles[1], styles[2]);
|
164
|
+
}
|
165
|
+
}
|
166
|
+
return styleOptions;
|
167
|
+
}
|
168
|
+
function parseContent4Input(options) {
|
169
|
+
const head = options.head || [];
|
170
|
+
const body = options.body || [];
|
171
|
+
const columns = (head[0] || body[0] || []).map((_, index) => index);
|
172
|
+
return { columns, head, body };
|
173
|
+
}
|
174
|
+
function parseInput(schema, body) {
|
175
|
+
const options = getTableOptions(schema, body);
|
176
|
+
const styles = parseStyles(options);
|
177
|
+
const settings = {
|
178
|
+
startY: options.startY,
|
179
|
+
margin: options.margin,
|
180
|
+
tableWidth: options.tableWidth,
|
181
|
+
showHead: options.showHead,
|
182
|
+
tableLineWidth: options.tableLineWidth ?? 0,
|
183
|
+
tableLineColor: options.tableLineColor ?? '',
|
184
|
+
};
|
185
|
+
const content = parseContent4Input(options);
|
186
|
+
return { content, styles, settings };
|
187
|
+
}
|
188
|
+
export function createSingleTable(body, args) {
|
189
|
+
const { options, _cache, basePdf } = args;
|
190
|
+
if (!isBlankPdf(basePdf))
|
191
|
+
throw new Error('[@pdfme/schema/table] Blank PDF is not supported');
|
192
|
+
const input = parseInput(args.schema, body);
|
193
|
+
const font = options.font || getDefaultFont();
|
194
|
+
const fallbackFontName = getFallbackFontName(font);
|
195
|
+
const content = parseContent4Table(input, fallbackFontName);
|
196
|
+
return Table.create({ input, content, font, _cache });
|
197
|
+
}
|
198
|
+
export async function createMultiTables(body, args) {
|
199
|
+
const { basePdf, schema } = args;
|
200
|
+
if (!isBlankPdf(basePdf))
|
201
|
+
throw new Error('[@pdfme/schema/table] Blank PDF is not supported');
|
202
|
+
const pageHeight = basePdf.height;
|
203
|
+
const paddingBottom = basePdf.padding[2];
|
204
|
+
const paddingTop = basePdf.padding[0];
|
205
|
+
let availableHeight = pageHeight - paddingBottom - schema.position.y;
|
206
|
+
const testTable = await createSingleTable(body, args);
|
207
|
+
let remainingBody = testTable.body;
|
208
|
+
const tables = [];
|
209
|
+
while (remainingBody.length > 0) {
|
210
|
+
const tableHeight = tables.length === 0
|
211
|
+
? availableHeight - testTable.getHeadHeight()
|
212
|
+
: availableHeight - paddingTop;
|
213
|
+
const table = await createTableWithAvailableHeight(remainingBody, tableHeight, args);
|
214
|
+
tables.push(table);
|
215
|
+
remainingBody = remainingBody.slice(table.body.length);
|
216
|
+
if (remainingBody.length > 0) {
|
217
|
+
const _schema = cloneDeep(schema);
|
218
|
+
_schema.showHead = false;
|
219
|
+
_schema.position.y = paddingTop;
|
220
|
+
args.schema = _schema;
|
221
|
+
availableHeight = pageHeight - paddingTop - paddingBottom;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
return tables;
|
225
|
+
}
|
226
|
+
//# sourceMappingURL=tableHelper.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tableHelper.js","sourceRoot":"","sources":["../../../../src/tables/tableHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAGV,cAAc,EACd,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAUvB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AA8BrD,SAAS,YAAY,CACnB,WAAoB,EACpB,WAAuB,EACvB,OAAiB,EACjB,UAAuB,EACvB,gBAAwB;IAExB,MAAM,qBAAqB,GAAuD,EAAE,CAAC;IACrF,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;QA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