Repository navigation
feat: add DelegateStateMixin and make other mixins use it - #2455
Merged
Merged
Conversation
vursen
requested review from
web-padawan
and removed request for
web-padawan
September 6, 2021 08:16
vursen
commented
Sep 6, 2021
vursen
force-pushed
the
feat/delegate-props-mixin
branch
2 times, most recently
from
September 6, 2021 10:19
101d4e9 to
dd834bf
Compare
vursen
marked this pull request as ready for review
September 6, 2021 10:21
vursen
force-pushed
the
feat/delegate-props-mixin
branch
from
September 6, 2021 10:25
dd834bf to
48f0e11
Compare
web-padawan
requested changes
Sep 6, 2021
|
Kudos, SonarCloud Quality Gate passed!
|
web-padawan
approved these changes
Sep 6, 2021
Collaborator
|
This ticket/PR has been released with platform 22.0.0.alpha3 and is also targeting the upcoming stable 22.0.0 version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Description
At this moment, there is only
ForwardInputPropsMixinfor delegation purposes and the problem is that it doesn't just delegate attributes to an input element but also defines new properties for a component, such asplaceholderfor example.There is coming
CheckedMixin(see #2210) and it needs to delegate some of its attributes to the checkbox input as well. However, it doesn't need theplaceholderattribute.Therefore it makes sense to have an abstract mixin that is only aimed at the delegation of a set of attributes/properties to a target element. The target element should be defined by the client component.
... so what was done in the PR?
DelegateStateMixinthat is supposed to be used for the delegation of attributes and properties from the host element to a target element (it was a part ofForwardInputPropsMixinbefore).ForwardInputPropsMixintoDelegateInputStateMixinthat now extendsDelegateStateMixin.InputConstraintsMixinto make it extendDelegateInputStateMixinand not the other way around (as it was before).ready()fromconnectedCallback()to initialize the mixins in the same order they are applied.Part of #2210
Type of change
Checklist