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

tag cell in data-grid extended #2343

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export const TagsCell: Cell = {
<ul class={`tbody__tag-list`}>
{tags.map((tag) => (
<li>
<scale-tag size="small" type="strong" color={tag.color}>
<scale-tag
size={tag.size || 'small'}
type={tag.type || 'strong'}
color={tag.color || 'standard'}
>
{tag.content}
</scale-tag>
</li>
Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/html/data-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@
'One',
'Lorem ipsum dolor sit amet sime',
'http://example.com',
'Simple, Short',
[
{ content: 'Apple', color: 'red', size: 'standard' },
{ content: 'Pear', color: 'green', type: 'strong' },
{ content: 'Bug' },
],
'00:00:20',
102045.0,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import ScaleDataGrid from './ScaleDataGrid.vue';
},
description: `(optional) Title for sortable columns`,
control: { type: null },
},
},
height: {
table: {
type: { summary: 'string' },
Expand Down Expand Up @@ -669,7 +669,7 @@ Expected format: string

## Tags Cell

Expected format: comma delimited `string`, eg `'one, two, three'` or array of objects with content and color keys, e.g. `{content: 'Apple', color: 'red'}`
Expected format: comma delimited `string`, eg `'one, two, three'` or array of objects with required content key and optional color, type, size keys, e.g. `{content: 'Apple', color: 'red'}`. Acceptable values for color, type, size are same as for Tag component.
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add the link to Tag component for the user to jump to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

link added


<Canvas withSource="close">
<Story name="Tags Cell">
Expand Down