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

Additional Tags Cell Controls #2297

Closed
mcorbug opened this issue Mar 13, 2024 · 0 comments · Fixed by #2343
Closed

Additional Tags Cell Controls #2297

mcorbug opened this issue Mar 13, 2024 · 0 comments · Fixed by #2343
Labels
feature New component features and enhancements

Comments

@mcorbug
Copy link

mcorbug commented Mar 13, 2024

Describe the feature request
Can you add more controls to the Tags Cells in Data Grid
Describe the use case
I kinda wish the where the option to provide the size and type as well

File
tags-cell.tsx

Current:

return (
  <ul class={`tbody__tag-list`}>
    {tags.map((tag) => (
      <li>
        <scale-tag size="small" type="strong" color={tag.color}>
          {tag.content}
        </scale-tag>
      </li>
    ))}
  </ul>
);

Proposal:

return (
  <ul class={`tbody__tag-list`}>
    {tags.map((tag) => (
      <li>
        <scale-tag size="{tag.size}" type="{tag.type}" color={tag.color}>
          {tag.content}
        </scale-tag>
      </li>
    ))}
  </ul>
);

This would allow the User to pass in size and type as well in data-grid.rows:

const dataGrid = document.querySelector('#table');
dataGrid.fields = [
    {
        type: 'tags',
        label: 'Status',
    }
];

dataGrid.rows = [
    [
        [{content: 'My Tag', color: 'olive', size:'mySize', type: 'myType'}]
    ],
];

NOTE: Also your documentation lacks an info about that you can pass in custom Tag like this at all, I had a look at the Action Cells Example and figured out by digging into the code that you can do the same for Tags Cells

@mcorbug mcorbug added the feature New component features and enhancements label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New component features and enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant