-
Notifications
You must be signed in to change notification settings - Fork 21
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
APP-2302 Migrate table to prime-core #323
Conversation
76577eb
to
7ec0ea1
Compare
packages/core/src/lib/index.ts
Outdated
export { default as TBody } from './table/tbody.svelte'; | ||
export { default as TD } from './table/td.svelte'; | ||
export { default as TH } from './table/th.svelte'; | ||
export { default as TR } from './table/tr.svelte'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking for better ideas for these exported names 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of my favorite UI libraries is Material UI. I like how they name their table components - Table
, TableBody
, TableRow
, etc: https://mui.com/material-ui/react-table/#api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
names updated to match! instead of TableHead
, I named TableHeader
and TableHeaderCell
const cols = ['20%', '30%', '50%']; | ||
const { container } = render(TableWith3Cols, { cols }); | ||
|
||
for (const [i, width] of cols.entries()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is recommended by the linter but using cols.entries()
is firing a different lint error about JS versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! What's the error? Let me know if you want to take a look together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the error is:
Type 'IterableIterator<[number, string]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
not sure which tag we should use to resolve -- what version of JS are we using?
8a5c5bb
to
f705d96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you! Could you please update the prime-core package version as well?
/** | ||
* Custom table body style | ||
* @example | ||
* style="border-collapse" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the intellisense look with this example? Should it be wrapped in a ``` block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const cols = ['20%', '30%', '50%']; | ||
const { container } = render(TableWith3Cols, { cols }); | ||
|
||
for (const [i, width] of cols.entries()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! What's the error? Let me know if you want to take a look together.
|
||
A table. | ||
```svelte | ||
<Table variant='fixed' cols=["30%", "30%", "40%"]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the fixed table behave when contents overflow a cell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questions
v-thead
-->THead
th
-->TH
tr
variant colors be updated?style
attribute on these components feels outdated, butclass
is a reserved word so cannot be exported as an attributearray.entries()
-- not sure how best to resolve?Changes