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
refactor(cdk-experimental/menu): Break MenuItems into directives (#19688)
* refactor(cdk-experimental/menu): Break MenuItems into directives
Currently CdkMenuItem is designed to handle the logic for the radio and
checkox role along with performing basic user actions and opening an
attached Menu. Separating the logic into separate directives for each
role makes the code easier to reason about and more testable and
reliable. It also aids in implementing future functionality.
* test(cdk-experimental/menu): Remove unnecessary tests
MenuItemTriggers selector specifies that it must be placed alongside a
cdkMenuItem directive hence placing alongside a cdkMenuItenCheckbox (or
any other selectable) should be a compile time failure.
* fix(cdk-experimental/menu): Fix attribute inheritance
Element attributes in the host bindings are inherited by subclasses with
Ivy but not View Engine. Specifying explicitly on each subclass fixes
this issue.
* fix(cdk-experimental/menu): Fix ViewEngine tests
In ViewEngine when selecting for ContentChildren, it will include the
current component if it matches the query (including subclasses).
This ensures that a check is performed to prevent this bug from causing
the change emitter from being completed when only a CdkMenu exists with
no real nested groups.
* test(cdk-experimental): Clear up tests
* refactor(cdk-experimental/menu): Make internal method private
* test(cdk-experimental/menu): clear up test description
* refactor(cdk-experimental/menu): Rename change event emitter
Change event emitter emits when the list of Selectables gets updated
* test(cdk-experimental/menu): Refactor test configuration
compileComponents() is an async function and therefore createComponents
cannot follow it. Breaking up into seperate beforeEach blocks prevents
any potential issues
* refactor(cdk-experimental/menu): Rename registration method
Extract logic from the lifecycle method and place into a more readable
method
* refactor(cdk-experimental/menu): rename native elements for clarity
* refactor(cdk-experimental/menu): use the same counter for name and id
* style(cdk-experimental/menu): clean up whitespace
* test(cdk-experimental/menu): refactor to use for..of where prefered
* style(cdk-experimental): move comment outside of conditional block
* refactor(cdk-experimental/menu): move logic out of lifecycle methods
* refactor(cdk-experimental/menu): simplify checkbox toggle logic
* docs(cdk-experimental/menu): add clearer documentation for checkbox and
radio
* refactor(cdk-experimental/menu): refactor checked attribute to be null
not false
0 commit comments