shareneus 1.5.90 → 1.5.91

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.
@@ -3,4 +3,6 @@ export declare const pdfTableStyleConfig: {
3
3
  bodyFontSize: number;
4
4
  stackFieldFontSize: number;
5
5
  headerBgColor: string;
6
+ headerFontColor: string;
7
+ bodyFontColor: string;
6
8
  };
@@ -5,5 +5,7 @@ exports.pdfTableStyleConfig = {
5
5
  headerFontSize: 10,
6
6
  bodyFontSize: 9,
7
7
  stackFieldFontSize: 8,
8
- headerBgColor: '#eeeeee'
8
+ headerBgColor: '#eeeeee',
9
+ headerFontColor: '#111827',
10
+ bodyFontColor: '#111827'
9
11
  };
@@ -169,6 +169,7 @@ function getHeaderCellStyle() {
169
169
  return {
170
170
  bold: true,
171
171
  fontSize: pdf_table_config_1.pdfTableStyleConfig.headerFontSize,
172
- fillColor: pdf_table_config_1.pdfTableStyleConfig.headerBgColor
172
+ fillColor: pdf_table_config_1.pdfTableStyleConfig.headerBgColor,
173
+ color: pdf_table_config_1.pdfTableStyleConfig.headerFontColor
173
174
  };
174
175
  }
@@ -1,12 +1,14 @@
1
1
  export declare function buildDataRow(item: any, index: number, headerConfig: any[], fixedTo?: number): ({
2
2
  text: string;
3
3
  fontSize: number;
4
+ color: string;
4
5
  alignment: string;
5
6
  stack?: undefined;
6
7
  } | {
7
8
  stack: any[];
8
9
  text?: undefined;
9
10
  fontSize?: undefined;
11
+ color?: undefined;
10
12
  alignment?: undefined;
11
13
  })[];
12
14
  export declare function getFirstFieldValue(item: any, dbFields?: string[]): string;
@@ -12,12 +12,12 @@ function buildDataRow(item, index, headerConfig, fixedTo = 2) {
12
12
  if (column.type === 'tax') {
13
13
  const taxValue = getTaxValue(item, column.dbField, column.taxKind);
14
14
  const renderedTaxValue = formatNumericLikeValue(taxValue, fixedTo);
15
- return { text: renderedTaxValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: getNumericAlignment(renderedTaxValue) };
15
+ return { text: renderedTaxValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: getNumericAlignment(renderedTaxValue) };
16
16
  }
17
17
  const header = column.header;
18
18
  if (header.text === 'S.No') {
19
19
  const serial = String(index + 1);
20
- return { text: serial, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: getNumericAlignment(serial) };
20
+ return { text: serial, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: getNumericAlignment(serial) };
21
21
  }
22
22
  const mainValue = formatFieldValue(item, header, fixedTo);
23
23
  const stackedLines = ((_a = header.stackFields) !== null && _a !== void 0 ? _a : [])
@@ -26,19 +26,20 @@ function buildDataRow(item, index, headerConfig, fixedTo = 2) {
26
26
  if (!stackValue) {
27
27
  return null;
28
28
  }
29
- return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, italics: true };
29
+ return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, italics: true };
30
30
  })
31
31
  .filter((line) => !!line);
32
32
  if (stackedLines.length === 0) {
33
33
  return {
34
34
  text: mainValue,
35
35
  fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
36
+ color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor,
36
37
  alignment: getCellAlignment(header.text, mainValue)
37
38
  };
38
39
  }
39
40
  return {
40
41
  stack: [
41
- { text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize },
42
+ { text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor },
42
43
  ...stackedLines
43
44
  ]
44
45
  };
@@ -144,9 +144,9 @@ function buildSectionLabelRow(columnCount, descriptionColumnIndex, label) {
144
144
  const normalizedDescriptionIndex = descriptionColumnIndex >= 0 ? descriptionColumnIndex : 0;
145
145
  return Array.from({ length: columnCount }, (_, index) => {
146
146
  if (index === normalizedDescriptionIndex) {
147
- return { text: label, bold: true, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize };
147
+ return { text: label, bold: true, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor };
148
148
  }
149
- return { text: '', fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize };
149
+ return { text: '', fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor };
150
150
  });
151
151
  }
152
152
  function getDescriptionColumnIndexFromColumns(columns) {
@@ -162,29 +162,29 @@ function buildFallbackDataRow(item, index, fallbackHeaderRow, fixedTo) {
162
162
  if (header.taxKind === 'rate') {
163
163
  const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['CGSTPerc']);
164
164
  const renderedValue = formatNumericLikeValue(value, fixedTo);
165
- return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
165
+ return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
166
166
  }
167
167
  else if (header.taxKind === 'amount') {
168
168
  const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['CGSTAmt']);
169
169
  const renderedValue = formatNumericLikeValue(value, fixedTo);
170
- return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
170
+ return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
171
171
  }
172
172
  }
173
173
  if (header.text === 'SGST') {
174
174
  if (header.taxKind === 'rate') {
175
175
  const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['SGSTPerc']);
176
176
  const renderedValue = formatNumericLikeValue(value, fixedTo);
177
- return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
177
+ return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
178
178
  }
179
179
  else if (header.taxKind === 'amount') {
180
180
  const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['SGSTAmt']);
181
181
  const renderedValue = formatNumericLikeValue(value, fixedTo);
182
- return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
182
+ return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
183
183
  }
184
184
  }
185
185
  if (header.text === 'S.No') {
186
186
  const value = String(index + 1);
187
- return { text: value, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(value) };
187
+ return { text: value, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(value) };
188
188
  }
189
189
  const mainValue = formatNumericLikeValue((0, pdf_table_row_1.getFirstFieldValue)(item, header.dbFields), fixedTo);
190
190
  const stackedLines = ((_a = header.stackFields) !== null && _a !== void 0 ? _a : [])
@@ -193,19 +193,20 @@ function buildFallbackDataRow(item, index, fallbackHeaderRow, fixedTo) {
193
193
  if (!stackValue) {
194
194
  return null;
195
195
  }
196
- return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, italics: true };
196
+ return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, italics: true };
197
197
  })
198
198
  .filter((line) => !!line);
199
199
  if (stackedLines.length === 0) {
200
200
  return {
201
201
  text: mainValue,
202
202
  fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
203
+ color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor,
203
204
  alignment: (0, pdf_table_row_1.getCellAlignment)(header.text, mainValue)
204
205
  };
205
206
  }
206
207
  return {
207
208
  stack: [
208
- { text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize },
209
+ { text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor },
209
210
  ...stackedLines
210
211
  ]
211
212
  };
@@ -272,7 +273,8 @@ function buildTotalLabelCell(text) {
272
273
  return {
273
274
  text,
274
275
  bold: true,
275
- fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize
276
+ fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
277
+ color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor
276
278
  };
277
279
  }
278
280
  function buildTotalValueCell(text, headerText = '') {
@@ -280,6 +282,7 @@ function buildTotalValueCell(text, headerText = '') {
280
282
  text,
281
283
  bold: true,
282
284
  fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
285
+ color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor,
283
286
  alignment: headerText ? (0, pdf_table_row_1.getCellAlignment)(headerText, text) : (0, pdf_table_row_1.getNumericAlignment)(text)
284
287
  };
285
288
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.90",
3
+ "version": "1.5.91",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",