-
Notifications
You must be signed in to change notification settings - Fork 12
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
Inline-Editing: allow client to provide custom components #33
base: playground
Are you sure you want to change the base?
Conversation
Thank you! It's a great implementation. Since you have two commits that somewhat overlap, it might be easier to see the detailed suggestions here in this temporary branch (some are just for suggesting an alternative name and a few are changes to the parts that where not part of your commits): The only major change is the removal of the |
Nice, thank you for the review and changes! It is cool learning more about javascript and Svelte performance. It looks like you made a lot of the changes in your suggestions commit, so I resolved the related conversations. I will pull your commit into my branch, and I will work on the remaining changes. |
Hi @muonw-public, all previous feedback has been addressed, so this PR should be good to land when you get a chance to do a final check. Let me know if there is anything else you would like to see, or if I can help in any way. Thanks! |
It's unclear how to preserve the integrity of data with this change. In particular, if we have |
I took a stab at resolving #29, which allows users to use a custom component when editing a cell in the table. My approach was to create an object for
edit
related configuration in theInstructs
interface. This gives a user almost full control over how they want editing to work, and leaves room for more capabilities and tuning in the future.Check the updated
example7/
code for full context, but below gives a quick idea of the end result.We add a custom component for the
![image](https://private-user-images.githubusercontent.com/16587643/264544739-91a24082-4675-4b5b-a5c2-62c0754c19b5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxMjk2NzQsIm5iZiI6MTcyNjEyOTM3NCwicGF0aCI6Ii8xNjU4NzY0My8yNjQ1NDQ3MzktOTFhMjQwODItNDY3NS00YjViLWE1YzItNjJjMDc1NGMxOWI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEyVDA4MjI1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAyNDA2NDlkY2NiNGFiNDA2MGM3ZjM4OWNlNjA2MGYzZGIwZGJiNjI4Mzc0Njg2ZmNjY2YwOGRhYzM5YTAzN2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gkKzn909cFFB5X2NkrbsKTiItjzxWNfO0mOAJY9bCQA)
favoriteColor
column that is a dropdown menuChanges
EditBlock
component encapsulates the default textarea edit behaviorClient/User Breakage
rowClicked
eventB2. Clients usingdataComponent
s will get warning<component> was created with unknown prop 'instructs'
(this can be easily reverted)Notes
N0. This is a larger change than initially anticipated, and as such it introduces slightly different behavior. If the change are too much, or not the right approach, I am happy to rework anything.
N1.
Adding theCell
interface made documentation and user adoption of the edit component a bit easier, but maybe isn't the right naming or approach. I didn't see any way to inhertance or templating in Sveltefixes #29