-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
feat: Create tree component #999
Conversation
ab1a56b
to
8ff4407
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #999 +/- ##
==========================================
- Coverage 92.11% 91.82% -0.29%
==========================================
Files 94 98 +4
Lines 2535 2668 +133
Branches 421 438 +17
==========================================
+ Hits 2335 2450 +115
- Misses 130 140 +10
- Partials 70 78 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
451b793
to
a1dda6b
Compare
a1dda6b
to
0fa9f4e
Compare
Hi the screenreader is not fully working when expanding / collapsing the node. |
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.
Fix the keyboard navigation with screenreader
0fa9f4e
to
71add32
Compare
208c027
to
16b8cac
Compare
$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 |
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.
use proper css var of BS with default value like for the slider
core-bootstrap/src/scss/tree.scss
Outdated
|
||
.au-tree-expand-button-placeholder { | ||
display: flex; | ||
width: 2.75rem; |
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.
no css var ?
core-bootstrap/src/scss/tree.scss
Outdated
|
||
.au-tree-expand-button { | ||
position: relative; | ||
width: 2.25rem; |
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.
idem
core/src/components/tree/tree.ts
Outdated
attributes: { | ||
'aria-label': computed(() => { | ||
const {item} = treeItemContext$(); | ||
return `Toggle ${item.label}`; |
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.
can't we customize this ?
}; | ||
|
||
/** | ||
* A functional component that renders a tree item elemen. |
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.
element
const widget = callWidgetFactory({ | ||
factory: createTree, | ||
widgetName: 'tree', | ||
props: {...props}, |
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.
don't you need a getter here ?
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, the new update
80fd954
to
24d5a34
Compare
1802fac
to
47e95d2
Compare
core/src/components/tree/tree.ts
Outdated
const _expandedMap$ = writable(new WeakMap<TreeItem, boolean | undefined>()); | ||
const _parentMap$ = writable(new WeakMap<TreeItem, TreeItem | undefined>()); | ||
const _htmlElementMap$ = writable(new WeakMap<TreeItem, HTMLElement>()); |
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.
As far as I understand:
These three stores seem to never change.
I think you should use simple variables, having stores here does not bring any value.
I think it would make sense to re-initialize those stores just before a new tree traversal, to be sure any previous node is no longer in these WeakMaps.
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.
Some comments, thanks @MarkoOleksiyenko for this new component !
svelte/bootstrap/src/components/tree/TreeDefaultStructure.svelte
Outdated
Show resolved
Hide resolved
svelte/bootstrap/src/components/tree/TreeDefaultStructure.svelte
Outdated
Show resolved
Hide resolved
dae3cbc
to
de2b3ee
Compare
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.
Tagged all fixed comments as resolved, thx @MarkoOleksiyenko !
imports: [SlotDirective], | ||
template: ` <ng-template [auSlot]="state.structure()" [auSlotProps]="{state, api, directives}"></ng-template> `, | ||
}) | ||
export class TreeComponent extends BaseWidgetDirective<TreeWidget> { |
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.
Add some jsdoc to the TreeComponent
too.
], | ||
}, | ||
]; | ||
return ( |
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.
@MarkoOleksiyenko you still kept an unnecessary <> </>
around the Tree
93d0b87
to
3c0643e
Compare
3c0643e
to
6f9a977
Compare
Before submitting the PR, please make sure you do the following:
Tests and linting
npm run test
npm run lint
npm run e2e
Thank you for contributing to AgnosUI!