Skip to content

Commit

Permalink
Cleaup
Browse files Browse the repository at this point in the history
  • Loading branch information
rafinutshaw committed Apr 29, 2024
1 parent 5347dba commit 9d4b76e
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/core/structure/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export default class Sheet {
this.emitSetStyleEvent(
columnIndex,
rowIndex,
GenerateStyleStringFromMap(this.getMergedCellStyle(columnKey).css),
(this.getMergedCellStyle(columnKey).css),
);
return;
}
Expand All @@ -536,9 +536,7 @@ export default class Sheet {
this.emitSetStyleEvent(
columnIndex,
rowIndex,
GenerateStyleStringFromMap(
this.getMergedCellStyle(columnKey, rowKey).css,
),
this.getMergedCellStyle(columnKey, rowKey).css,
);
}

Expand All @@ -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;
}
Expand All @@ -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,

);
}

Expand Down Expand Up @@ -961,14 +957,14 @@ export default class Sheet {
private emitSetStyleEvent(
columnIndex: number | null,
rowIndex: number | null,
value: string,
css: Map<string, string>,
) {
const payload: CoreSetStylePayload = {
indexPosition: {
rowIndex,
columnIndex,
},
value,
value: GenerateStyleStringFromMap(css),
};

this.events.emit(new LightsheetEvent(EventType.VIEW_SET_STYLE, payload));
Expand Down

0 comments on commit 9d4b76e

Please sign in to comment.