-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat(UniverSheet): add LoadingText parameter #901
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
Changes from all commits
b166620
37742ee
4d73f29
46e9185
2514d5f
24f6b30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,4 +2,9 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @inherits BootstrapModuleComponentBase | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.js", JSObjectReference = true)] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div @attributes="@AdditionalAttributes" class="@ClassString" id="@Id"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div @attributes="@AdditionalAttributes" class="@ClassString" id="@Id" style="position: relative; overflow: hidden;"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="bb-univer-sheet-wrap" style="height: 100%;"></div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="bb-univer-sheet-backdrop" style="background-color: #000; opacity: 0.3; position: absolute; inset: 0; z-index: 1205; display: flex; align-items: center; justify-content: center;"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="bb-univer-sheet-backdrop" style="background-color: #000; opacity: 0.3; position: absolute; inset: 0; z-index: 1205; display: flex; align-items: center; justify-content: center;"> | |
| <div class="bb-univer-sheet-backdrop" role="status" aria-live="polite" style="background-color: #000; opacity: 0.3; position: absolute; inset: 0; z-index: 1205; display: flex; align-items: center; justify-content: center;"> |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline styles should be extracted to a CSS class for better maintainability. The backdrop styling on line 7 and the wrapper on line 6 contain multiple inline styles that would be better managed in a stylesheet.
| <div @attributes="@AdditionalAttributes" class="@ClassString" id="@Id" style="position: relative; overflow: hidden;"> | |
| <div class="bb-univer-sheet-wrap" style="height: 100%;"></div> | |
| <div class="bb-univer-sheet-backdrop" style="background-color: #000; opacity: 0.3; position: absolute; inset: 0; z-index: 1205; display: flex; align-items: center; justify-content: center;"> | |
| <div style="color: #fff;">@LoadingText</div> | |
| </div> | |
| </div> | |
| <div @attributes="@AdditionalAttributes" class="@ClassString bb-univer-sheet-root" id="@Id"> | |
| <div class="bb-univer-sheet-wrap bb-univer-sheet-wrap-fullheight"></div> | |
| <div class="bb-univer-sheet-backdrop bb-univer-sheet-backdrop-style"> | |
| <div class="bb-univer-sheet-loading-text">@LoadingText</div> | |
| </div> | |
| </div> | |
| <style> | |
| .bb-univer-sheet-root { | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .bb-univer-sheet-wrap-fullheight { | |
| height: 100%; | |
| } | |
| .bb-univer-sheet-backdrop-style { | |
| background-color: #000; | |
| opacity: 0.3; | |
| position: absolute; | |
| inset: 0; | |
| z-index: 1205; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| } | |
| .bb-univer-sheet-loading-text { | |
| color: #fff; | |
| } | |
| </style> |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |||||||
| // Website: https://www.blazor.zone or https://argozhang.github.io/ | ||||||||
|
|
||||||||
| using Microsoft.AspNetCore.Components; | ||||||||
| using Microsoft.Extensions.Localization; | ||||||||
|
||||||||
| using Microsoft.Extensions.Localization; | |
| using Microsoft.Extensions.Localization; | |
| using System.Diagnostics.CodeAnalysis; |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The XML documentation comment is in Chinese. The comment states "获得/设置 正在加载显示文本 默认 null 未设置读取资源文件" which appears to be missing punctuation and spacing. It should read: "获得/设置 正在加载显示文本 默认 null 未设置,读取资源文件" with a comma added before "读取资源文件" for proper grammar.
| /// 获得/设置 正在加载显示文本 默认 null 未设置读取资源文件 | |
| /// 获得/设置 正在加载显示文本 默认 null 未设置,读取资源文件 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "BootstrapBlazor.Components.UniverSheet": { | ||
| "LoadingText": "Loading ..." | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "BootstrapBlazor.Components.UniverSheet": { | ||
| "LoadingText": "正在加载 ..." | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||
| import { addScript, addLink, getTheme } from '../BootstrapBlazor/modules/utility.js' | ||||||||||
| import { addScript, addLink, getTheme } from '../BootstrapBlazor/modules/utility.js' | ||||||||||
| import DataService from './data-service.js' | ||||||||||
|
|
||||||||||
| const loadAssets2 = async lang => { | ||||||||||
|
||||||||||
|
|
@@ -30,6 +30,7 @@ const loadAssets = async lang => { | |||||||||
| await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univer-bundle.js'); | ||||||||||
| await addLink('./_content/BootstrapBlazor.UniverSheet/univer/univer-sheet.bundle.css'); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| export async function createUniverSheetAsync(sheet) { | ||||||||||
| sheet.lang = sheet.lang ?? 'en-US'; | ||||||||||
| await loadAssets(sheet.lang); | ||||||||||
|
|
@@ -46,7 +47,7 @@ export async function createUniverSheetAsync(sheet) { | |||||||||
| const lang = sheet.lang.replace('-', '') | ||||||||||
| const langStr = lang.charAt(0).toUpperCase() + lang.slice(1) | ||||||||||
|
Comment on lines
47
to
48
|
||||||||||
| const lang = sheet.lang.replace('-', '') | |
| const langStr = lang.charAt(0).toUpperCase() + lang.slice(1) | |
| const lang = sheet.lang.replace('-', ''); | |
| const langStr = lang.charAt(0).toUpperCase() + lang.slice(1); |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Guard against sheet.events being undefined before destructuring.
If callers omit sheet.events, const { onRendered } = sheet.events; will throw at runtime. Consider using optional chaining (e.g. const onRendered = sheet.events?.onRendered;) or ensuring sheet.events is defaulted when constructing sheet to handle partial/legacy callers safely.
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon after disposable.dispose(). Add a semicolon at the end of this statement to maintain code consistency and avoid potential JavaScript issues.
| disposable.dispose() | |
| disposable.dispose(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| .bb-univer-sheet { | ||
| width: 100%; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .univer-theme { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider moving inline styles to CSS to keep layout/styling consistent and maintainable.
These elements now depend on complex inline styles for positioning and centering. Moving these into CSS classes (e.g., extending
.bb-univer-sheetand defining.bb-univer-sheet-backdrop) will simplify future layout/theming changes and prevent clashes with user inline styles fromAdditionalAttributes.Suggested implementation:
To complete the refactor away from inline styles, add CSS for these classes in the appropriate stylesheet (e.g.
UniverSheet.razor.css, the library's main.css, or a shared theme file):If
ClassStringalready includesbb-univer-sheet, adjust theclassattribute to avoid duplication (e.g. via the existing class-composition helper used elsewhere in the codebase).