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

Update StandardTable to allow easy ways to reduce text size #621

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

mattias800
Copy link
Collaborator

@mattias800 mattias800 commented Oct 13, 2023

  • Add two new config options to StandardTable.

defaultCellRenderer

This can be used to override default text renderer for the whole table.
Column cellRenderer will still override this. Since this is global for the table, and not local to a column,
the type of itemValue can not be known. It should use label as source of text instead.
If omitted, TextCell is used as usual.

image

defaultTextSize

This config specifies the text size to be used by the default TextCell component.
If omitted, "normal" is used.

image

Version

Published prerelease version: v19.0.0-next.16

Changelog

💥 Breaking Change

  • @stenajs-webui/core, @stenajs-webui/elements, @stenajs-webui/panels

🐛 Bug Fix

  • Add prerelease step for next branch #602 (@lindskogen)
  • @stenajs-webui/grid
  • @stenajs-webui/elements, @stenajs-webui/filter, @stenajs-webui/modal, @stenajs-webui/panels
  • @stenajs-webui/elements, @stenajs-webui/panels
  • @stenajs-webui/filter, @stenajs-webui/modal
  • @stenajs-webui/panels
  • @stenajs-webui/elements, @stenajs-webui/theme
  • @stenajs-webui/elements, @stenajs-webui/grid-export, @stenajs-webui/panels
  • @stenajs-webui/forms, @stenajs-webui/panels, @stenajs-webui/theme
  • @stenajs-webui/core, @stenajs-webui/elements, @stenajs-webui/forms, @stenajs-webui/panels, @stenajs-webui/theme
  • @stenajs-webui/elements
  • @stenajs-webui/calendar, @stenajs-webui/elements, @stenajs-webui/filter, @stenajs-webui/forms, @stenajs-webui/grid-export, @stenajs-webui/grid, @stenajs-webui/panels, @stenajs-webui/theme
  • @stenajs-webui/core, @stenajs-webui/elements, @stenajs-webui/filter, @stenajs-webui/modal, @stenajs-webui/panels, @stenajs-webui/theme
  • @stenajs-webui/core, @stenajs-webui/elements, @stenajs-webui/panels, @stenajs-webui/theme
  • @stenajs-webui/theme
  • @stenajs-webui/filter
  • @stenajs-webui/elements, @stenajs-webui/panels, @stenajs-webui/theme, @stenajs-webui/tooltip
  • @stenajs-webui/elements, @stenajs-webui/modal, @stenajs-webui/panels

⚠️ Pushed to next

Authors: 4

### defaultCellRenderer
This can be used to override default text renderer for the whole table.
Column cellRenderer will still override this. Since this is global for the table, and not local to a column,
the type of itemValue can not be known. It should use `label` as source of text instead.
If omitted, TextCell is used as usual.

### defaultTextSize
This config specifies the text size to be used by the default TextCell component.
If omitted, "normal" is used.
@github-actions
Copy link

github-actions bot commented Oct 13, 2023

Size Change: 0 B

Total Size: 352 kB

ℹ️ View Unchanged
Filename Size
packages/calendar/dist/index.es.js 15.2 kB
packages/calendar/dist/index.js 12.9 kB
packages/core/dist/index.es.js 5.03 kB
packages/core/dist/index.js 4.65 kB
packages/elements/dist/index.es.js 109 kB
packages/elements/dist/index.js 107 kB
packages/filter/dist/index.es.js 3.79 kB
packages/filter/dist/index.js 3.21 kB
packages/forms/dist/index.es.js 6.85 kB
packages/forms/dist/index.js 6.24 kB
packages/grid-export/dist/index.es.js 2.05 kB
packages/grid-export/dist/index.js 1.99 kB
packages/grid/dist/index.es.js 16.7 kB
packages/grid/dist/index.js 13.9 kB
packages/input-mask/dist/index.es.js 814 B
packages/input-mask/dist/index.js 734 B
packages/modal/dist/index.es.js 3.41 kB
packages/modal/dist/index.js 3.08 kB
packages/panels/dist/index.es.js 7.02 kB
packages/panels/dist/index.js 6.21 kB
packages/redux/dist/index.es.js 3.06 kB
packages/redux/dist/index.js 2.75 kB
packages/select/dist/index.es.js 4.08 kB
packages/select/dist/index.js 3.65 kB
packages/theme/dist/index.es.js 1.99 kB
packages/theme/dist/index.js 2.05 kB
packages/tooltip/dist/index.es.js 2.92 kB
packages/tooltip/dist/index.js 2.72 kB

compressed-size-action

}) {
return (
<Indent overflow={"hidden"}>
<Text className={styles.textCell} title={label}>
<Text className={styles.textCell} title={label} size={size} color={color}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that a similar thing is needed for renderCell/createStandardEditableTextCell as the default text size is not applied there

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Or wait. It is always supposed to be custom content on how to display the editable cell?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

renderCell already has full control over how to render the cell.
But yes, createStandardEditableTextCell should allow textSize as well.

I have added a commit.

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.

3 participants