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

feat: Create tree component #999

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarkoOleksiyenko
Copy link
Contributor

Before submitting the PR, please make sure you do the following:

  • Read the Contributing Guidelines
  • Reference your PR to an issue that was discussed ahead of time
  • The PR should contain a clear description of the problem it solves
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the unit tests with npm run test
  • Run the linting with npm run lint
  • Run the e2e tests with npm run e2e

Thank you for contributing to AgnosUI!

@MarkoOleksiyenko MarkoOleksiyenko force-pushed the tree-component branch 3 times, most recently from ab1a56b to 8ff4407 Compare November 4, 2024 14:49
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 57.53425% with 31 lines in your changes missing coverage. Please review.

Project coverage is 84.74%. Comparing base (dd0c588) to head (c890575).

Files with missing lines Patch % Lines
core/src/components/tree/tree.ts 57.53% 29 Missing and 2 partials ⚠️

❗ There is a different number of reports uploaded between BASE (dd0c588) and HEAD (c890575). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (dd0c588) HEAD (c890575)
e2e 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #999      +/-   ##
==========================================
- Coverage   92.08%   84.74%   -7.34%     
==========================================
  Files          94       49      -45     
  Lines        2528     2013     -515     
  Branches      420      369      -51     
==========================================
- Hits         2328     1706     -622     
- Misses        130      221      +91     
- Partials       70       86      +16     
Flag Coverage Δ
e2e ?
unit 84.74% <57.53%> (-1.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ExFlo
Copy link
Contributor

ExFlo commented Nov 5, 2024

Hi the screenreader is not fully working when expanding / collapsing the node.

Copy link
Contributor

@ExFlo ExFlo left a comment

Choose a reason for hiding this comment

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

Fix the keyboard navigation with screenreader

);
}
/**
* Optional accessiblity label for the tree if there is no explicit label
Copy link
Contributor

Choose a reason for hiding this comment

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

accessibility

*/
export interface TreeItem {
/**
* Accessiblity label for the node
Copy link
Contributor

Choose a reason for hiding this comment

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

accessibility


interface TreeCommonPropsAndState extends WidgetsCommonPropsAndState {
/**
* Optional accessiblity label for the tree if there is no explicit label
Copy link
Contributor

Choose a reason for hiding this comment

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

accessibility

*/
@Input('auClassName') className: string | undefined;
/**
* Retrieves expand items of the TreeItem
Copy link
Contributor

Choose a reason for hiding this comment

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

false comment ?

Copy link
Contributor

Choose a reason for hiding this comment

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

how querySelectorAll button could return Span or Input ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forgot to change to the HTMLButton :)

$au-tree-expand-button-border-radius: 0.375rem !default;
$au-tree-expand-button-background-color: transparent !default;
$au-tree-expand-button-background-color-hover: #c5d5f9 !default;
$au-tree-expand-icon-color-default: blue !default; // TODO change to a proper color
Copy link
Contributor

Choose a reason for hiding this comment

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

use proper css var of BS with default value like for the slider


.au-tree-expand-button-placeholder {
display: flex;
width: 2.75rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

no css var ?


.au-tree-expand-button {
position: relative;
width: 2.25rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

idem

attributes: {
'aria-label': computed(() => {
const {item} = treeItemContext$();
return `Toggle ${item.label}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we customize this ?

};

/**
* A functional component that renders a tree item elemen.
Copy link
Contributor

Choose a reason for hiding this comment

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

element

const widget = callWidgetFactory({
factory: createTree,
widgetName: 'tree',
props: {...props},
Copy link
Contributor

Choose a reason for hiding this comment

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

don't you need a getter here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, the new update

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.

Implement Tree widget
2 participants