Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: customize row header #2457

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
feat: customize row header
  • Loading branch information
Евгений Крютченко committed Jun 19, 2024
commit cf7be61c69f92b1892bf2bbf930812bed7aca307
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import type { IScale } from '@univerjs/core';
import { numberToABC } from '@univerjs/core';

import { DEFAULT_FONTFACE_PLANE, FIX_ONE_PIXEL_BLUR_OFFSET, MIDDLE_CELL_POS_MAGIC_NUMBER } from '../../../basics/const';
import { getColor } from '../../../basics/tools';
Expand Down Expand Up @@ -80,7 +79,7 @@ export class RowHeaderLayout extends SheetExtension {
curRowSpecCfg = rowsCfg[rowIndex] as IRowStyleCfg & { text: string };
mergeWithSpecCfg = { ...this.headerStyle, ...curRowSpecCfg };
} else {
mergeWithSpecCfg = { ...this.headerStyle, text: numberToABC(rowIndex) };
mergeWithSpecCfg = { ...this.headerStyle, text: `${rowIndex + 1}` };
}
const specStyle = Object.keys(curRowSpecCfg || {}).length > 1; // if cfg have more keys than 'text', means there would be special style config for this row.
return [mergeWithSpecCfg, specStyle] as [IARowCfgObj, boolean];
Expand Down