Repository navigation
feat(tabs): Adds headerPosition (header-position) to igc-tabs - #2556
Open
rkaraivanov wants to merge 7 commits into
Open
rkaraivanov wants to merge 7 commits into
rkaraivanov wants to merge 7 commits into
Conversation
Add `headerPosition` (`header-position`): `top` (default), `start` and `end`. In a column, Up and Down move between the tabs, and the tab list has `aria-orientation="vertical"`. The arrow keys of the other axis stay with the browser, so a row still does not cancel Up and Down. The column layout follows in the next commits. #2553
Add `headerPosition` (`header-position`): `top` (default), `start` and `end`. In a column, Up and Down move between the tabs, and the tab list has `aria-orientation="vertical"`. The arrow keys of the other axis stay with the browser, so a row still does not cancel Up and Down. The column layout follows in the next commits. #2553
In a column with a set height, the scroll buttons show above and below the headers when they do not fit, and scroll them one header at a time. A selected or focused tab scrolls into view in the column. The indicator moves along the column with the selected header. A change of `headerPosition` starts the scroll offsets over, keeps the focused header in view, and moves the indicator without a transition. In a column, the scroll buttons and the height limit size the container, so a resize waits a frame before the column is measured again, and the resize observer reports no loop. Only the arrow icons of the scroll buttons turn, so the buttons add no overflow. #2553
In a column, the selected indicator lies over the side of the headers that faces the panels, in every theme. The themes give its thickness as custom properties, and the tabs place it on the axis of the headers. Bootstrap draws the edges of a column with logical borders, and the selected tab is open to the panels. Indigo draws the header line, the disabled scroll button line and the indicator on that side. Each tab gets the position as an internal state for these rules. The panel of a column with a set height starts at the top. The header strip covers only the header row of a row, or the header column of a column: as an absolutely positioned item, its end lines were the edge of the grid, so in a row it also painted the panels. #2553
The specification gets revision 10. It covers the column layout, the Up and Down keys, the vertical orientation, the scroll buttons above and below the headers, the limits of a column, and the test scenarios. The CHANGELOG lists headerPosition. The alignment description says that in a column, start is the top and end is the bottom. The Default story has a headerPosition control. It shows a column in a frame that the user can make shorter, so the panel scroll and the scroll buttons show. The account settings put the headers in a start column with a set height. #2553
- Build the row and column alignment templates and fillers in one loop. - Scope the right-to-left arrow flip and the scroll-button insets to a row, so a column does not reset them. - Place the header strip of a column through the header area variable. - Measure with a zoomed DOMRect, and set the indicator in one call. - Put the indicator size and color that the themes share in the common sheet, and remove repeated Indigo column hover rules. - In a column, a change of the container width no longer lays out the headers again. - setState changes a custom state only when the value changes, because Chromium restyles the host on each add(). #2553
- The tab gets the header position from a Lit context, so a change of position keeps a `selected` change made in the same task. A tab that leaves its tabs drops the position. - A key binding can have a `when` predicate. The roving-focus controller binds a predicate axis only while it is active, and keeps the `when` of the host's binding defaults, so the tabs, the button group and the stepper leave the other arrow keys to the browser. - A `max-height` on the tabs limits a column as a definite height does, without the padding and the border of the tabs. A probe that takes the `max-height` reports every change of it. - In a column, each header has the minimum height of a header row, and the indicator follows the headers that `center` or `end` moves. - With `justify`, a hidden tab leaves no gap, and tabs in a panel keep the width limit of a header. A hidden tab no longer moves the strip. - Simplify: one edge function for the scroll math, refs owned by the layout helpers, a `tracks()` function for the grid templates, fewer Bootstrap rules, and the shared `hasModifiers`. #2553
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
headerPosition(header-position) toigc-tabs.startandendput the headers in a column on that side of the panels. The default,top, keeps the row above the panels. The sides follow the direction, so astartcolumn is on the right in RTL. The behavior follows the Angular PR IgniteUI/igniteui-angular#17884.In a column
aria-orientation="vertical". Left and Right are not bound, so the browser keeps them.alignmentapplies along the column. In every theme, the indicator is on the side of the panels, and Bootstrap and Indigo draw their borders on that side.heightor amax-heighton the tabs, or a height from the parent. With a limit, a taller panel scrolls its content. When the headers do not fit, scroll buttons show above and below them. These buttons use theprev/nexticons turned by 90°, so the icon registry does not change.How it works
igc-tabstaysdisplay: contents. The tabs grid places the parts of each tab through inherited private custom properties, so a server-rendered or slotted tab gets the column layout before hydration.header-startandheader-endcustom states, which the theme side rules use.max-heightof the host. Themax-heightlimit does not include the padding and the border of the tabs. A ResizeObserver updates the layout when they change, and in a column it waits for the next animation frame.Shared changes
whenoption. Whilewhenreturnsfalse, the key is not bound, and the browser default runs.true, and it keeps thewhenof the host's binding defaults. So the button group and the stepper no longer cancel the arrow keys of the axis they do not use.setStatedoes nothing when the state does not change, because Chromium restyles the host on eachadd().Row fixes (these bugs are in 7.4.1, so they have CHANGELOG "Fixed" entries)
justify, a hidden tab no longer leaves an empty space.justifytabs keep the width limit of a header.Also: the new
TabsHeaderPositiontype, spec.md (revision 11 and scenarios 34-57), story controls and column scenarios, and the CHANGELOG.Type of Change
Related Issues
Closes #2553
Testing
heightandmax-heightlimits (also with padding and border), the scroll buttons, the indicator, a change of position in the same task as a selection, and a tab that leaves its tabs. The key-bindings and roving-focus specs coverwhenand the axis that is not used.npm run test:ssr: a server-rendered column has the column layout and no scroll buttonsNotes for review
max-heighton another ancestor does not limit the tabs. Amax-heightin percent limits a column only with the defaultheight, because CSS cannot give the tabs the value that the percent resolves to withheight: auto.Checklist
npm run public-api:updateand committedpublic-api.jsonCHANGELOG.mdentry under[Unreleased]