Juro Oravec
efd05d6150
feat: Typing for component inputs and access inputs during render ( #585 )
2024-08-22 23:42:34 +02:00
Juro Oravec
b8e92dac37
fix: Set Context.template
for components to work with include ( #582 )
2024-08-16 23:31:00 +02:00
Juro Oravec
e771a0aaaf
refactor: Use top-level exports as public API ( #562 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-03 08:30:39 +02:00
Juro Oravec
8cb88558f0
refactor: Prepare autodiscover and template loader for v1 ( #533 )
2024-07-29 20:27:35 +02:00
pre-commit-ci[bot]
49c4e84f07
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2024-06-11 19:43:02 +00:00
Juro Oravec
36cd6e3f06
refactor: compat with comp as view by reusing comp instance
2024-06-11 21:41:56 +02:00
Juro Oravec
5c89d4dbeb
refactor: pass slot data and slot default to slot render fn and rename LazySlot to SlotRef
2024-06-11 14:34:04 +02:00
Juro Oravec
40f4476993
refactor: add test for response_class
2024-06-02 16:37:22 +02:00
pre-commit-ci[bot]
a5a0c74d31
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2024-06-02 14:23:56 +00:00
Juro Oravec
5f07f3d4da
refactor: update tests
2024-06-02 16:22:49 +02:00
Juro Oravec
95f6554f4c
tests: Split test files and run template tests under both context behavior modes ( #509 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-28 08:23:32 +02:00
Juro Oravec
610475353f
feat: Support for HTML attributes and html_attrs
tag ( #491 )
2024-05-12 11:21:34 +02:00
pre-commit-ci[bot]
04d968ace9
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2024-05-02 20:34:46 +00:00
Juro Oravec
8c4a55901c
tests: add inline syntax highlight, inline template files
2024-05-02 22:33:02 +02:00
Juro Oravec
3fc90e4956
feat: merge context settings, replace if_filled tag with var
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-01 20:55:09 +02:00
Juro Oravec
981eb59cf1
feat: Allow multiple slots with the same name in the same template
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-29 15:09:25 +02:00
Juro Oravec
29c931f150
refactor: fix slot fills for components nested in themselves ( #456 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-25 20:36:05 +02:00
Juro Oravec
091da26da5
refactor: Tests cleanup and better test isolation ( #452 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-25 14:20:33 +02:00
Juro Oravec
ae22eff8af
refactor: fix context vars missing in isolated slot ( #455 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-25 12:08:20 +02:00
Juro Oravec
eb40afba7b
refactor: remove Django30CompatibleTestCase
2024-04-18 13:33:58 +02:00
Juro Oravec
bacd683c44
refactor: fix type imports in tests
2024-04-16 23:25:13 +02:00
pre-commit-ci[bot]
ab7f3e0cdb
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2024-04-16 23:25:13 +02:00
Juro Oravec
089cda54c5
refactor: fix tests
2024-04-16 23:25:13 +02:00
Juro Oravec
1dd492314a
refactor: use component_id instead of Template as slot fill cache key
2024-04-16 23:25:13 +02:00
Juro Oravec
3050dc71b9
refactor: add test
2024-04-11 23:44:36 +02:00
Juro Oravec
37fd901908
Resolve media and template files relative to component class dir ( #395 ), thanks @JuroOravec
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Emil Stenström <emil@emilstenstrom.se>
2024-03-23 19:01:39 +01:00
Emil Stenström
edf3885632
Replace all instances of component_block with component. Remove duplicate tests.
2024-02-21 22:38:06 +01:00
Emil Stenström
48fe8171b4
Reformat lines that became too long. And enforce 119 line length.
2024-02-21 22:38:06 +01:00
Dylan Castillo
70a2a01400
Implement single file components
2024-01-14 22:36:55 +01:00
lemontheme
a8dfcce24e
Introduce {% fill %} replacing 'fill' func of 'slot' tag
...
Partial implementation fill-tags plus update tests
Implement {% fill %} tags. Next: update tests.
Bring back support for {%slot%} blocks for bckwrd-compat and implement ambig. resolution policy
Update tests to use fill blocks. Add extra checks that raise errors
Add new tests for fill-slot nesting
Update README. Editing still required
remove unused var ctxt after flake8 complaint
fix flake8 warning about slotless f-string
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Add new slot aliases in fill context. Clean up rendering logic in Component. Update docs.
fix flake8, isort, black errors
Refactor duplicated name validation
Add if_filled tag + elif_filled...else_filled...endif_filled for cond. slots
Fix mistake in do_if_filled() docstring
Upload templates for tests! D'oh
Incorporate PR feedback
Drop Literal type hint; Use isort off-on instead of skip in tests
Treat all fill,slot,if_filled,component names as variables
Reset sampleproject components
Add test for variable filled name
Update examples in docs
2023-03-14 23:40:21 +01:00
Emil Stenström
36237f0752
Make Media.css and Media.js optional.
2023-02-09 22:15:47 +01:00
Emil Stenström
8af63ad3ad
Ignore type="text/css" in tests, it doesn't matter.
2022-12-25 23:00:59 +01:00
Emil Stenström
98ea9405f9
Fix test breakage when setting accessed before django.setup().
2022-07-14 09:29:00 +02:00
pre-commit-ci[bot]
0648ad9a93
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2021-09-10 11:12:26 +00:00
Real-Gecko
5fcabaa5ba
Renamed get_context
to get_context_data
2021-09-10 11:27:55 +02:00
Emil Stenström
5b9188cc9c
Refactored Component class
...
# Conflicts:
# README.md
# pyproject.toml
2021-09-10 11:27:28 +02:00
rbeard0330
e3c9ac76ce
Fix infinite recursion bug ( fixes #68 ) ( #74 )
...
* Add regression test for recursion bug, #68
* Only allow slots to access slot nodelists provided to their immediate parent component to prevent infinite recursions.
* Fix import ordering bug in test
* Add slot.super to docs
Remove unused imports
* Bump version
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-07-06 11:56:49 -04:00
rbeard0330
070b754d24
Improve slot handling to allow nested components, conditional slots, and slot.super ( Fixes #33 , #34 , #37 )
...
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-05-26 00:59:46 +02:00
Emil Stenström
97777d3318
Use simplified style to define Media.
2021-03-10 22:42:35 +01:00
Emil Stenström
b8f14404ac
Allow simpler definition of Media class.
2021-03-10 22:36:42 +01:00
Emil Stenström
c0c5a94908
Rename duplicate ComponentRegistryTest.
...
Also move registry test to registry.
2021-03-10 12:25:28 +01:00
Emil Stenström
b9446c2818
Add support for calling register as a decorator ( #38 )
2021-02-27 16:38:16 +01:00
Dan Jacob
10a117ee88
Class decorator and test
2021-02-27 16:49:06 +02:00
Emil Stenström
475bc8720f
Add tests for components with dynamic template.
2021-02-20 10:04:10 +01:00
Emil Stenström
26f39c73f3
This is a difference between Django 3.0 and 3.1.
2021-02-15 21:22:07 +01:00
Emil Stenström
07986c5216
Caching templates to allow for dynamic template generation
...
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-02-15 21:07:14 +01:00
rbeard0330
87f9994c81
Performance (+50%): Compile ComponentNode at creation, not render ( #22 )
...
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-02-06 10:09:57 +01:00
rbeard0330
2633c3f08f
Pass context into component tags by default, and let components disable with "only" ( #20 )
...
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-01-25 12:31:54 +01:00
rbeard0330
93b8a7404a
Rework of context handling ( #18 )
...
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2020-12-28 10:40:35 +01:00
Emil Stenström
e9fba9538f
Add trick to make tests pass on Django 1.11 too.
2020-12-08 23:33:36 +01:00