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

Calcite Table Header Slots #8901

Open
2 of 6 tasks
jfelicianiats opened this issue Mar 7, 2024 · 5 comments
Open
2 of 6 tasks

Calcite Table Header Slots #8901

jfelicianiats opened this issue Mar 7, 2024 · 5 comments
Labels
0 - new New issues that need assignment. blocked This issue is blocked by another issue. c-table Issues that pertain to the calcite-table and related components calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - low Issue is non core or affecting less that 10% of people using the library
Milestone

Comments

@jfelicianiats
Copy link

Check existing issues

Description

I would like to be able to have slotted access to the heading and description of calcite-table-header components similar to table-items. Currently, you can only set this by passing a string to the heading and description props.

Acceptance Criteria

You are able to use slots to fill the heading and description table header properties.

Relevant Info

No response

Which Component

calcite-table-header

Example Use Case

<calcite-table-header>
   <span slot="heading">My column header</span>
   <span slot="description">My column description</span>
</calcite-table-header>

Priority impact

p2 - want for current milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

N/A

@jfelicianiats jfelicianiats added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels Mar 7, 2024
@github-actions github-actions bot added impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone calcite-components Issues specific to the @esri/calcite-components package. labels Mar 7, 2024
@macandcheese
Copy link
Contributor

We've planned to add additional content / actions slots to Table Header (#7630), to support additional functionality for users, but we are not planning on slots for the Title / Description (at this time). Do you have an example of the design you are trying to achieve?

@jfelicianiats
Copy link
Author

@macandcheese My main goal currently is to append an icon to the table header to show sort direction of columns. I figured slots would be my best guess to implement this but there weren't any for headers. As for a proposed design, the current is fine I just need to be able to render html in the current places where the heading and description props currently go.

@macandcheese
Copy link
Contributor

Thanks for the follow up. Are you managing the column sort yourself at this time? We do plan to build in sorting functionality which would have a built-in visual / affordance. As an interim solution, if you are managing the column sort yourself, you could render up / down arrows in the heading / description property strings with character codes &#8593; etc.

@jfelicianiats
Copy link
Author

jfelicianiats commented Mar 8, 2024

@macandcheese I am currently using the calcite table in a nuxtjs (vue framework) application in conjunction with https://tanstack.com/table/latest to build my own datatable. The library I am using also has render functions that come along with it for the content of table headers and cell content. The example below shows how I render table cell content and how I would like to be able to render table header content. The inner div specifying the width is the approach similar to what you recommended in #7894 (comment) but is a separate issue.

(ie. the <FlexRender> component.)

<!-- Table Headers - Currently no support for slotting content in (Ideally I could pass in the <FlexRender> component)-->
<calcite-table-header heading="Heading" description="Description"></calcite-table-header>

<!-- ... -->

<!-- Table Cells -->
 <calcite-table-cell
  v-for="cell in row.getVisibleCells()"
  :key="cell.id"
>
  <div
    class="truncate"
    :style="{
      width: cell.column.getSize()
        ? `${cell.column.getSize()}px`
        : '',
    }"
  >
    <FlexRender
      :render="cell.column.columnDef.cell"
      :props="cell.getContext()"
    />
  </div>
</calcite-table-cell>

@jfelicianiats jfelicianiats reopened this Mar 8, 2024
@macandcheese macandcheese added the c-table Issues that pertain to the calcite-table and related components label Mar 8, 2024
@geospatialem geospatialem added p - low Issue is non core or affecting less that 10% of people using the library estimate - 5 A few days of work, definitely requires updates to tests. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed needs triage Planning workflow - pending design/dev review. labels Aug 27, 2024
@geospatialem geospatialem removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Sep 10, 2024
@macandcheese
Copy link
Contributor

Blocked by #6646

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. blocked This issue is blocked by another issue. c-table Issues that pertain to the calcite-table and related components calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - low Issue is non core or affecting less that 10% of people using the library
Projects
None yet
Development

No branches or pull requests

3 participants