-
Notifications
You must be signed in to change notification settings - Fork 30
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(QTable): add sortOrder & active header #318
Conversation
✅ Deploy Preview for qui-max ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for qui-docs canceled.
|
const currentDirection = props.sortBy?.direction ?? null; | ||
let newDirection: Nullable<'ascending' | 'descending'> = null; | ||
|
||
const sortOrder = props.column.sortOrder; |
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.
const { sortOrder } = props.column;
src/qComponents/QTable/src/types.ts
Outdated
@@ -14,6 +14,7 @@ export interface Column { | |||
value: Nullable<string | number>; | |||
isHidden?: boolean; | |||
sortable?: boolean; | |||
sortOrder?: Nullable<'ascending' | 'descending'>[]; |
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.
Nullable<'ascending' | 'descending'> в отдельный тип?
let newDirection: Nullable<'ascending' | 'descending'> = null; | ||
|
||
const sortOrder = props.column.sortOrder; | ||
if (sortOrder && Array.isArray(sortOrder)) { |
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.
if (Array.isArray(sortOrder))
достаточно
const makeCounter = (): (() => number) => { | ||
return () => { | ||
sortCounter = | ||
sortOrderLength - 1 === sortCounter ? 0 : (sortCounter += 1); |
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.
sortOrderLength - 1 === sortCounter ? 0 : ++sortCounter
No description provided.