Skip to content

Commit

Permalink
filled some doc gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Joern Turner committed Jul 19, 2024
1 parent 6d569e6 commit 27603bd
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 4 deletions.
37 changes: 37 additions & 0 deletions content/architecture/scopes/_index.md
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.



11 changes: 7 additions & 4 deletions content/elements/ui/case/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ Defines one 'page' of a `fx-switch` element.

## Attributes

| Name | Description |
|------|-------------|
| label | optional label |
| name | a unique name to be used with `fx-toggle` |
| Name | Description |
|------|--------------------------------------------------------------|
| label | optional label |
| name | a unique name to be used with `fx-toggle` |
| selector | a CSS selector to select a certain element from external src |
| src | a URL being used for fetching the content of a case |


## Events

Expand Down
37 changes: 37 additions & 0 deletions content/elements/ui/repeatitem/_index.md
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)


0 comments on commit 27603bd

Please sign in to comment.