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

refactor(ui5-tabcontainer): replace some ITab properties #8495

Closed
wants to merge 8 commits into from

Conversation

dimovpetar
Copy link
Contributor

@dimovpetar dimovpetar commented Mar 21, 2024

  • Replaces isInline, forcedMixedMode, forcedPosinset, forcedSetsize, isTopLevelTab, getElementInStrip with 2 new methods: receiveStripPresentationInfo(info) and receiveOverflowPresentationInfo(info). This way it is clear that those properties are not expected to be set by the ITab implementer, but provided by the TabContainer to the ITab implementer
  • Adds stripPresentation() and overflowPresentation() getters, to make it clear that ITab implementer has to provide these templates
  • Renames getTabInStripDomRef to getDomRefInStrip and makes its return type match UI5Element#getDomRef
  • Removes realTabReference to avoid confusion that tab presentations and tabs are the same thing. Only tab presentations have realTabReference
  • Removes forcedStyle and forcedLevel. They were set and used only by the TabContainer.

BREAKING CHANGE: If your class implements the ITab interface, it must also provide receiveOverflowPresentationInfo, receiveStripPresentationInfo, getDomRefInStrip, stripPresentation and overflowPresentation. The rest of the properties are obsolete and can be deleted.

import type { ITab } from "@ui5/webcomponents-base/dist/TabContainer.js";
class MyTab implements ITab {
    getDomRefInStrip(): HTMLElement | undefined {
        return ...
    }
    receiveOverflowPresentationInfo(info) {
       // provides info for your overflow presentation
    }
    receiveStripPresentationInfo(info) {
        // provides info for your strip presentation
    }
    stripPresentation() {
       // this method was required prior this change, but it is not made clear
       // return strip presentation template
    }
    overflowPresentation() {
       // this method was required prior this change, but it is not made clear
       // return overflow presentation template
    }
}

Related to #8461

@dimovpetar dimovpetar changed the title Refactor itab feat(ui5-tabcontainer): rework ITab Mar 21, 2024
@dimovpetar dimovpetar marked this pull request as draft March 21, 2024 12:00
@dimovpetar dimovpetar changed the title feat(ui5-tabcontainer): rework ITab refactor(ui5-tabcontainer): replace some ITab properties Mar 21, 2024
@dimovpetar dimovpetar marked this pull request as ready for review March 21, 2024 14:43
@dimovpetar dimovpetar mentioned this pull request Mar 21, 2024
Copy link
Member

@TeodorTaushanov TeodorTaushanov left a comment

Choose a reason for hiding this comment

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

Open test/pages/TabContainer.html
Click on "Four" tab overflow button
Select "Four 1.1"
Result: Content is not displayed

Click on "Four" tab
Click on "Four" tab overflow button
Select "Four 1.1"
Result: Content is displayed

@dimovpetar dimovpetar marked this pull request as draft April 1, 2024 13:00
@ilhan007 ilhan007 changed the base branch from release-2.0 to main April 4, 2024 21:08
@dimovpetar dimovpetar closed this Apr 5, 2024
@dimovpetar dimovpetar deleted the refactor_itab branch April 5, 2024 07:44
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.

2 participants