@pdfme/schemas 3.4.3 → 4.0.0-dev.3

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.
Files changed (138) hide show
  1. package/dist/cjs/__tests__/text.test.js +5 -4
  2. package/dist/cjs/__tests__/text.test.js.map +1 -1
  3. package/dist/cjs/__tests__/utils.test.js +3 -0
  4. package/dist/cjs/__tests__/utils.test.js.map +1 -1
  5. package/dist/cjs/src/barcodes/propPanel.js +23 -11
  6. package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
  7. package/dist/cjs/src/barcodes/uiRender.js +1 -1
  8. package/dist/cjs/src/barcodes/uiRender.js.map +1 -1
  9. package/dist/cjs/src/graphics/image.js +8 -11
  10. package/dist/cjs/src/graphics/image.js.map +1 -1
  11. package/dist/cjs/src/graphics/svg.js +4 -3
  12. package/dist/cjs/src/graphics/svg.js.map +1 -1
  13. package/dist/cjs/src/index.js +7 -1
  14. package/dist/cjs/src/index.js.map +1 -1
  15. package/dist/cjs/src/shapes/line.js +5 -8
  16. package/dist/cjs/src/shapes/line.js.map +1 -1
  17. package/dist/cjs/src/shapes/rectAndEllipse.js +12 -5
  18. package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -1
  19. package/dist/cjs/src/tables/cell.js +125 -0
  20. package/dist/cjs/src/tables/cell.js.map +1 -0
  21. package/dist/cjs/src/tables/classes.js +467 -0
  22. package/dist/cjs/src/tables/classes.js.map +1 -0
  23. package/dist/cjs/src/tables/dynamicTemplate.js +71 -0
  24. package/dist/cjs/src/tables/dynamicTemplate.js.map +1 -0
  25. package/dist/cjs/src/tables/helper.js +171 -0
  26. package/dist/cjs/src/tables/helper.js.map +1 -0
  27. package/dist/cjs/src/tables/index.js +12 -0
  28. package/dist/cjs/src/tables/index.js.map +1 -0
  29. package/dist/cjs/src/tables/pdfRender.js +93 -0
  30. package/dist/cjs/src/tables/pdfRender.js.map +1 -0
  31. package/dist/cjs/src/tables/propPanel.js +88 -0
  32. package/dist/cjs/src/tables/propPanel.js.map +1 -0
  33. package/dist/cjs/src/tables/tableHelper.js +231 -0
  34. package/dist/cjs/src/tables/tableHelper.js.map +1 -0
  35. package/dist/cjs/src/tables/types.js +3 -0
  36. package/dist/cjs/src/tables/types.js.map +1 -0
  37. package/dist/cjs/src/tables/uiRender.js +342 -0
  38. package/dist/cjs/src/tables/uiRender.js.map +1 -0
  39. package/dist/cjs/src/text/helper.js +21 -6
  40. package/dist/cjs/src/text/helper.js.map +1 -1
  41. package/dist/cjs/src/text/index.js +1 -1
  42. package/dist/cjs/src/text/index.js.map +1 -1
  43. package/dist/cjs/src/text/pdfRender.js +6 -9
  44. package/dist/cjs/src/text/pdfRender.js.map +1 -1
  45. package/dist/cjs/src/text/propPanel.js +7 -4
  46. package/dist/cjs/src/text/propPanel.js.map +1 -1
  47. package/dist/cjs/src/text/uiRender.js +18 -17
  48. package/dist/cjs/src/text/uiRender.js.map +1 -1
  49. package/dist/cjs/src/utils.js +3 -1
  50. package/dist/cjs/src/utils.js.map +1 -1
  51. package/dist/esm/__tests__/text.test.js +5 -4
  52. package/dist/esm/__tests__/text.test.js.map +1 -1
  53. package/dist/esm/__tests__/utils.test.js +3 -0
  54. package/dist/esm/__tests__/utils.test.js.map +1 -1
  55. package/dist/esm/src/barcodes/propPanel.js +23 -11
  56. package/dist/esm/src/barcodes/propPanel.js.map +1 -1
  57. package/dist/esm/src/barcodes/uiRender.js +1 -1
  58. package/dist/esm/src/barcodes/uiRender.js.map +1 -1
  59. package/dist/esm/src/graphics/image.js +6 -9
  60. package/dist/esm/src/graphics/image.js.map +1 -1
  61. package/dist/esm/src/graphics/svg.js +4 -3
  62. package/dist/esm/src/graphics/svg.js.map +1 -1
  63. package/dist/esm/src/index.js +4 -1
  64. package/dist/esm/src/index.js.map +1 -1
  65. package/dist/esm/src/shapes/line.js +5 -8
  66. package/dist/esm/src/shapes/line.js.map +1 -1
  67. package/dist/esm/src/shapes/rectAndEllipse.js +12 -5
  68. package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -1
  69. package/dist/esm/src/tables/cell.js +120 -0
  70. package/dist/esm/src/tables/cell.js.map +1 -0
  71. package/dist/esm/src/tables/classes.js +460 -0
  72. package/dist/esm/src/tables/classes.js.map +1 -0
  73. package/dist/esm/src/tables/dynamicTemplate.js +66 -0
  74. package/dist/esm/src/tables/dynamicTemplate.js.map +1 -0
  75. package/dist/esm/src/tables/helper.js +163 -0
  76. package/dist/esm/src/tables/helper.js.map +1 -0
  77. package/dist/esm/src/tables/index.js +10 -0
  78. package/dist/esm/src/tables/index.js.map +1 -0
  79. package/dist/esm/src/tables/pdfRender.js +86 -0
  80. package/dist/esm/src/tables/pdfRender.js.map +1 -0
  81. package/dist/esm/src/tables/propPanel.js +85 -0
  82. package/dist/esm/src/tables/propPanel.js.map +1 -0
  83. package/dist/esm/src/tables/tableHelper.js +226 -0
  84. package/dist/esm/src/tables/tableHelper.js.map +1 -0
  85. package/dist/esm/src/tables/types.js +2 -0
  86. package/dist/esm/src/tables/types.js.map +1 -0
  87. package/dist/esm/src/tables/uiRender.js +335 -0
  88. package/dist/esm/src/tables/uiRender.js.map +1 -0
  89. package/dist/esm/src/text/helper.js +19 -5
  90. package/dist/esm/src/text/helper.js.map +1 -1
  91. package/dist/esm/src/text/index.js +1 -1
  92. package/dist/esm/src/text/index.js.map +1 -1
  93. package/dist/esm/src/text/pdfRender.js +7 -10
  94. package/dist/esm/src/text/pdfRender.js.map +1 -1
  95. package/dist/esm/src/text/propPanel.js +7 -4
  96. package/dist/esm/src/text/propPanel.js.map +1 -1
  97. package/dist/esm/src/text/uiRender.js +19 -18
  98. package/dist/esm/src/text/uiRender.js.map +1 -1
  99. package/dist/esm/src/utils.js +1 -0
  100. package/dist/esm/src/utils.js.map +1 -1
  101. package/dist/types/src/index.d.ts +3 -1
  102. package/dist/types/src/shapes/rectAndEllipse.d.ts +19 -27
  103. package/dist/types/src/tables/cell.d.ts +4 -0
  104. package/dist/types/src/tables/classes.d.ts +68 -0
  105. package/dist/types/src/tables/dynamicTemplate.d.ts +13 -0
  106. package/dist/types/src/tables/helper.d.ts +252 -0
  107. package/dist/types/src/tables/index.d.ts +4 -0
  108. package/dist/types/src/tables/pdfRender.d.ts +3 -0
  109. package/dist/types/src/tables/propPanel.d.ts +3 -0
  110. package/dist/types/src/tables/tableHelper.d.ts +11 -0
  111. package/dist/types/src/tables/types.d.ts +91 -0
  112. package/dist/types/src/tables/uiRender.d.ts +3 -0
  113. package/dist/types/src/text/helper.d.ts +8 -1
  114. package/dist/types/src/utils.d.ts +1 -0
  115. package/package.json +1 -1
  116. package/src/barcodes/propPanel.ts +26 -12
  117. package/src/barcodes/uiRender.ts +1 -1
  118. package/src/graphics/image.ts +8 -11
  119. package/src/graphics/svg.ts +4 -3
  120. package/src/index.ts +7 -0
  121. package/src/shapes/line.ts +4 -8
  122. package/src/shapes/rectAndEllipse.ts +16 -7
  123. package/src/tables/cell.ts +157 -0
  124. package/src/tables/classes.ts +398 -0
  125. package/src/tables/dynamicTemplate.ts +81 -0
  126. package/src/tables/helper.ts +198 -0
  127. package/src/tables/index.ts +12 -0
  128. package/src/tables/pdfRender.ts +113 -0
  129. package/src/tables/propPanel.ts +91 -0
  130. package/src/tables/tableHelper.ts +322 -0
  131. package/src/tables/types.ts +88 -0
  132. package/src/tables/uiRender.ts +393 -0
  133. package/src/text/helper.ts +29 -6
  134. package/src/text/index.ts +1 -1
  135. package/src/text/pdfRender.ts +9 -13
  136. package/src/text/propPanel.ts +7 -4
  137. package/src/text/uiRender.ts +18 -18
  138. package/src/utils.ts +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classes.js","sourceRoot":"","sources":["../../../../src/tables/classes.ts"],"names":[],"mappings":";;;AAAA,0CAAmD;AAEnD,2CAAoF;AAKpF,MAAa,IAAI;IAgBf,YAAY,GAAW,EAAE,MAAc,EAAE,OAAgB;QAfzD;;;;;WAAY;QACZ;;;;;WAAe;QACf;;;;;WAAe;QACf;;;;;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,CAAC,CAAC,CAAC;IAEvC,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDynamicHeightForTable = exports.modifyTemplateForTable = void 0;
4
+ const tableHelper_1 = require("./tableHelper");
5
+ const utils_1 = require("../utils");
6
+ const helper_js_1 = require("./helper.js");
7
+ const modifyTemplateForTable = async (arg) => {
8
+ const { template: t, input, options, _cache } = arg;
9
+ const template = Object.assign((0, utils_1.cloneDeep)(t), { schemas: [] });
10
+ let pageIndex = 0;
11
+ for (const schemaObj of t.schemas) {
12
+ const additionalSchemaObjs = [];
13
+ for (const [key, schema] of Object.entries(schemaObj)) {
14
+ if (schema.type === 'table') {
15
+ schema.__bodyRange = undefined;
16
+ const body = JSON.parse(input?.[key] || '[]');
17
+ const tables = await (0, tableHelper_1.createMultiTables)(body, {
18
+ schema,
19
+ basePdf: template.basePdf,
20
+ options,
21
+ _cache,
22
+ });
23
+ if (tables.length > 1) {
24
+ const firstTable = tables[0];
25
+ schema.__bodyRange = { start: 0, end: firstTable.body.length };
26
+ const allBodies = tables.map((table) => table.body);
27
+ const from2ndTable = tables.slice(1);
28
+ from2ndTable.forEach((table, i) => {
29
+ const additionalPageIndex = pageIndex + i + 1;
30
+ const additionalSchemaObj = {
31
+ [key]: {
32
+ ...schema,
33
+ position: { x: schema.position.x, y: table.settings.startY },
34
+ height: table.getHeight(),
35
+ showHead: false,
36
+ __bodyRange: {
37
+ start: allBodies.slice(0, i + 1).reduce((acc, cur) => acc + cur.length, 0),
38
+ end: allBodies.slice(0, i + 2).reduce((acc, cur) => acc + cur.length, 0),
39
+ },
40
+ content: input[key],
41
+ },
42
+ };
43
+ additionalSchemaObjs[additionalPageIndex] = additionalSchemaObj;
44
+ });
45
+ }
46
+ }
47
+ }
48
+ template.schemas.push(schemaObj);
49
+ additionalSchemaObjs.forEach((obj, index) => {
50
+ if (!template.schemas[index]) {
51
+ template.schemas[index] = obj;
52
+ }
53
+ else {
54
+ template.schemas[index] = { ...template.schemas[index], ...obj };
55
+ }
56
+ });
57
+ pageIndex++;
58
+ }
59
+ return template;
60
+ };
61
+ exports.modifyTemplateForTable = modifyTemplateForTable;
62
+ const getDynamicHeightForTable = async (value, args) => {
63
+ if (args.schema.type !== 'table')
64
+ return Promise.resolve(args.schema.height);
65
+ const schema = args.schema;
66
+ const body = schema.__bodyRange?.start === 0 ? (0, helper_js_1.getBody)(value) : (0, helper_js_1.getBodyWithRange)(value, schema.__bodyRange);
67
+ const table = await (0, tableHelper_1.createSingleTable)(body, args);
68
+ return table.getHeight();
69
+ };
70
+ exports.getDynamicHeightForTable = getDynamicHeightForTable;
71
+ //# sourceMappingURL=dynamicTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamicTemplate.js","sourceRoot":"","sources":["../../../../src/tables/dynamicTemplate.ts"],"names":[],"mappings":";;;AACA,+CAAqE;AACrE,oCAAqC;AACrC,2CAAwD;AAEjD,MAAM,sBAAsB,GAAG,KAAK,EAAE,GAK5C,EAAqB,EAAE;IACtB,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACpD,MAAM,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC,IAAA,iBAAS,EAAC,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,SAAS,IAAI,CAAC,CAAC,OAAO,EAAE;QACjC,MAAM,oBAAoB,GAAyB,EAAE,CAAC;QACtD,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACrD,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;gBAC3B,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC;gBAC/B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C,CAAC,CAAC,CAAC,IAAA,mBAAO,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,4BAAgB,EAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACjG,MAAM,KAAK,GAAG,MAAM,IAAA,+BAAiB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC;AAC3B,CAAC,CAAC;AAfW,QAAA,wBAAwB,4BAenC"}
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBodyWithRange = exports.getBody = exports.getColumnStylesPropPanelSchema = exports.getCellPropPanelSchema = exports.getDefaultCellStyles = void 0;
4
+ const constants_1 = require("../text/constants");
5
+ const constants_js_1 = require("../constants.js");
6
+ const getDefaultCellStyles = () => ({
7
+ fontName: undefined,
8
+ alignment: constants_1.DEFAULT_ALIGNMENT,
9
+ verticalAlignment: constants_1.VERTICAL_ALIGN_MIDDLE,
10
+ fontSize: constants_1.DEFAULT_FONT_SIZE,
11
+ lineHeight: constants_1.DEFAULT_LINE_HEIGHT,
12
+ characterSpacing: constants_1.DEFAULT_CHARACTER_SPACING,
13
+ fontColor: constants_1.DEFAULT_FONT_COLOR,
14
+ backgroundColor: '',
15
+ borderColor: '#888888',
16
+ borderWidth: { top: 0.1, bottom: 0.1, left: 0.1, right: 0.1 },
17
+ padding: { top: 5, bottom: 5, left: 5, right: 5 },
18
+ });
19
+ exports.getDefaultCellStyles = getDefaultCellStyles;
20
+ const getBoxDimensionProp = (step = 1) => {
21
+ const getCommonProp = () => ({
22
+ type: 'number',
23
+ widget: 'inputNumber',
24
+ props: { min: 0, step },
25
+ span: 6,
26
+ });
27
+ return {
28
+ top: { title: 'Top', ...getCommonProp() },
29
+ right: { title: 'Right', ...getCommonProp() },
30
+ bottom: { title: 'Bottom', ...getCommonProp() },
31
+ left: { title: 'Left', ...getCommonProp() },
32
+ };
33
+ };
34
+ const getCellPropPanelSchema = (arg) => {
35
+ const { i18n, fallbackFontName, fontNames, isBody } = arg;
36
+ return {
37
+ fontName: {
38
+ title: i18n('schemas.text.fontName'),
39
+ type: 'string',
40
+ widget: 'select',
41
+ default: fallbackFontName,
42
+ props: { options: fontNames.map((name) => ({ label: name, value: name })) },
43
+ span: 12,
44
+ },
45
+ fontSize: {
46
+ title: i18n('schemas.text.size'),
47
+ type: 'number',
48
+ widget: 'inputNumber',
49
+ props: { min: 0 },
50
+ span: 6,
51
+ },
52
+ characterSpacing: {
53
+ title: i18n('schemas.text.spacing'),
54
+ type: 'number',
55
+ widget: 'inputNumber',
56
+ props: { min: 0 },
57
+ span: 6,
58
+ },
59
+ alignment: {
60
+ title: i18n('schemas.text.textAlign'),
61
+ type: 'string',
62
+ widget: 'select',
63
+ props: {
64
+ options: [
65
+ { label: i18n('schemas.left'), value: constants_1.ALIGN_LEFT },
66
+ { label: i18n('schemas.center'), value: constants_1.ALIGN_CENTER },
67
+ { label: i18n('schemas.right'), value: constants_1.ALIGN_RIGHT },
68
+ ],
69
+ },
70
+ span: 8,
71
+ },
72
+ verticalAlignment: {
73
+ title: i18n('schemas.text.verticalAlign'),
74
+ type: 'string',
75
+ widget: 'select',
76
+ props: {
77
+ options: [
78
+ { label: i18n('schemas.top'), value: constants_1.VERTICAL_ALIGN_TOP },
79
+ { label: i18n('schemas.middle'), value: constants_1.VERTICAL_ALIGN_MIDDLE },
80
+ { label: i18n('schemas.bottom'), value: constants_1.VERTICAL_ALIGN_BOTTOM },
81
+ ],
82
+ },
83
+ span: 8,
84
+ },
85
+ lineHeight: {
86
+ title: i18n('schemas.text.lineHeight'),
87
+ type: 'number',
88
+ widget: 'inputNumber',
89
+ props: { step: 0.1, min: 0 },
90
+ span: 8,
91
+ },
92
+ fontColor: {
93
+ title: i18n('schemas.textColor'),
94
+ type: 'string',
95
+ widget: 'color',
96
+ rules: [{ pattern: constants_js_1.HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
97
+ },
98
+ borderColor: {
99
+ title: i18n('schemas.borderColor'),
100
+ type: 'string',
101
+ widget: 'color',
102
+ rules: [{ pattern: constants_js_1.HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
103
+ },
104
+ backgroundColor: {
105
+ title: i18n('schemas.backgroundColor'),
106
+ type: 'string',
107
+ widget: 'color',
108
+ rules: [{ pattern: constants_js_1.HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
109
+ },
110
+ ...(isBody
111
+ ? {
112
+ alternateBackgroundColor: {
113
+ title: i18n('schemas.table.alternateBackgroundColor'),
114
+ type: 'string',
115
+ widget: 'color',
116
+ rules: [{ pattern: constants_js_1.HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
117
+ },
118
+ }
119
+ : {}),
120
+ '-': { type: 'void', widget: 'Divider' },
121
+ borderWidth: {
122
+ title: i18n('schemas.borderWidth'),
123
+ type: 'object',
124
+ widget: 'lineTitle',
125
+ span: 24,
126
+ properties: getBoxDimensionProp(0.1),
127
+ },
128
+ '--': { type: 'void', widget: 'Divider' },
129
+ padding: {
130
+ title: i18n('schemas.padding'),
131
+ type: 'object',
132
+ widget: 'lineTitle',
133
+ span: 24,
134
+ properties: getBoxDimensionProp(),
135
+ },
136
+ };
137
+ };
138
+ exports.getCellPropPanelSchema = getCellPropPanelSchema;
139
+ const getColumnStylesPropPanelSchema = ({ head, i18n, }) => ({
140
+ alignment: {
141
+ type: 'object',
142
+ widget: 'lineTitle',
143
+ title: i18n('schemas.text.textAlign'),
144
+ column: 3,
145
+ properties: head.reduce((acc, cur, i) => Object.assign(acc, {
146
+ [i]: {
147
+ title: cur || 'Column ' + String(i + 1),
148
+ type: 'string',
149
+ widget: 'select',
150
+ props: {
151
+ options: [
152
+ { label: i18n('schemas.left'), value: constants_1.ALIGN_LEFT },
153
+ { label: i18n('schemas.center'), value: constants_1.ALIGN_CENTER },
154
+ { label: i18n('schemas.right'), value: constants_1.ALIGN_RIGHT },
155
+ ],
156
+ },
157
+ },
158
+ }), {}),
159
+ },
160
+ });
161
+ exports.getColumnStylesPropPanelSchema = getColumnStylesPropPanelSchema;
162
+ const getBody = (value) => JSON.parse(value || '[]');
163
+ exports.getBody = getBody;
164
+ const getBodyWithRange = (value, range) => {
165
+ const body = (0, exports.getBody)(value);
166
+ if (!range)
167
+ return body;
168
+ return body.slice(range.start, range.end);
169
+ };
170
+ exports.getBodyWithRange = getBodyWithRange;
171
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../src/tables/helper.ts"],"names":[],"mappings":";;;AAAA,iDAY2B;AAC3B,kDAAoD;AAE7C,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CAAC;IACzC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,6BAAiB;IAC5B,iBAAiB,EAAE,iCAAqB;IACxC,QAAQ,EAAE,6BAAiB;IAC3B,UAAU,EAAE,+BAAmB;IAC/B,gBAAgB,EAAE,qCAAyB;IAC3C,SAAS,EAAE,8BAAkB;IAC7B,eAAe,EAAE,EAAE;IACnB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;IAC7D,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;CAClD,CAAC,CAAC;AAZU,QAAA,oBAAoB,wBAY9B;AAEH,MAAM,mBAAmB,GAAG,CAAC,IAAI,GAAG,CAAC,EAAE,EAAE;IACvC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC;QAC3B,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE;QACvB,IA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AI,GAAG,IAAA,eAAO,EAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pdfRender_js_1 = require("./pdfRender.js");
4
+ const uiRender_js_1 = require("./uiRender.js");
5
+ const propPanel_js_1 = require("./propPanel.js");
6
+ const tableSchema = {
7
+ pdf: pdfRender_js_1.pdfRender,
8
+ ui: uiRender_js_1.uiRender,
9
+ propPanel: propPanel_js_1.propPanel,
10
+ };
11
+ exports.default = tableSchema;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tables/index.ts"],"names":[],"mappings":";;AAEA,iDAA2C;AAC3C,+CAAyC;AACzC,iDAA2C;AAE3C,MAAM,WAAW,GAAwB;IACvC,GAAG,EAAE,wBAAS;IACd,EAAE,EAAE,sBAAQ;IACZ,SAAS,EAAT,wBAAS;CACV,CAAC;AACF,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.pdfRender = void 0;
7
+ const rectAndEllipse_1 = require("../shapes/rectAndEllipse");
8
+ const cell_1 = __importDefault(require("./cell"));
9
+ const helper_1 = require("./helper");
10
+ const tableHelper_1 = require("./tableHelper");
11
+ const rectanglePdfRender = rectAndEllipse_1.rectangle.pdf;
12
+ const cellPdfRender = cell_1.default.pdf;
13
+ async function drawCell(arg, cell) {
14
+ await cellPdfRender({
15
+ ...arg,
16
+ value: cell.raw,
17
+ schema: {
18
+ type: 'cell',
19
+ position: { x: cell.x, y: cell.y },
20
+ width: cell.width,
21
+ height: cell.height,
22
+ fontName: cell.styles.fontName,
23
+ alignment: cell.styles.alignment,
24
+ verticalAlignment: cell.styles.verticalAlignment,
25
+ fontSize: cell.styles.fontSize,
26
+ lineHeight: cell.styles.lineHeight,
27
+ characterSpacing: cell.styles.characterSpacing,
28
+ backgroundColor: cell.styles.backgroundColor,
29
+ fontColor: cell.styles.textColor,
30
+ borderColor: cell.styles.lineColor,
31
+ borderWidth: cell.styles.lineWidth,
32
+ padding: cell.styles.cellPadding,
33
+ },
34
+ });
35
+ }
36
+ async function drawRow(arg, table, row, cursor, columns) {
37
+ cursor.x = table.settings.margin.left;
38
+ for (const column of columns) {
39
+ const cell = row.cells[column.index];
40
+ if (!cell) {
41
+ cursor.x += column.width;
42
+ continue;
43
+ }
44
+ cell.x = cursor.x;
45
+ cell.y = cursor.y;
46
+ await drawCell(arg, cell);
47
+ cursor.x += column.width;
48
+ }
49
+ cursor.y += row.height;
50
+ }
51
+ async function drawTableBorder(arg, table, startPos, cursor) {
52
+ const lineWidth = table.settings.tableLineWidth;
53
+ const lineColor = table.settings.tableLineColor;
54
+ if (!lineWidth || !lineColor)
55
+ return;
56
+ await rectanglePdfRender({
57
+ ...arg,
58
+ schema: {
59
+ type: 'rectangle',
60
+ borderWidth: lineWidth,
61
+ borderColor: lineColor,
62
+ color: '',
63
+ position: { x: startPos.x, y: startPos.y },
64
+ width: table.getWidth(),
65
+ height: cursor.y - startPos.y,
66
+ readOnly: true,
67
+ },
68
+ });
69
+ }
70
+ async function drawTable(arg, table) {
71
+ const settings = table.settings;
72
+ const startY = settings.startY;
73
+ const margin = settings.margin;
74
+ const cursor = { x: margin.left, y: startY };
75
+ const startPos = Object.assign({}, cursor);
76
+ if (settings.showHead) {
77
+ for (const row of table.head) {
78
+ await drawRow(arg, table, row, cursor, table.columns);
79
+ }
80
+ }
81
+ for (const row of table.body) {
82
+ await drawRow(arg, table, row, cursor, table.columns);
83
+ }
84
+ await drawTableBorder(arg, table, startPos, cursor);
85
+ }
86
+ const pdfRender = async (arg) => {
87
+ const { value, schema } = arg;
88
+ const body = (0, helper_1.getBodyWithRange)(value, schema.__bodyRange);
89
+ const table = await (0, tableHelper_1.createSingleTable)(body, arg);
90
+ await drawTable(arg, table);
91
+ };
92
+ exports.pdfRender = pdfRender;
93
+ //# sourceMappingURL=pdfRender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdfRender.js","sourceRoot":"","sources":["../../../../src/tables/pdfRender.ts"],"names":[],"mappings":";;;;;;AAGA,6DAAqD;AACrD,kDAA0B;AAC1B,qCAA4C;AAC5C,+CAAkD;AAIlD,MAAM,kBAAkB,GAAG,0BAAS,CAAC,GAAG,CAAC;AACzC,MAAM,aAAa,GAAG,cAAI,CAAC,GAAG,CAAC;AAE/B,KAAK,UAAU,QAAQ,CAAC,GAAgC,EAAE,IAAU;IAClE,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,MAAM,CAAC,SAAS;YAChC,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB;YAChD,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC9B,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU;YAClC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB;YAC9C,eAAe,EAAE,IAAI,CAAC,MAA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gC,EAAE,EAAE;IAClE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAA,yBAAgB,EAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,MAAM,IAAA,+BAAiB,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjD,MAAM,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC,CAAC;AALW,QAAA,SAAS,aAKpB"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.propPanel = void 0;
4
+ const common_1 = require("@pdfme/common");
5
+ const helper_js_1 = require("./helper.js");
6
+ const constants_js_1 = require("../constants.js");
7
+ exports.propPanel = {
8
+ schema: ({ activeSchema, options, i18n }) => {
9
+ // @ts-ignore
10
+ const head = (activeSchema.head || []);
11
+ const font = options.font || { [common_1.DEFAULT_FONT_NAME]: { data: '', fallback: true } };
12
+ const fontNames = Object.keys(font);
13
+ const fallbackFontName = (0, common_1.getFallbackFontName)(font);
14
+ return {
15
+ tableStyles: {
16
+ title: i18n('schemas.table.tableStyle'),
17
+ type: 'object',
18
+ widget: 'Card',
19
+ span: 24,
20
+ properties: {
21
+ borderWidth: {
22
+ title: i18n('schemas.borderWidth'),
23
+ type: 'number',
24
+ widget: 'inputNumber',
25
+ props: { min: 0, step: 0.1 },
26
+ step: 1,
27
+ },
28
+ borderColor: {
29
+ title: i18n('schemas.borderColor'),
30
+ type: 'string',
31
+ widget: 'color',
32
+ rules: [{ pattern: constants_js_1.HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
33
+ },
34
+ },
35
+ },
36
+ headStyles: {
37
+ title: i18n('schemas.table.headStyle'),
38
+ type: 'object',
39
+ widget: 'Card',
40
+ span: 24,
41
+ properties: (0, helper_js_1.getCellPropPanelSchema)({ i18n, fallbackFontName, fontNames }),
42
+ },
43
+ bodyStyles: {
44
+ title: i18n('schemas.table.bodyStyle'),
45
+ type: 'object',
46
+ widget: 'Card',
47
+ span: 24,
48
+ properties: (0, helper_js_1.getCellPropPanelSchema)({ i18n, fallbackFontName, fontNames, isBody: true }),
49
+ },
50
+ columnStyles: {
51
+ title: i18n('schemas.table.columnStyle'),
52
+ type: 'object',
53
+ widget: 'Card',
54
+ span: 24,
55
+ properties: (0, helper_js_1.getColumnStylesPropPanelSchema)({ head, i18n }),
56
+ },
57
+ };
58
+ },
59
+ defaultSchema: {
60
+ type: 'table',
61
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table"><path d="M12 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/></svg>',
62
+ position: { x: 0, y: 0 },
63
+ width: 150,
64
+ height: 20,
65
+ content: JSON.stringify([
66
+ ['Alice', 'New York', 'Alice is a freelance web designer and developer'],
67
+ ['Bob', 'Paris', 'Bob is a freelance illustrator and graphic designer'],
68
+ ]),
69
+ showHead: true,
70
+ head: ['Name', 'City', 'Description'],
71
+ headWidthPercentages: [30, 30, 40],
72
+ tableStyles: {
73
+ borderColor: '#000000',
74
+ borderWidth: 0.3,
75
+ },
76
+ headStyles: Object.assign((0, helper_js_1.getDefaultCellStyles)(), {
77
+ fontColor: '#ffffff',
78
+ backgroundColor: '#2980ba',
79
+ borderColor: '',
80
+ borderWidth: { top: 0, right: 0, bottom: 0, left: 0 },
81
+ }),
82
+ bodyStyles: Object.assign((0, helper_js_1.getDefaultCellStyles)(), {
83
+ alternateBackgroundColor: '#f5f5f5',
84
+ }),
85
+ columnStyles: {},
86
+ },
87
+ };
88
+ //# sourceMappingURL=propPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/tables/propPanel.ts"],"names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