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

APP-2302 Migrate table to prime-core #323

Merged
merged 5 commits into from
Aug 21, 2023
Merged

Conversation

ehhong
Copy link
Member

@ehhong ehhong commented Aug 14, 2023

Questions

  • I don't love the exported names that follow the capitalization convention:
    • v-thead --> THead
    • th --> TH
    • any ideas for what we should do instead?
  • Should tr variant colors be updated?
  • the style attribute on these components feels outdated, but class is a reserved word so cannot be exported as an attribute
  • lint error for using array.entries() -- not sure how best to resolve?
Type 'IterableIterator<[number, string]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.

Changes

  • Fixed + added some documentation for context menu

@ehhong ehhong force-pushed the APP-2302 branch 2 times, most recently from 76577eb to 7ec0ea1 Compare August 16, 2023 16:33
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';
Copy link
Member Author

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 👀

Copy link
Contributor

@ethanlookpotts ethanlookpotts Aug 16, 2023

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

Copy link
Member Author

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()) {
Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Member Author

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?

@ehhong ehhong force-pushed the APP-2302 branch 2 times, most recently from 8a5c5bb to f705d96 Compare August 17, 2023 15:53
Copy link
Contributor

@ethanlookpotts ethanlookpotts left a 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"
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

with @example
image

with ```
image

updating everything to ``` -- it looks cleaner

const cols = ['20%', '30%', '50%'];
const { container } = render(TableWith3Cols, { cols });

for (const [i, width] of cols.entries()) {
Copy link
Contributor

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%"]>
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

it wraps to maintain the widths, this example is with widths 10% and 90%
image

@ehhong ehhong merged commit 427d178 into viamrobotics:main Aug 21, 2023
5 checks passed
@ehhong ehhong deleted the APP-2302 branch August 21, 2023 16:40
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.

2 participants