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

Adaptive Toolbar #5266

Merged
merged 6 commits into from
Dec 20, 2024
Merged

Adaptive Toolbar #5266

merged 6 commits into from
Dec 20, 2024

Conversation

TeyaVes
Copy link
Contributor

@TeyaVes TeyaVes commented Dec 9, 2024

targets: https://github.com/telerik/kendo-themes-private/issues/299

Toolbar Rendering Details

Scrolling Toolbar

  • Add class k-toolbar-scrollable if scrolling is enabled
  • Add class k-toolbar-scrollable-overlay only if we want to display the gradient overlay - this is in the case when the Toolbar is scrollable, there are enough items for scrolling and the scrollButtons are hidden
  • When scrolling is enabled, wrap the toolbar items in k-toolbar-items wrapper
Details
<div class="k-toolbar">
    <div class="k-toolbar-items">
        <Button />
        <MenuButton />
        ...
    </div>
</div>
  • The scrollButtons should be outside the container separated by a Toolbar separator with class k-toolbar-button-separator
  • The scrollButtons should have k-toolbar-prev and k-toolbar-next classes
  • Add k-toolbar-scroll-items class to k-toolbar-items element if we want to enable the native browser scroll. Otherwise, don’t add the class and handle the scrolling in the component
  • Add classes k-toolbar-scrolling-start, k-toolbar-scrolling-end - if we are at the beginning of the scrolling (at the very left) or at the end. This takes care of the gradient overlay when the toolbar is scrollable but the buttons are not visible.
  • Enable/disable the scrollButtons if the scrolling toolbar is at the very start or very end (similarly to the current scrollable Tabstrip behaviour)

Overflow section

  • The overflow section is opened inside a Popup component and the toolbar items are wrapped inside an k-toolbar-items-list
  • fillMode and size classes are added to k-toolbar-items-list - k-toolbar-items-list-solid, -flat, -outline; k-toolbar-items-list-sm, -md, -lg depending on the Toolbar component options
    • The fillMode is responsible for the color of the separator inside the overflow section; the size - for the paddings and gaps between the Toolbar items inside the overflow section
  • The fillMode and size component options inside the k-toolbar-items-list are propagated to the components inside

Global changes:

  • Add class k-toolbar-separator to the separators
  • Add toolbar separator next to the scroll and overflow buttons in all scenarios with class k-toolbar-button-separator
Details
<div class="k-toolbar">
    <Button class="k-toolbar-prev">
    <Button class="k-toolbar-next">
    <ToolbarSeparator class="k-toolbar-button-separator">
    <div class="k-toolbar-items">
        <Button />
        <MenuButton />
        ...
    </div>
</div>


<div class="k-toolbar">
    <Button class="k-toolbar-prev">
    <ToolbarSeparator class="k-toolbar-button-separator">
    <div class="k-toolbar-items">
        <Button />
        <MenuButton />
        ...
    </div>
    <ToolbarSeparator class="k-toolbar-button-separator">
    <Button class="k-toolbar-next">
</div>


<div class="k-toolbar">
    <Button />
    <MenuButton />
    ...
    <ToolbarSeparator class="k-toolbar-button-separator">
    <Button class="k-toolbar-overflow-button">
</div>

@TeyaVes TeyaVes self-assigned this Dec 9, 2024
@TeyaVes TeyaVes force-pushed the toolbar-adaptive branch 8 times, most recently from dd91709 to 57a573d Compare December 12, 2024 15:10
@TeyaVes TeyaVes marked this pull request as ready for review December 13, 2024 11:04
@TeyaVes TeyaVes requested a review from a team as a code owner December 13, 2024 11:04
@TeyaVes TeyaVes changed the title [WIP] Adaptive Toolbar Adaptive Toolbar Dec 13, 2024
@TeyaVes TeyaVes added this to the 2025 Q1 (Feb) milestone Dec 13, 2024
Copy link
Contributor

@epetrow epetrow left a comment

Choose a reason for hiding this comment

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

Two additional things that I am wondering:

  1. Is overflow true by default since it does look like it from the tests?
  2. Should we split the toolbar-section tests into two since we are showing sizing and fill mode in one?

packages/default/scss/toolbar/_layout.scss Outdated Show resolved Hide resolved
packages/default/scss/toolbar/_layout.scss Outdated Show resolved Hide resolved
packages/default/scss/toolbar/_layout.scss Outdated Show resolved Hide resolved
@TeyaVes TeyaVes force-pushed the toolbar-adaptive branch 2 times, most recently from a581ee0 to a84b32e Compare December 16, 2024 13:53
@TeyaVes
Copy link
Contributor Author

TeyaVes commented Dec 16, 2024

Two additional things that I am wondering:

  1. Is overflow true by default since it does look like it from the tests?
  2. Should we split the toolbar-section tests into two since we are showing sizing and fill mode in one?
  1. By default, the toolbar is with width: 100% and wraps if the content is wider. The other options are resizable with overflow menu or overflow section and scrollable with buttons or no buttons.
  2. I've split the toolbar-section tests in two.

@zhpenkov zhpenkov self-requested a review December 16, 2024 15:49
@TeyaVes TeyaVes force-pushed the toolbar-adaptive branch 5 times, most recently from 58134b0 to cc70997 Compare December 18, 2024 13:03
@TeyaVes TeyaVes requested a review from epetrow December 18, 2024 13:21
@TeyaVes TeyaVes force-pushed the toolbar-adaptive branch 4 times, most recently from f098726 to c2be49e Compare December 19, 2024 11:28
@TeyaVes
Copy link
Contributor Author

TeyaVes commented Dec 19, 2024

The visual changes in the grid-angular tests are expected as previosly, the toolbar inside the grid didn't have a sizing class and no padding were applied, which is not correct.

@TeyaVes TeyaVes requested a review from inikolova December 20, 2024 13:05
@TeyaVes TeyaVes merged commit 1c0e295 into develop Dec 20, 2024
27 checks passed
@TeyaVes TeyaVes deleted the toolbar-adaptive branch December 20, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants