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

Tailwind: Datatable Issues #5438

Closed
artonio opened this issue Nov 28, 2023 · 12 comments · Fixed by #5439
Closed

Tailwind: Datatable Issues #5438

artonio opened this issue Nov 28, 2023 · 12 comments · Fixed by #5439
Labels
Component: Tailwind Tailwind specific issue
Milestone

Comments

@artonio
Copy link

artonio commented Nov 28, 2023

Describe the bug

Tailwind Theming documentation for datatable is very outdated, is it possible to update the docs for the Tailwind theming of the datable please. Thanks.

Reproducer

No response

PrimeReact version

10.2.1

React version

17.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@artonio artonio added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 28, 2023
@melloware melloware added Component: Documentation Issue or pull request is related to Documentation and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 28, 2023
@melloware melloware self-assigned this Nov 28, 2023
@melloware melloware added this to the 10.2.2 milestone Nov 28, 2023
melloware added a commit to melloware/primereact that referenced this issue Nov 28, 2023
@melloware
Copy link
Member

melloware commented Nov 28, 2023

See my PR. Not too much changed?

When you say its way out of date this doesn't look too far out of date?

@artonio
Copy link
Author

artonio commented Nov 29, 2023

things like loadingicon is now loadingIcon, bodyrow is now bodyRow, and many more.
@melloware

@artonio
Copy link
Author

artonio commented Nov 29, 2023

other components are also outdate, and it's really not that big of a deal to fix the other ones, but datatable is so huge that it takes time to fix all the props

@melloware
Copy link
Member

melloware commented Nov 29, 2023

cc @Dalorzo can you confirm this?

Are these case sensitive loadingicon doesn't work if its loadingIcon and vice versa?

@artonio
Copy link
Author

artonio commented Nov 29, 2023

rowgrouptoggler does not exist under DataTablePassThroughOptions but is now under ColumnPassThroughOptions

@melloware @Dalorzo

@melloware
Copy link
Member

melloware commented Nov 29, 2023

@artonio interested in submitting a PR?

@artonio
Copy link
Author

artonio commented Nov 29, 2023

@artonio interested in submitting a PR?
@melloware
sure, I have a member of my team fixing it now, and then I will submit a PR once we have it working in our app

@melloware melloware reopened this Nov 29, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 29, 2023
@melloware melloware modified the milestones: 10.2.2, 10.3.0 Nov 29, 2023
@melloware melloware removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 29, 2023
@Dalorzo
Copy link
Contributor

Dalorzo commented Dec 2, 2023

rowgrouptoggler does not exist under DataTablePassThroughOptions but is now under ColumnPassThroughOptions

@melloware @Dalorzo

#5501

@melloware melloware added Component: Tailwind Tailwind specific issue and removed Component: Documentation Issue or pull request is related to Documentation labels Dec 2, 2023
@melloware melloware changed the title Tailwind Datatable Theming Documentation Tailwind: Datatable Issues Dec 2, 2023
@melloware melloware removed their assignment Dec 2, 2023
@melloware melloware removed this from the 10.3.0 milestone Dec 2, 2023
@melloware
Copy link
Member

@Dalorzo please enter all your research here on this ticket.

@Dalorzo
Copy link
Contributor

Dalorzo commented Dec 2, 2023

-camelCase

  • missing properties on column: frozen, showGridlines and resizeable are missing
