Skip to content
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

New tree component #1693

Open
wants to merge 95 commits into
base: main
Choose a base branch
from
Open

New tree component #1693

wants to merge 95 commits into from

Conversation

jpzwarte
Copy link
Member

No description provided.

@jpzwarte jpzwarte marked this pull request as ready for review January 22, 2025 08:45
}

override update(): void {
// empty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to leave it that way? :)

*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class FlatTreeDataSource<T = any> extends TreeDataSource<T> {
#mapping: FlatTreeDataSourceMapping<T>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add spacing between variables and maybe add descriptions as well? :)

*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class NestedTreeDataSource<T = any> extends TreeDataSource<T> {
#mapping: NestedTreeDataSourceMapping<T>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add spacing between variables and maybe add descriptions as well?

*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export abstract class TreeDataSource<T = any> extends DataSource<T, TreeDataSourceNode<T>> {
#loadChildren?: TreeDataSourceOptions<T>['loadChildren'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add spacing between variables and maybe add descriptions as well?

@property({ attribute: false }) scopedElements?: Record<string, typeof HTMLElement>;

/** @internal Emits when the user selects a tree node. */
@event({ name: 'sl-select' }) selectEvent!: EventEmitter<SlSelectEvent<TreeDataSourceNode<T>>>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just thinking, maybe we should rename SlSelectEvent from sl-select to sth else? Since sl-select is also used for select component?

if (this.dataSource?.selects === 'multiple') {
this.setAttribute('aria-multiselectable', 'true');
} else {
this.removeAttribute('aria-multiselectable');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should be this.setAttribute('aria-multiselectable', 'false');? So aria-multiselectable="false" by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants