-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(menu, menu-item): Adds menu & menu-item components. #6901
feat(menu, menu-item): Adds menu & menu-item components. #6901
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
[CSS.isRtl]: dir === "rtl", | ||
[CSS.dropdownVertical]: this.topLevelMenuLayout === "vertical" | ||
}} | ||
label="Submenu" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This label string still needs to be translated.
Submitted the request for translations yesterday and also added the base translations strings in #6938 . Once the generate build is back we can add the t9n interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, @anveshmekala @macandcheese! 🧑🍳
Only the prop reflection consistency and delegatesFocus
concerns need to be addressed before merging. The rest can be tackled in follow-up PRs.
|
||
it("is focusable", () => focusable("calcite-menu-item")); | ||
|
||
//todo : debug why calcite-menu-item requires calite-menu as parent for the click to emit event in test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is being caused by the click-handling element (anchor) not stretching along with its host and therefore not being in the center when the click happens (E2EElement.click()
scrolls and clicks on the center of the element). If you set inline-size: 100%
on the anchor, it fixes the test, but not sure if that will cause layout issues (design-wise).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense. we can mark inline-size:100%
for anchor element and the design will be similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, @anveshmekala @macandcheese! 🧑🍳
Only the prop reflection consistency and delegatesFocus
concerns need to be addressed before merging. The rest can be tackled in follow-up PRs.
Related Issue: #6531
Summary
This PR adds
calcite-menu
&calcite-menu-item
components.Co-authored by @macandcheese
Extracted from #6829
calcite-nav-menu
Usage
Basic
Properties
label
(required)label
string
undefined
layout
layout
"horizontal" | "vertical"
"horizontal"
messageOverrides
{ more?: string; }
undefined
#Methods
setFocus() => Promise<void>
Sets focus on the component's first focusable element.
Returns
Type:
Promise<void>
calcite-nav-menu-item
Usage
Basic
Nested-With-Href
Nested SubMenu with href.
Properties
active
active
true
, the component is highlighted.boolean
undefined
breadcrumb
breadcrumb
boolean
undefined
href
href
string
undefined
iconEnd
icon-end
string
undefined
iconFlipRtl
icon-flip-rtl
iconStart
and/oriconEnd
as flipped when the element direction is right-to-left ("rtl"
)."both" | "end" | "start"
undefined
iconStart
icon-start
string
undefined
label
(required)label
string
undefined
open
open
calcite-menu-item
in an open overflow menuboolean
false
rel
rel
href
value and the current document.string
undefined
target
target
href
property.string
undefined
text
text
string
undefined
Events
calciteMenuItemSelect
CustomEvent<void>
Methods
setFocus() => Promise<void>
Sets focus on the component.
Returns
Type:
Promise<void>
Built with StencilJS