-
Notifications
You must be signed in to change notification settings - Fork 132
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(platform): table optimisation #9991
Conversation
✅ Deploy Preview for fundamental-ngx ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
9ed5dad
to
3a316ce
Compare
…at/table-optimisation # Conflicts: # libs/cdk/src/lib/utils/drag-and-drop/dnd-list/dnd-list.directive.ts # libs/core/src/lib/feed-list-item/components/item/feed-list-item.component.spec.ts # libs/core/src/lib/message-box/message-box.component.spec.ts # libs/docs/cdk/drag-n-drop/dnd-docs.component.html # libs/platform/src/lib/table/table.component.ts # libs/platform/src/lib/table/table.module.ts
Visit the preview URL for this PR (updated for commit 63ae765): https://fundamental-ngx-gh--pr9991-feat-table-optimisat-aouudzk4.web.app (expires Sat, 17 Jun 2023 10:55:33 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 41b993ee8e451bd7c6770b342ce142dc886eacff |
4558737
to
54cebae
Compare
54cebae
to
819f070
Compare
The problems I mentioned are not a regression, they are also present in main. I created an issue for these cases: #10021 |
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.
Initial state example - can no longer focus the true/false group by rows via keyboard Screen.Recording.2023-06-13.at.10.26.05.AM.mov |
libs/cdk/src/lib/utils/directives/selectable-list/selection.service.spec.ts
Show resolved
Hide resolved
libs/platform/src/lib/table-helpers/directives/table-cell-resizable.directive.ts _cdr is not used libs/platform/src/lib/table/components/table-p13-dialog/filtering/filter-rule.component.html *ngSwitchCaseDefault -> *ngSwitchDefault fundamental-ngx/libs/platform/src/lib/table/components/table-row/table-row.component.ts Line 119 in 0d898c8
Line 45 in 043d173
$any to fight these warnings
Lines 153 to 158 in 0d898c8
fundamental-ngx/libs/platform/src/lib/table-helpers/directives/table-cell-resizable.directive.ts Lines 90 to 94 in 92e1f43
Could not find any circular dependencies, which is awesome, considering the functionality over here, nice work |
fundamental-ngx/libs/platform/src/lib/table-helpers/directives/table-scrollable.directive.ts Line 26 in 1082296
fundamental-ngx/libs/platform/src/lib/table-helpers/directives/table-scrollable.directive.ts Line 138 in 1082296
this.renderer.selectRootElement(this.elementRef.nativeElement).ownerDocument.activeElement . Renderer is Renderer2 instance.
fundamental-ngx/libs/platform/src/lib/table-helpers/directives/table-scrollable.directive.ts Lines 130 to 180 in 1082296
fundamental-ngx/libs/platform/src/lib/table/table.component.ts Lines 670 to 673 in 0ae7728
fdp-table[something] family of the directives, so they could have done _table = inject(Table, {host: true}) and skip this setting step from table constructor. Why are you doing this this way? Is there any reason I do not see ?
|
@g-cheishvili on the last item of the comment - yes, it's can't be done differently since it will bring circular dependency (I've tried splitting, and this is the best aproach at the moment) |
Even if you use InjectionToken it still recognizes circularity? |
Yes. |
fixed |
@g-cheishvili: |
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.
Besides this
fundamental-ngx/libs/platform/src/lib/table-helpers/directives/table-cell-resizable.directive.ts
Line 80 in 4263d33
distinctUntilChanged(), |
I am more than happy to include this in the main. Amazing job
Related Issue(s)
closes #9932
closes #9926
closes #9955
closes #9746
Description
Main idea behind this refactoring was:
table
package into a separatetable-helpers
.virtualScroll
property. Otherwise it will not be loaded at all, same goes to dnd support. Initial state and dataSource are always applied since it's a core functionality of the table;mousemove
, now it reacts only if resize is started or finished. It will not trigger detection during the resize process).Platform table refactoring includes following breaking changes:
Components that rely on
HasElementRef
interface:HasElementRef
interface has been changed. Now instead ofelementRef()
method, components should haveelementRef: ElementRef
property. This can include getters too;Core table:
TableCellDirective
now directly extends fromFocusableItemDirective
. Previously it hadFocusableItemDirective
as a host directive applied to itself;Platform table:
@fundamental-ngx/platform/table
into a separate package@fundamental-ngx/platform/table-helpers
. To keep backwards compatibility,@fundamental-ngx/platform/table
re-exports@fundamental-ngx/platform/table-helpers
so that the import paths are the same as before;TableDataSourceDirective
standalone directive. Input properties are preserved;TableDraggableDirective
standalone directive. Input properties are preserved;TableInitialStateDirective
standalone directive. Input properties are preserved;TableVirtualScrollDirective
standalone directive. Input properties are preserved;@fundamental-ngx/cdk/data-source
implementation. Backwards compatibility is preserved for classes that extend from data-source/data-provider. More complex classes may need to be refactored according to new class signature;TableRowImpl
class as implementation ofTableRow
interface instead of simple object;SearchInput
type is now not re-exported from@fundamental-ngx/platform/table
. Instead use@fundamental-ngx/platform/search-field
;mousemove
, now, only when something inside the table itself is changed. This may require additional detectChanges calls from developers who are using Platform Table.dataSource
- setter available viafdp-table[dataSource]
but class property now accessible from_dataSourceDirective
property of Table component;state
,initialVisibleColumns
,initialSortBy
,initialFilterBy
,initialGroupBy
,initialPage
setters available viafdp-table[property]
but the class property now accessible frominitialState
property of Table component;isTreeTable
,enableRowReordering
,dropMode
setters available viafdp-table[property]
but the class property now accessible via_dndTableDirective
property of Table component;virtualScroll
,renderAhead
setter available viafdp-table[virtualScroll]
, but the class property now accessible via_virtualScrollDirective
property of Table component;rowsRearrange
- listener still available viafdp-table(rowsRearrange)
, but actual eventEmitter is now located in_dndTableDirective
property of Table component;onDataRequested
,onDataReceived
- listeners still available viafdp-table(event)
, but actual eventEmitters are now located in_dataSourceDirective
property of Table component;Screenshots
Before:
After:
Please check whether the PR fulfills the following requirements
During Implementation
PR Quality
https://github.com/SAP/fundamental-ngx/blob/main/CONTRIBUTING.md
https://github.com/SAP/fundamental-ngx/wiki/PR-Review-Checklist
README.md