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

DO NOT MERGE ! - Extend web components GSGMF 1650 #281

Closed
wants to merge 10 commits into from

Conversation

ger-benjamin
Copy link
Member

@ger-benjamin ger-benjamin commented Nov 16, 2021

For: GSGMF-1650

See also (updated doc) camptocamp/c2cgeoportal#8911

See commit message to understand the history of changes.

I was able to:

  • Override methods in a lit component
  • Override methods in an AngularJS component (still works)
  • Extends a lit component
  • Override methods of a model
  • Override methods of a "service"
  • Set css of a lit component via the vars (long but no need to override elements)
  • Set the css inside the overriden element itself (quicker for overridden elements)
  • Set the css by appending a style in a selected element querySelector (querySelector('...').shadowRoot.appendChild. It work on multiple nested level of Shadow DOM as our component are in an open mode. Should also work with a CSSStyleSheet)

Well, I had no real problem to do the changes.

Maybe it would be great to split long render method to multiple small methods.
(As it should be already the case for other methods and especially long constructor (not modifiable))

Result of my changes:

Screenshot from 2021-11-16 15-56-13

Screenshot from 2021-11-16 15-44-25

@ger-benjamin ger-benjamin changed the title DO NOT MERE ! - Extend web components GSGMF 1650 DO NOT MERGE ! - Extend web components GSGMF 1650 Nov 16, 2021
@ger-benjamin ger-benjamin force-pushed the extend_web_components_GSGMF-1650 branch from 54e03bc to 53cf718 Compare November 17, 2021 07:00
@ger-benjamin
Copy link
Member Author

No need to merge, only a demo POC. I close.

@ger-benjamin ger-benjamin deleted the extend_web_components_GSGMF-1650 branch November 19, 2021 09:57
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.

1 participant