-
Notifications
You must be signed in to change notification settings - Fork 80
feat(list)!: add displayMode property to choose between flat and nested lists #10852
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
Conversation
@ashetland could you give this a view? 👀 |
@@ -239,6 +241,9 @@ export class List | |||
*/ | |||
messages = useT9n<typeof T9nStrings>({ blocking: true }); | |||
|
|||
/** Specifies the nesting behavior. */ | |||
@property({ reflect: true }) mode: ListMode = "flat"; |
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.
Should this be displayMode
to match some other component nomenclature? This doesn't affect any selection or other functionality right, just visual?
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.
I'll defer to @jcfranco
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.
It does affect some functionality. nested
must be used to add the expand button and indent children. That said, I could go either way here and also defer to @jcfranco.
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.
Good point. Let's go with displayMode
for consistency. The only other mode
prop I found was input-time-zone
's, which affects both the API and presentation.
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.
Visuals lookin' good!
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.
Awesome stuff, @driskull! ✨📝✨
I have a concern regarding support for unexpected, slotted items, but aside from that, this LGTM!
</calcite-list> | ||
</calcite-list-item> | ||
<calcite-list-item label="Depth 2" description="Item 5"></calcite-list-item> | ||
<div> |
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.
What's the use case for wrapped list items? If it's not a strong one, I'd suggest not supporting this to keep things simple. This also aligns with the default slot's description where we only expect items and groups. Also applies to similar dragHandle
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 basically a copy from an existing test for dragHandle. I can remove the test though.
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.
Yeah, let's remove.
@@ -239,6 +241,9 @@ export class List | |||
*/ | |||
messages = useT9n<typeof T9nStrings>({ blocking: true }); | |||
|
|||
/** Specifies the nesting behavior. */ | |||
@property({ reflect: true }) mode: ListMode = "flat"; |
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.
Good point. Let's go with displayMode
for consistency. The only other mode
prop I found was input-time-zone
's, which affects both the API and presentation.
Related Issue: #9173
Summary
displayMode
property to choose between flat and nested listsBREAKING CHANGE: Choose a
displayMode
of "nested" or "flat" according to space and nesting requirements.