From 9d4b76e17bdda1f0d463bec5c51c5797a347131b Mon Sep 17 00:00:00 2001 From: Rafin Akther Utsahw Date: Mon, 29 Apr 2024 23:50:02 +0300 Subject: [PATCH] Cleaup --- src/core/structure/sheet.ts | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/core/structure/sheet.ts b/src/core/structure/sheet.ts index 644741dc..1fe7bb46 100644 --- a/src/core/structure/sheet.ts +++ b/src/core/structure/sheet.ts @@ -519,7 +519,7 @@ export default class Sheet { this.emitSetStyleEvent( columnIndex, rowIndex, - GenerateStyleStringFromMap(this.getMergedCellStyle(columnKey).css), + (this.getMergedCellStyle(columnKey).css), ); return; } @@ -536,9 +536,7 @@ export default class Sheet { this.emitSetStyleEvent( columnIndex, rowIndex, - GenerateStyleStringFromMap( - this.getMergedCellStyle(columnKey, rowKey).css, - ), + this.getMergedCellStyle(columnKey, rowKey).css, ); } @@ -563,11 +561,10 @@ export default class Sheet { this.emitSetStyleEvent( isColumnGroup ? groupIndex : null, !isColumnGroup ? groupIndex : null, - GenerateStyleStringFromMap( - isColumnGroup - ? this.getMergedCellStyle(groupKey as ColumnKey).css - : this.getMergedCellStyle(null, groupKey as RowKey).css, - ), + isColumnGroup + ? this.getMergedCellStyle(groupKey as ColumnKey).css + : this.getMergedCellStyle(null, groupKey as RowKey).css, + ); return; } @@ -577,11 +574,10 @@ export default class Sheet { this.emitSetStyleEvent( isColumnGroup ? groupIndex : null, !isColumnGroup ? groupIndex : null, - GenerateStyleStringFromMap( - isColumnGroup - ? this.getMergedCellStyle(groupKey as ColumnKey).css - : this.getMergedCellStyle(null, groupKey as RowKey).css, - ), + isColumnGroup + ? this.getMergedCellStyle(groupKey as ColumnKey).css + : this.getMergedCellStyle(null, groupKey as RowKey).css, + ); } @@ -961,14 +957,14 @@ export default class Sheet { private emitSetStyleEvent( columnIndex: number | null, rowIndex: number | null, - value: string, + css: Map, ) { const payload: CoreSetStylePayload = { indexPosition: { rowIndex, columnIndex, }, - value, + value: GenerateStyleStringFromMap(css), }; this.events.emit(new LightsheetEvent(EventType.VIEW_SET_STYLE, payload));