More text positions and per-text styling to the bar texts of BitResourceTimeline
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 1.4k
- Fork
- 264
- Merge medio
- 8h 5m
- PR unite (30g)
- 595
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bitfoundation/bitplatform
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bitfoundation/bitplatform#15455 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bitfoundation/bitplatform#15051 ·
I maintainer di solito rispondono entro 1 giorno
-
bit Boilerplate and bit CLI move to bitfoundation/bitfabricForse già presa @yasmoradi l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
bitfoundation/bitplatform#15454 ·
I maintainer di solito rispondono entro 1 giorno
-
Deprecated and obsolete SCSS features used in BlazorUI projectsForse già presa @msynk l’ha presa 2 giorni fa. Apertaarea / BlazorUI
bitfoundation/bitplatform#15433 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`Bit.BlazorUI.Icons`: GitHub and WhatsApp brand glyphsForse già presa @msynk l’ha presa 4 giorni fa. Apertaarea / BlazorUI
bitfoundation/bitplatform#15400 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di bitfoundation/bitplatform
Issue simili
-
area-CodeGen-coreclr untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotnet/runtime#138181 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
area:identity type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
bug 🐞
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
valkey-io/valkey-glide#7849 ·
I maintainer di solito rispondono entro 1 giorno
-
area-Asset area-GameStudio area-Samples bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno