gemcap-be-common 1.5.69 → 1.5.70

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.
@@ -22,12 +22,7 @@ export interface IExcelJsCell {
22
22
  t?: string;
23
23
  z?: string;
24
24
  hyperlink?: string;
25
- s?: {
26
- font?: Partial<ExcelJS.Font>;
27
- alignment?: Partial<ExcelJS.Alignment>;
28
- fill?: Partial<ExcelJS.FillPattern>;
29
- border?: Partial<ExcelJS.Borders>;
30
- };
25
+ s?: Partial<ExcelJS.Style>;
31
26
  }
32
27
  export declare const cellStyles: {
33
28
  title: {
@@ -199,11 +199,16 @@ const convertDataToFileWithStyle = async (dataToConvert, options) => {
199
199
  };
200
200
  }
201
201
  if (cell.s.fill) {
202
- excelCell.fill = {
203
- type: 'pattern',
204
- pattern: 'solid',
205
- ...cell.s.fill,
206
- };
202
+ if (cell.s.fill.type === 'pattern') {
203
+ excelCell.fill = {
204
+ type: 'pattern',
205
+ pattern: cell.s.fill.pattern ?? 'solid',
206
+ ...cell.s.fill,
207
+ };
208
+ }
209
+ else {
210
+ excelCell.fill = cell.s.fill;
211
+ }
207
212
  }
208
213
  if (cell.s.border) {
209
214
  excelCell.border = cell.s.border;
@@ -26,12 +26,13 @@ export interface IExcelJsCell {
26
26
  t?: string;
27
27
  z?: string;
28
28
  hyperlink?: string;
29
- s?: {
30
- font?: Partial<ExcelJS.Font>;
31
- alignment?: Partial<ExcelJS.Alignment>;
32
- fill?: Partial<ExcelJS.FillPattern>;
33
- border?: Partial<ExcelJS.Borders>;
34
- };
29
+ // s?: {
30
+ // font?: Partial<ExcelJS.Font>;
31
+ // alignment?: Partial<ExcelJS.Alignment>;
32
+ // fill?: Partial<ExcelJS.FillPattern>;
33
+ // border?: Partial<ExcelJS.Borders>;
34
+ // };
35
+ s?: Partial<ExcelJS.Style>;
35
36
  }
36
37
 
37
38
  export const cellStyles = {
@@ -234,11 +235,15 @@ export const convertDataToFileWithStyle = async (
234
235
  };
235
236
  }
236
237
  if (cell.s.fill) {
237
- excelCell.fill = {
238
- type: 'pattern',
239
- pattern: 'solid',
240
- ...cell.s.fill,
241
- };
238
+ if (cell.s.fill.type === 'pattern') {
239
+ excelCell.fill = {
240
+ type: 'pattern',
241
+ pattern: cell.s.fill.pattern ?? 'solid',
242
+ ...cell.s.fill,
243
+ };
244
+ } else {
245
+ excelCell.fill = cell.s.fill;
246
+ }
242
247
  }
243
248
  if (cell.s.border) {
244
249
  excelCell.border = cell.s.border;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.69",
3
+ "version": "1.5.70",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {