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(sheet): styles on rows and columns #3816

Merged
merged 10 commits into from
Oct 22, 2024
Merged

feat(sheet): styles on rows and columns #3816

merged 10 commits into from
Oct 22, 2024

Conversation

VicKun4937
Copy link
Contributor

@VicKun4937 VicKun4937 commented Oct 21, 2024

document Pull request: https://github.com/dream-num/univer.ai/pull/332

  • support default style in work sheet
    facade API:
const fwb = univerAPI.getActiveWorkbook()
const fws = fwb.getActiveSheet()
// set default style
fws.setDefaultStyle('uJSelZ')
// set default column style
fws.setColumnDefaultStyle(3,'uJSelZ')
fws.setColumnDefaultStyle(3,{bg:{rgb:'red'}})
// reset the column default style
fws.setColumnDefaultStyle(3,undefined)

// set row default style
fws.setRowDefaultStyle(1,'uJSelZ')

Using in workbook Data:

 interface IWorksheetData{
    // other
    /**
     * @property {string|Nullable<IStyleData>} [defaultStyle] - Default style id or style data of Worksheet.
     */
    defaultStyle?: Nullable<IStyleData> | string;

}

interface IRowData{
    // other
    /**
     * style id
     */
    s?: Nullable<IStyleData | string>;
}

interface IColumnData{
     // other
     /**
     * style id
     */
    s?: Nullable<IStyleData | string>;
}

@VicKun4937 VicKun4937 changed the title feat(default): feat style feat(sheet): feat style Oct 21, 2024
Copy link

github-actions bot commented Oct 21, 2024

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

Copy link

github-actions bot commented Oct 21, 2024

Playwright test results

passed  18 passed

Details

stats  18 tests across 8 suites
duration  4 minutes, 23 seconds
commit  c5d9c12
info  For more information, see full report

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 21.05263% with 135 lines in your changes missing coverage. Please review.

Project coverage is 31.89%. Comparing base (192da79) to head (c5d9c12).
Report is 9 commits behind head on dev.

Files with missing lines Patch % Lines
packages/core/src/sheets/worksheet.ts 0.00% 31 Missing ⚠️
packages/facade/src/apis/sheets/f-worksheet.ts 0.00% 24 Missing ⚠️
...tations/set-worksheet-row-column-style.mutation.ts 0.00% 24 Missing ⚠️
...mutations/set-worksheet-default-style.mutations.ts 0.00% 17 Missing ⚠️
packages/core/src/shared/tools.ts 67.34% 16 Missing ⚠️
...ine-render/src/components/sheets/sheet-skeleton.ts 0.00% 9 Missing ⚠️
packages/core/src/sheets/column-manager.ts 0.00% 5 Missing ⚠️
packages/core/src/sheets/row-manager.ts 0.00% 5 Missing ⚠️
packages/sheets/src/sheets-plugin.ts 0.00% 2 Missing ⚠️
...s/src/views/render/adaptors/spreadsheet-adaptor.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3816      +/-   ##
==========================================
- Coverage   32.06%   31.89%   -0.18%     
==========================================
  Files        2322     2341      +19     
  Lines      120245   120980     +735     
  Branches    26608    26774     +166     
==========================================
+ Hits        38562    38588      +26     
- Misses      81683    82392     +709     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VicKun4937 VicKun4937 changed the title feat(sheet): feat style feat(sheet): feat sheet default style Oct 22, 2024
Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, though some code readability issues need to addressed.

@wzhudev wzhudev changed the title feat(sheet): feat sheet default style feat(sheet): styles on rows and columns Oct 22, 2024
@VicKun4937 VicKun4937 requested a review from Jocs as a code owner October 22, 2024 06:07
Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@VicKun4937 VicKun4937 merged commit 8a27b31 into dev Oct 22, 2024
9 checks passed
@VicKun4937 VicKun4937 deleted the feat-default-styles branch October 22, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants