More text positions and per-text styling to the bar texts of BitResourceTimeline
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Summary
A BitResourceTimelineAllocation can label its bar only on four sides (TextAbove, TextBelow, TextStart, TextEnd), always centered above/below the bar, and always in the timeline's bar-label color and font. Scheduling UIs often need more than that: a flight number at the start of the bar and its status at the end, a gate under one corner, a warning in red, a code in bold.
Proposal
Replace the four string properties of BitResourceTimelineAllocation with one Texts property of a new BitResourceTimelineBarTexts type, which has a property per position:
TopStart,TopCenter,TopEnd: above the bar, aligned with its start edge, centered on it, or aligned with its end edgeBottomStart,BottomCenter,BottomEnd: the same below the barStart,End: beside the bar, on its center line (whereTextStart/TextEndare drawn today)
Each position is a new BitResourceTimelineBarText that carries what customizes the text:
Text: the valueColor: a CSS color (falls back to the bar-label color)Font: a CSS font shorthand (falls back toOptions.BarLabelFontor the theme's font)OffsetX/OffsetY: pixels to move the text from where its position puts it
A string converts to a BitResourceTimelineBarText implicitly, so the common case stays short:
new BitResourceTimelineAllocation
{
Id = "BA117",
ResourceId = "A1",
StartTime = start,
EndTime = end,
Texts = new()
{
TopStart = "BA117",
TopEnd = new() { Text = "On time", Color = "#2f9e44", Font = "600 11px sans-serif" },
BottomStart = new() { Text = "London", Color = "#868e96" },
BottomEnd = new() { Text = "T5", OffsetX = -4 },
},
}
All three renderers (Canvas, Svg, Html) draw each text in its own color and font. Its own font is also used to measure it, so the room kept for it (and the stacking of the bars) follows its size. With StickyBarLabels, texts aligned with an edge stay in view the same way the centered ones do, and still leave the view with their bar. CollapseMatchingEdgeLabels keeps working on End / Start.
Name conflict
The component already has a Texts parameter (BitResourceTimelineTexts) for its own words: its accessible name, loading text and announcements. To keep the two apart, rename it to Strings (BitResourceTimelineStrings), on the component and on BitResourceTimelineParams.
Breaking changes
The component has only shipped in 11.0.0 prereleases, so this breaks prerelease users only:
| Before | After |
|---|---|
TextAbove = "x" |
Texts = new() { TopCenter = "x" } |
TextBelow = "x" |
Texts = new() { BottomCenter = "x" } |
TextStart = "x" |
Texts = new() { Start = "x" } |
TextEnd = "x" |
Texts = new() { End = "x" } |
<BitResourceTimeline Texts="..." /> |
<BitResourceTimeline Strings="..." /> |
BitResourceTimelineTexts |
BitResourceTimelineStrings |
These go into BreakingChanges.md and the breaking-change analyzer (BITBC001 / BITBC002). The Boilerplate's Workbench (ExtrasSection) uses the old names and needs updating separately.
- 主要语言
- C#
- 星标
- 1.4k
- 派生
- 264
- 平均合并
- 7 小时 19 分钟
- 30 天内合并 PR
- 583
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bitfoundation/bitplatform 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
bitfoundation/bitplatform#15051 ·
维护者通常 1 天内回复
-
Deprecated and obsolete SCSS features used in BlazorUI projects可能已有人在做 @msynk 于 2 天前认领。 未关闭area / BlazorUI
bitfoundation/bitplatform#15433 · 已指派 1 人 ·
维护者通常 1 天内回复
-
`Bit.BlazorUI.Icons`: GitHub and WhatsApp brand glyphs可能已有人在做 @msynk 于 4 天前认领。 未关闭area / BlazorUI
bitfoundation/bitplatform#15400 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Ship the SCSS partials (color aliases, breakpoint mixins) in the package可能已有人在做 @msynk 于 4 天前认领。 未关闭area / BlazorUI
bitfoundation/bitplatform#15399 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Focus ring: keep the element's own shadow, with a public opt-out可能已有人在做 @msynk 于 4 天前认领。 未关闭area / BlazorUI
bitfoundation/bitplatform#15398 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 bitfoundation/bitplatform 的全部 Issue
相似的 Issue
-
area: core bug help wanted ready
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
area: remote bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
📅 Sprint 4 Module-Tools Setup Submit:None 🦔 Size Tiny
难度 2/5 1-3 小时 新手友好度 70/100
CodeYourFuture/Module-Tools#712 ·
-
:watch: Not Triaged dotnet-fundamentals/svc
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
A: Mapping P3: Standard T: New Feature
难度 2/5 1-3 小时 新手友好度 68/100
space-wizards/space-station-14#46878 · 2 条评论 ·
维护者通常 1 天内回复