column: {
    headerCell: ({ context, props }) => ({ /*<-- DataTablePassThroughMethodOptions<DataTableValueArray>*/
      className: classNames(
        'text-left border-0 border-b border-solid border-gray-300 dark:border-blue-900/40 font-bold',
        'transition duration-200',
        context?.size === 'small' ? 'p-2' : context?.size === 'large' ? 'p-5' : 'p-4', // Size
        context.sorted ? 'bg-blue-50 text-blue-700' : 'bg-slate-50 text-slate-700', // Sort
        context.sorted ? 'dark:text-white/80 dark:bg-blue-300' : 'dark:text-white/80 dark:bg-gray-900', // Dark Mode
        {
          'sticky z-[1]': props.frozen || props.frozen === '', // Frozen Columns
          'border-x border-y': context?.showGridlines,
          'overflow-hidden space-nowrap border-y relative bg-clip-padding': context.resizable, // Resizable
        },
      ),
    }),

There is no footerCell in ColumnPassthroughOptions

           footercell: ({ context }) => ({
               className: classNames(
                   'text-left border-0 border-b border-solid border-gray-300 font-bold',
                   'bg-slate-50 text-slate-700',
                   'transition duration-200',
                   context.size === 'small' ? 'p-2' : context.size === 'large' ? 'p-5' : 'p-4', // Size
                   'dark:text-white/80 dark:bg-gray-900 dark:border-blue-900/40', // Dark Mode
                   {
                       'border-x border-y': context.showGridlines
                   }
               )
           }),

There are no lable property in DropdownPassThroughOptions, and camelCase

filterremovebutton: {
       root: 'ml-2',
       label: 'grow-0',
     },

ColumnPassthroughOptions does not have a rowReorderIcon property nor transition

rowReorderIcon: {
     className: 'cursor-move',
   },
   
   transition: TRANSITIONS.overlay,

all properties are missing on bodyRow: selected, index, selectable, selected

bodyRow: ({ context }: DataTablePassThroughMethodOptions<DataTableValueArray>) => ({
   className: classNames(
     context.selected ? 'bg-blue-50 text-blue-700 dark:bg-blue-300' : 'bg-white text-gray-600 dark:bg-gray-900',
     context.stripedRows
       ? context.index % 2 === 0
         ? 'bg-white text-gray-600 dark:bg-gray-900'
         : 'bg-blue-50/50 text-gray-600 dark:bg-gray-950'
       : '',
     'transition duration-200',
     'focus:outline focus:outline-[0.15rem] focus:outline-blue-200 focus:outline-offset-[-0.15rem]', // Focus
     'dark:text-white/80 dark:focus:outline dark:focus:outline-[0.15rem] dark:focus:outline-blue-300 dark:focus:outline-offset-[-0.15rem]', // Dark Mode
     {
       'cursor-pointer': context.selectable,
       'hover:bg-gray-300/20 hover:text-gray-600': context.selectable && !context.selected, // Hover
     },
   ),
 }),

Missing: rowgrouptoggler and rowgro-camelCase

  • missing properties on column: frozen, showGridlines and resizeable are missing
column: {
    headerCell: ({ context, props }) => ({ 
      className: classNames(
        'text-left border-0 border-b border-solid border-gray-300 dark:border-blue-900/40 font-bold',
        'transition duration-200',
        context?.size === 'small' ? 'p-2' : context?.size === 'large' ? 'p-5' : 'p-4', // Size
        context.sorted ? 'bg-blue-50 text-blue-700' : 'bg-slate-50 text-slate-700', // Sort
        context.sorted ? 'dark:text-white/80 dark:bg-blue-300' : 'dark:text-white/80 dark:bg-gray-900', // Dark Mode
        {
          'sticky z-[1]': props.frozen || props.frozen === '', // Frozen Columns
          'border-x border-y': context?.showGridlines,
          'overflow-hidden space-nowrap border-y relative bg-clip-padding': context.resizable, // Resizable
        },
      ),
    }),

There is no footerCell in ColumnPassthroughOptions

           footercell: ({ context }) => ({
               className: classNames(
                   'text-left border-0 border-b border-solid border-gray-300 font-bold',
                   'bg-slate-50 text-slate-700',
                   'transition duration-200',
                   context.size === 'small' ? 'p-2' : context.size === 'large' ? 'p-5' : 'p-4', // Size
                   'dark:text-white/80 dark:bg-gray-900 dark:border-blue-900/40', // Dark Mode
                   {
                       'border-x border-y': context.showGridlines
                   }
               )
           }),

There are no lable property in DropdownPassThroughOptions, and camelCase

filterremovebutton: {
       root: 'ml-2',
       label: 'grow-0',
     },

ColumnPassthroughOptions does not have a rowReorderIcon property nor transition

rowReorderIcon: {
     className: 'cursor-move',
   },
   
   transition: TRANSITIONS.overlay,

all properties are missing on bodyRow: selected, index, selectable, selected

bodyRow: ({ context }: DataTablePassThroughMethodOptions<DataTableValueArray>) => ({
   className: classNames(
     context.selected ? 'bg-blue-50 text-blue-700 dark:bg-blue-300' : 'bg-white text-gray-600 dark:bg-gray-900',
     context.stripedRows
       ? context.index % 2 === 0
         ? 'bg-white text-gray-600 dark:bg-gray-900'
         : 'bg-blue-50/50 text-gray-600 dark:bg-gray-950'
       : '',
     'transition duration-200',
     'focus:outline focus:outline-[0.15rem] focus:outline-blue-200 focus:outline-offset-[-0.15rem]', // Focus
     'dark:text-white/80 dark:focus:outline dark:focus:outline-[0.15rem] dark:focus:outline-blue-300 dark:focus:outline-offset-[-0.15rem]', // Dark Mode
     {
       'cursor-pointer': context.selectable,
       'hover:bg-gray-300/20 hover:text-gray-600': context.selectable && !context.selected, // Hover
     },
   ),
 }),

Missing: rowgrouptoggler and rowgroupTogglerIcon seems those needs to be removed

upTogglerIcon seems those needs to be removed

@Dalorzo
Copy link
Contributor

Dalorzo commented Dec 2, 2023

@melloware as per your request I shared my review above please let me know if there is anything missing or if you need me to elaborate more

@melloware
Copy link
Member

Let's see what else @artonio and his coworker find too

@melloware melloware added this to the 10.3.1 milestone Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Tailwind Tailwind specific issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants