trimble-oss / modus-web-components

This library provides Modus components as web components - reusable, encapsulated UI elements that are framework agnostic (can be implemented in any site).
https://modus-web-components.trimble.com/
MIT License
34 stars 71 forks source link

SPIKE: Add custom HTML to table cell #2488

Open enowak1031 opened 5 months ago

enowak1031 commented 5 months ago

Related to #1923

cjwinsor commented 5 months ago

https://tanstack.com/table/latest/docs/guide/column-defs#column-formatting--rendering

Purpose of this spike is to determine what options we have to support custom cell rendering. Can we give our users a prop that they provide the function to render? If you build the library in react and angular, does it still work? Once we determine the solution, we can create a new issue to implement into MWC.

ElishaSamPeterPrabhu commented 4 months ago

Tanstack API list consists of this flexRender which renders cell content https://tanstack.com/table/v8/docs/api/core/cell Status (so far): Unable to the api in our imported "table-core" , it is specfically available in "react-table"

We can do something similar to table-cell-formatter.tsx to flexRenderer where the code is taken from - https://github.com/TanStack/table/blob/main/packages/react-table/src/index.tsx FlexRenderer code available in - https://github.com/TanStack/table/blob/main/packages/angular-table/src/flex-render.ts

or we can stick to the current InnerHtml approach