You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now Prefix/Postfix and primary addon have dedicated elements wrappers and allowing us to directly append elements to them without the need to wrap those elements as PostFixAddon/PrefixAddOns/PrimaryAddOn . and now all components can append addons and in-case one does not have any specific treatment for them they will just be appended as any other normal element.
a custom component will only need to define the wrapper element for the postfix and prefix addons by overriding tge getPrefixElement and getPostfixElement methods.
example :
NavBar.create("Title here")
.withPostfixElement((parent, self) -> {
self.appendChild(Icons.menu(),
Icons.cogs(),
span().textContent("will be appended as postfix too"));
})
.withPrefixElement((parent, self) -> {
self.appendChild(Icons.arrow_left(),
Icons.theater(), span().textContent("will be appended as prefix too"));
});
Also Prefix/Postfix can now be cleared independently by obtaining the PrefixElement/PostfixElement and call clearElement
component.getPrefixElement().clearElement() will clear all prefix addons on that element
Appending multiple child components to a parent component have been also improved and now can do that without using appendChild for each.
vegegoku
changed the title
Enhance how we append/remove Prefix/PostFix?primamry addons to element and enhance how we append multiple childs
Enhance how we append/remove Prefix/PostFix/primamry addons to element and enhance how we append multiple childs
Aug 5, 2024
Now Prefix/Postfix and primary addon have dedicated elements wrappers and allowing us to directly append elements to them without the need to wrap those elements as PostFixAddon/PrefixAddOns/PrimaryAddOn . and now all components can append addons and in-case one does not have any specific treatment for them they will just be appended as any other normal element.
a custom component will only need to define the wrapper element for the postfix and prefix addons by overriding tge
getPrefixElement
andgetPostfixElement
methods.example :
Also Prefix/Postfix can now be cleared independently by obtaining the PrefixElement/PostfixElement and call
clearElement
component.getPrefixElement().clearElement()
will clear all prefix addons on that elementAppending multiple child components to a parent component have been also improved and now can do that without using appendChild for each.
for example
old :
New :
The text was updated successfully, but these errors were encountered: