-
Notifications
You must be signed in to change notification settings - Fork 349
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
[IMP] parser: add support for user-space directives #1651
Merged
Merged
+221
−9
Conversation
This file contains 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
jpp-odoo
force-pushed
the
master-add_user_directives-jpp
branch
3 times, most recently
from
November 7, 2024 14:13
e0e4d78
to
f2eab03
Compare
If the user directives are defined on the app, doesn't that mean the entire feature is unavailable when precompiling? |
jpp-odoo
force-pushed
the
master-add_user_directives-jpp
branch
from
November 12, 2024 14:21
f2eab03
to
53807d8
Compare
kebeclibre
reviewed
Nov 13, 2024
jpp-odoo
force-pushed
the
master-add_user_directives-jpp
branch
from
November 13, 2024 10:42
6a19f9e
to
545cb32
Compare
jpp-odoo
force-pushed
the
master-add_user_directives-jpp
branch
2 times, most recently
from
November 21, 2024 13:17
9a824a6
to
7c17b7f
Compare
ged-odoo
reviewed
Nov 21, 2024
ged-odoo
reviewed
Nov 21, 2024
ged-odoo
reviewed
Nov 21, 2024
ged-odoo
reviewed
Nov 21, 2024
jpp-odoo
force-pushed
the
master-add_user_directives-jpp
branch
3 times, most recently
from
November 21, 2024 14:32
987429c
to
3c34085
Compare
This commit adds the support for custom directives. To use the custom directive, an Object of functions needs to be configured on the owl APP: ```js new App(..., { customDirectives: { test_directive: function (el, value) { el.setAttribute("t-on-click", value); return el; } } }); ``` The functions will be called when a custom directive with the name of the function is found. The original element will be replaced with the one returned by the function. This : ```xml <div t-custom-test_directive="click" /> ``` will be replace by : ```xml <div t-on-click="value"/> ``` issue : #1650
jpp-odoo
force-pushed
the
master-add_user_directives-jpp
branch
from
November 21, 2024 14:39
3c34085
to
a96815f
Compare
ged-odoo
reviewed
Nov 22, 2024
ged-odoo
reviewed
Nov 22, 2024
ged-odoo
reviewed
Nov 22, 2024
This commit, add a new configuration on the App: globalValues. It's a global object of elements available at compilations. For instance: ```js const app = new App(SomeComponent, { globalValues: { plop: (string: any) => { steps.push(string); }, }, }); ``` The plop function will be available at the compilation, so it can be used on the templates : ```xml <div t-on-click="() => __globals__.plop('click')" class="my-div"/> ```
jpp-odoo
force-pushed
the
master-add_user_directives-jpp
branch
from
November 25, 2024 08:55
a96815f
to
a903ccd
Compare
ged-odoo
approved these changes
Nov 25, 2024
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.
This commit adds the support for user-space directives. To use the user-space directive, an Object of functions needs to be configured on the owl APP:
The functions will be called when a user directive with the name of the function is found. The original element will be replaced with the one returned by the function.
This :
will be replace by :
issue : #1650