-
Notifications
You must be signed in to change notification settings - Fork 23
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(stark-ui): add sticky action column to stark-table
#1152
feat(stark-ui): add sticky action column to stark-table
#1152
Conversation
@cnomes Could you please rebase your PR ? 😊 |
f3791ef
to
7354de2
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.
A small change. Please tell me what do you think about this 😊
* Should the actions always be shown on the right side of the table (sticky) | ||
* Default: false | ||
*/ | ||
isSticky?: boolean; |
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 think we should not mix table stuff with the action bar.
There is no reason for a generic action bar to be sticky.
Could you please move this logic in the Input of the table component? 😊
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.
You are right, the reason I put it there is because tableRowsActionBarConfig
is of this type and I didn't pay much attention to the name. 😅 I will add another (similar type) for the row actions, because it does make sense (to me) to add this property to tableRowsActionBarConfig
or maybe rename it to tableRowsActions
.
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.
Indeed, I agree to put this option in the tableRowsActionBarConfig
👍
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 updated the PR
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.
Minor remarks. And also I'm thinking... should we call it "Fixed Actions column" or "Sticky row actions". I'm wondering this because for the header we named it like "fixed header" so if we want to be consistent then I would say name this new feature as "fixed column"...
I was thinking that "sticky" is more used in development... so I was thinking about MS Excel for example, but there they call them "frozen column/row" 😞 See: https://support.office.com/en-us/article/freeze-panes-to-lock-rows-and-columns-dab2ffc9-020d-4026-8121-67dd25f2508f
@@ -147,6 +147,9 @@ export class StarkTableColumnComponent extends AbstractStarkUiComponent implemen | |||
@Input() | |||
public headerClassName?: string; | |||
|
|||
@Input() | |||
public stickyEnd?: boolean = false; |
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 you add a JSDoc for this new property?
@@ -40,5 +40,14 @@ <h1 translate>SHOWCASE.DEMO.SHARED.EXAMPLE_VIEWER_LIST</h1> | |||
> | |||
<showcase-table-with-custom-styling></showcase-table-with-custom-styling> | |||
</example-viewer> | |||
|
|||
<example-viewer | |||
id="withStickyActions" |
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 you move this new table one place above? Just below the other table about the fixed header so we can see the 2 examples about fixed header/columns together ;)
c2bbdd4
to
eea5430
Compare
In the material table they refer to columns and rows as "sticky". I agree we should be consistent, which one do we go for? sticky, fixed, frozen, ... 😄 |
285614d
to
915732d
Compare
I vote for "fixed" 👍 |
915732d
to
f4dae96
Compare
*/ | ||
export interface StarkTableRowActions extends StarkActionBarConfig { | ||
/** | ||
* Should the actions always be shown on the right side of the table (sticky) |
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.
Maybe we should change "always be shown on the right side" by "be fixed to the right side of the table"
@@ -4,3 +4,4 @@ export * from "./table-with-custom-actions"; | |||
export * from "./table-with-transcluded-action-bar"; | |||
export * from "./table-with-fixed-header"; | |||
export * from "./table-with-custom-styling"; | |||
export * from "./table-with-sticky-actions"; |
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 forget to change "sticky" by "fixed" in the file name ;)
@@ -0,0 +1 @@ | |||
export * from "./table-with-sticky-actions.component"; |
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 forget to change "sticky" by "fixed" in the file name ;)
@@ -0,0 +1,10 @@ | |||
<stark-table |
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 forget to change "sticky" by "fixed" in the file name ;)
@@ -0,0 +1,9 @@ | |||
::ng-deep table { |
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 forget to change "sticky" by "fixed" in the file name ;)
@@ -0,0 +1,166 @@ | |||
import { Component, Inject, OnInit } from "@angular/core"; |
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 forget to change "sticky" by "fixed" in the file name ;)
templateUrl: "./table-with-sticky-actions.component.html", | ||
styleUrls: ["./table-with-sticky-actions.component.scss"] | ||
}) | ||
export class TableWithStickyActionsComponent implements OnInit { |
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 forget to change "sticky" by "fixed" in the class name ;)
@@ -287,6 +287,7 @@ | |||
"WITH_FIXED_HEADER": "Table with fixed header", | |||
"WITH_TRANSCLUDED_ACTION_BAR": "Table with transcluded Action bar", | |||
"WITH_CUSTOM_STYLING": "Table with custom styling", | |||
"WITH_STICKY_ACTIONS": "Table with sticky row actions", |
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 forget to change "sticky" by "fixed" in the the translation key and the value
f4dae96
to
1fc5d74
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.
@@ -33,6 +33,14 @@ <h1 translate>SHOWCASE.DEMO.SHARED.EXAMPLE_VIEWER_LIST</h1> | |||
<showcase-table-with-fixed-header></showcase-table-with-fixed-header> | |||
</example-viewer> | |||
|
|||
<example-viewer | |||
exampleTitle="SHOWCASE.DEMO.TABLE.WITH_FIXED_ACTIONS" | |||
filesPath="table/with-sticky-actions/table" |
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 path should also be changed to "fixed"... because the app now throws an exception:
GET http://localhost:3000/assets/examples/table/with-sticky-actions/table.html 404 (Not Found)
3639513
to
99b764d
Compare
@christophercr I updated the PR |
- added documentation / demo - added and implemented `StarkTableRowActions` interface ISSUES CLOSED: NationalBankBelgium#1143
99b764d
to
b96753a
Compare
b96753a
to
468a3f1
Compare
- added documentation / demo
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #1143
What is the new behavior?
Does this PR introduce a breaking change?
Other information