Commit Graph

19 Commits

Author SHA1 Message Date
Jan Kuehle
4b4c373a6b chore: use import and export types
PiperOrigin-RevId: 599338980
2024-01-17 17:39:46 -08:00
Elizabeth Mitchell
c9aadeb585 chore(menu): merge HCM styles
PiperOrigin-RevId: 571239710
2023-10-05 23:28:28 -07:00
Elliott Marquez
6d0c7e8538 refactor(list)!: refactor list to reuse ListController
fixes #4967

also fixes list-root focus ring and focusout

BREAKING CHANGE: the new ListController behavior no longer waits for event.preventDefault asynchronously because it was causing keyboard navigations to scroll the page.

PiperOrigin-RevId: 568300155
2023-09-25 12:54:12 -07:00
Elliott Marquez
5fad4f088f feat(menu): create a Menu interface for easier md-menu wrapping
PiperOrigin-RevId: 567728911
2023-09-22 15:15:41 -07:00
Elliott Marquez
1217b62ef2 refactor(menu)!: pull logic out of menuitem into a controller & change enum vals
BREAKING CHANGE: Several enums in menu had their values changed from SCREAM_CASE to kebab-case to follow style guide. They are NAVIGABLE_KEYS -> NavigableKey, SELECTION_KEY -> SelectionKey, CLOSE_REASON -> CloseReason, KEYDOWN_CLOSE_KEY -> KeydownCloseKey

PiperOrigin-RevId: 567727434
2023-09-22 15:09:41 -07:00
Elliott Marquez
63b01425e7 refactor(menu,select)!: rename fixed to positioning
This will enable forwards compatibility for `positioning="top-layer"` with popover.

BREAKING CHANGE: refactor `fixed` property to `positioning="fixed"` in Menu and `menuFixed` to `menuPositioning="fixed"`

PiperOrigin-RevId: 567723646
2023-09-22 14:54:57 -07:00
Elliott Marquez
54fbb2ed5e feat(menu): implement md-sub-menu
md-sub-menu will succeed md-sub-menu-item. It allows for screen reader linear navigation

PiperOrigin-RevId: 567057310
2023-09-20 13:09:44 -07:00
Elliott Marquez
6e54048f1e refactor(menu)!: rename corner and focus state values lowercase with dashes
BREAKING: for style guide enum consistency, we have renamed the corner values START_START etc. to be lowercase with dashes. e.g. start-start. The same has been done with MdMenu.defaultFocus' values.
PiperOrigin-RevId: 566454879
2023-09-18 17:09:17 -07:00
Elliott Marquez
b85b57fa79 fix(menu,list,select): do not stopPropagation on native events when handled only prevent default
Fixes #4817

We need to communicate between components when an event has been handled (e.g. keyboard navigation or clicking). This CL focuses on listening to `defaultPrevented` in order to communicate that something was handled. We also have to patch ripple on submenu to make sure that the ripple isn't triggered.

PiperOrigin-RevId: 561748634
2023-08-31 13:48:20 -07:00
Elliott Marquez
5ba348dfd0 feat(menu)!: allow anchoring with idref string and set element ref on anchorElement
BREAKING: `MdMenu.prototype.anchor` now only accepts a string which will querySelector the rootNode of the menu. The method now to anchor to an element reference is to set `MdMenu.prototype.anchorElement`. This matches the `popover` anchoring proposal more closely, but that proposal may not pass in favor of a CSS approach.
PiperOrigin-RevId: 560955779
2023-08-29 01:40:36 -07:00
Elliott Marquez
043d548270 refactor(menu)!: events no longer subclass Event but rather use CustomEvent
Fixes issues running in ES5

BREAKING CHANGE: subclassing events is not supported in ES5 so all menu-related events now use CustomEvent rather than subclassing Event

PiperOrigin-RevId: 553304128
2023-08-02 17:23:36 -07:00
Andrew Jakubowicz
a8c2fa9a8b fix(menu)!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/menu/lib` to `@material/web/menu/internal`. Prefer not using internal files.

PiperOrigin-RevId: 550589890
2023-07-24 09:45:01 -07:00
Andrew Jakubowicz
c6e6f65445 fix(list)!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/list/lib` to `@material/web/list/internal`. Prefer not using internal files.

PiperOrigin-RevId: 550585246
2023-07-24 09:29:15 -07:00
Bre 97
46611901c3 Update menu.ts
Modify the label name of md-sub-menu in example
2023-05-23 21:05:30 +08:00
Material Web Team
712aab3efc feat(list,menu): implement forced colors
PiperOrigin-RevId: 520501176
2023-03-29 18:44:13 -07:00
Material Web Team
8f69e62ba7 refactor(menu): rename selected to active for future md-select work
PiperOrigin-RevId: 506740196
2023-02-02 15:34:35 -08:00
Material Web Team
7d5af92ad0 Implements md-menu
PiperOrigin-RevId: 504701523
2023-01-25 17:14:44 -08:00
Alexander Marks
30c95aeee1 chore: add ".js" extensions to import statements.
In particular, this allows external build tools like Rollup and @web/dev-server to understand imports of Lit, which is configured to require the ".js" extension via its export conditions (so that Lit import maps can remain minimal).

PiperOrigin-RevId: 469772992
2022-08-24 11:01:21 -07:00
Joy Zhong
60c4a413d3 feat(menu): Add initial menu base component class.
PiperOrigin-RevId: 463403263
2022-07-26 12:40:08 -07:00