-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joern Turner
committed
Jul 19, 2024
1 parent
6d569e6
commit 27603bd
Showing
3 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: "Scopes" | ||
menuTitle: "" | ||
date: 2024-07-19T10:19:53+02:00 | ||
tags: [Guides] | ||
--- | ||
|
||
![Scopes](/images/scope1.svg) | ||
|
||
Each `<fx-fore>` element creates its own scope which controls: | ||
* access to data | ||
* evaluation of bindings | ||
* evaluation of ids | ||
* events | ||
|
||
For the above graphic that means that data, ids and bindings being used in the inner Fore are being resolved within | ||
its boundaries and events won't propagate upwards to the outer Fore. | ||
|
||
Likewise the outer Fore has no direct access to the inner Fore (unless using the API within a custom function). | ||
|
||
## Fore scopes versus shadowDOM | ||
|
||
Some background for the Web Components-savy: | ||
the content you put into a Fore element is not encapsulated in a shadowDOM but visible within | ||
the light or global DOM and therefore be styled without any restrictions with CSS. | ||
|
||
Using shadowDOM for style encapsulation is of less importance with the advent of nested CSS which | ||
makes it easy to achieve style-scoping. Otherwise it often creates problems with flexibility and is | ||
generally avoided throughout Fore. | ||
|
||
So unlike shadowDOM Fore allows for global styling. | ||
|
||
However like shadowDOM Fore events are scoped to the next parent `<fx-fore>` element and are not leaving | ||
its scope. | ||
|
||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: "<fx-repeatitem>" | ||
menuTitle: "" | ||
date: 2024-07-19T09:31:39+02:00 | ||
tags: [UI] | ||
weight: 46 | ||
--- | ||
|
||
## Description | ||
|
||
> `fx-repeatitem` is auto-created by `fx-repeat` and MUST NOT be used by page authors directly. | ||
When a `fx-repeat` is initialized it creates a `fx-repeatitem` for each bound node in the repeat nodeset using the repeat. | ||
The repeat template is instanciated once for the bound repeated node and stamped out as a `fx-repeatitem`. | ||
|
||
This element acts as a wrapper for repeated items and can receive the boolean attribute `repeat-index` when it | ||
is the currently selected item. By default after initialization the repeat index is always 1. | ||
|
||
|
||
## Attributes | ||
|
||
| Name | Description | | ||
|--------------|------------------------------------------------------------------------------------| | ||
| repeat-index | boolean attribute being present when the repeatitem is the currently selected one. | | ||
|
||
## Events | ||
|
||
| Name | Description | Details | ||
|--------------|-------------------------------------------------------|--- | | ||
| index-change | dispatched when a repeatitem is clicked or gets focus | 'item' - the repeatitem as node <br> 'index' - the index of the changed repeat item. | ||
|
||
|
||
## Examples | ||
|
||
See [repeat examples](https://jinntec.github.io/fore-docs/elements/ui/repeat/#examples) | ||
|
||
|