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(table): S2 tableview custom column menu #7617

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Jan 16, 2025

Closes
Based on DNM - on hold: Implement Table Column custom actions
https://github.com/orgs/adobe/projects/19/views/32?visibleFields=%5B%22Title%22%2C%22Assignees%22%2C%22Status%22%2C4406231%2C25365423%2C3244152%2C5195578%2C17851188%2C30557450%2C3404283%2C%22Labels%22%5D&filterQuery=table&pane=issue&itemId=5984093

Some requirements we should consider, grouping multiple ways to sort. See acrobat.com's tables.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@snowystinger snowystinger marked this pull request as ready for review January 16, 2025 05:06
@snowystinger snowystinger changed the title feature(table): S2 tableview custom column menu feat(table): S2 tableview custom column menu Jan 16, 2025
@rspbot
Copy link

rspbot commented Jan 16, 2025

Copy link
Member

@ktabors ktabors left a comment

Choose a reason for hiding this comment

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

@rspbot
Copy link

rspbot commented Jan 16, 2025

@rspbot
Copy link

rspbot commented Jan 16, 2025

## API Changes

@react-spectrum/s2

/@react-spectrum/s2:Column

 Column {
   align?: 'start' | 'center' | 'end' = 'start'
   allowsResizing?: boolean
   allowsSorting?: boolean
   children: ReactNode
   className?: string | ((ColumnRenderProps & {
     defaultClassName: string | undefined
 })) => string
   defaultWidth?: ColumnSize | null
   id?: Key
   isRowHeader?: boolean
   maxWidth?: ColumnStaticSize | null
+  menu?: ReactNode
   minWidth?: ColumnStaticSize | null
   showDivider?: boolean
   style?: CSSProperties | ((ColumnRenderProps & {
     defaultStyle: CSSProperties
   textValue?: string
   width?: ColumnSize | null
 }

/@react-spectrum/s2:ColumnProps

 ColumnProps {
   align?: 'start' | 'center' | 'end' = 'start'
   allowsResizing?: boolean
   allowsSorting?: boolean
   children: ReactNode
   className?: string | ((ColumnRenderProps & {
     defaultClassName: string | undefined
 })) => string
   defaultWidth?: ColumnSize | null
   id?: Key
   isRowHeader?: boolean
   maxWidth?: ColumnStaticSize | null
+  menu?: ReactNode
   minWidth?: ColumnStaticSize | null
   showDivider?: boolean
   style?: CSSProperties | ((ColumnRenderProps & {
     defaultStyle: CSSProperties
   textValue?: string
   width?: ColumnSize | null
 }

Comment on lines +166 to +168
<MenuSection>
<MenuItem onAction={action('filter')}><Filter /><Text slot="label">Filter</Text></MenuItem>
</MenuSection>
Copy link
Member

@ktabors ktabors Jan 17, 2025

Choose a reason for hiding this comment

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

The line as the first MenuItem from a MenuSection when it's the first section and there is no Header looks weird. I checked our Menu stories and they all have Headers. Is this because a MenuSection is wrapping the Collection where the MenuItems are inserted into the TableHeader's column cell?
image

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants