Skip to content

Commit 8a5f554

Browse files
committed
feat(core): rename fromChild() -> fromDescendant(), fromChildren() ->
fromDescendants() for precise term
1 parent 0b9c151 commit 8a5f554

File tree

197 files changed

+546
-7925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+546
-7925
lines changed

docs-src/components/module-catalog/module-catalog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Component, component, fromChildren, pass } from '../../..'
1+
import { type Component, component, fromDescendants, pass } from '../../..'
22

33
export type ModuleCatalogProps = {
44
total: number
@@ -7,7 +7,7 @@ export type ModuleCatalogProps = {
77
export default component(
88
'product-catalog',
99
{
10-
total: fromChildren<number, HTMLElement & { value: number }>(
10+
total: fromDescendants<number, HTMLElement & { value: number }>(
1111
'form-spinbutton',
1212
(sum, item) => sum + item.value,
1313
0,

docs-src/pages/api.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ description: 'Functions, types, and constants'
1919

2020
## Component
2121

22-
Create a Web Component of type [Component](api/type-aliases/Component.html):
22+
Create a Web Component of type [Component](api/type-aliases/Component.html) with reactive properties that extend [ComponentProps](api/type-aliases/ComponentProps.html).
2323

2424
- [component](api/functions/component.html)
2525

@@ -29,28 +29,28 @@ Create a Web Component of type [Component](api/type-aliases/Component.html):
2929

3030
## Signals
3131

32-
Create a signal of type [Signal](api/type-aliases/Signal.html):
32+
Create a signal of type [Signal](api/type-aliases/Signal.html).
3333

34-
- [computed](api/functions/computed.html)
35-
- [selection](api/functions/selection.html)
36-
- [sensor](api/functions/sensor.html)
37-
- [state](api/functions/state.html)
34+
- [computed](api/functions/computed.html) creates a [Computed](api/type-aliases/Computed.html) signal derived from other signals
35+
- [selection](api/functions/selection.html) creates a [Computed](api/type-aliases/Computed.html) signal that updates according to a dynamic CSS selector
36+
- [sensor](api/functions/sensor.html) creates a [Computed](api/type-aliases/Computed.html) signal that updates according to events
37+
- [state](api/functions/state.html) creates a [State](api/type-aliases/State.html) signal
3838

3939
Helper functions:
4040

41-
- [isComputed](api/functions/isComputed.html)
42-
- [isSignal](api/functions/isSignal.html)
43-
- [isState](api/functions/isState.html)
41+
- [isComputed](api/functions/isComputed.html) checks whether a value is a [Computed](api/type-aliases/Computed.html) signal
42+
- [isSignal](api/functions/isSignal.html) checks whether a value is a [Signal](api/type-aliases/Signal.html)
43+
- [isState](api/functions/isState.html) checks whether a value is a [State](api/type-aliases/State.html) signal
4444

4545
</section>
4646

4747
<section>
4848

4949
## Attribute Parsers
5050

51-
Declare how attributes are parsed. Variable of type or function returning [AttributeParser](api/type-aliases/AttributeParser.html):
51+
Declare how attributes are parsed. Functions returning [AttributeParser](api/type-aliases/AttributeParser.html) that will be used to create [State](api/type-aliases/State.html) signals as reactive properties on the component.
5252

53-
- [asBoolean](api/variables/asBoolean.html)
53+
- [asBoolean](api/functions/asBoolean.html)
5454
- [asEnum](api/functions/asEnum.html)
5555
- [asInteger](api/functions/asInteger.html)
5656
- [asJSON](api/functions/asJSON.html)
@@ -65,11 +65,11 @@ Declare how attributes are parsed. Variable of type or function returning [Attri
6565

6666
Declare how signals are initialized. Variable of type or function returning [SignalInitializer](api/type-aliases/SignalInitializer.html):
6767

68-
- [consume](api/functions/consume.html)
69-
- [fromChild](api/functions/fromChild.html)
70-
- [fromChildren](api/functions/fromChildren.html)
71-
- [fromEvent](api/functions/fromEvent.html)
72-
- [fromSelector](api/functions/fromSelector.html)
68+
- [fromContext](api/functions/fromContext.html) consumes a context value from nearest ancestor context provider component
69+
- [fromDescendant](api/functions/fromDescendant.html) gets a reactive property of a descendant component
70+
- [fromDescendants](api/functions/fromDescendants.html) reduces properties of a collection of descendant elements to a single value
71+
- [fromEvent](api/functions/fromEvent.html) creates a computed signal from an event handler on a descendant element
72+
- [fromSelector](api/functions/fromSelector.html) creates a computed signal of descentant elements matching a CSS selector
7373

7474
</section>
7575

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[**@zeix/ui-element**](../README.md)
2+
3+
***
4+
5+
[@zeix/ui-element](../globals.md) / asBoolean
6+
7+
# Function: asBoolean()
8+
9+
> **asBoolean**(): [`AttributeParser`](../type-aliases/AttributeParser.md)\<`boolean`\>
10+
11+
Defined in: [src/lib/parsers.ts:23](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/lib/parsers.ts#L23)
12+
13+
Parse a boolean attribute as an actual boolean value
14+
15+
## Returns
16+
17+
[`AttributeParser`](../type-aliases/AttributeParser.md)\<`boolean`\>
18+
19+
## Since
20+
21+
0.13.1

docs-src/pages/api/functions/asEnum.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **asEnum**(`valid`): [`AttributeParser`](../type-aliases/AttributeParser.md)\<`string`\>
1010
11-
Defined in: [src/lib/parsers.ts:86](https://github.com/zeixcom/ui-element/blob/ef7525ef4fcd5329d68c2b65cc085220a29b7a4f/src/lib/parsers.ts#L86)
11+
Defined in: [src/lib/parsers.ts:86](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/lib/parsers.ts#L86)
1212

1313
Parse an attribute as a multi-state value (for examnple: true, false, mixed), defaulting to the first valid option
1414

docs-src/pages/api/functions/asInteger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **asInteger**(`fallback?`): [`AttributeParser`](../type-aliases/AttributeParser.md)\<`number`\>
1010
11-
Defined in: [src/lib/parsers.ts:37](https://github.com/zeixcom/ui-element/blob/ef7525ef4fcd5329d68c2b65cc085220a29b7a4f/src/lib/parsers.ts#L37)
11+
Defined in: [src/lib/parsers.ts:37](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/lib/parsers.ts#L37)
1212

1313
Parse an attribute as as number forced to integer with a fallback
1414

docs-src/pages/api/functions/asJSON.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **asJSON**\<`T`\>(`fallback`): [`AttributeParser`](../type-aliases/AttributeParser.md)\<`T`\>
1010
11-
Defined in: [src/lib/parsers.ts:104](https://github.com/zeixcom/ui-element/blob/ef7525ef4fcd5329d68c2b65cc085220a29b7a4f/src/lib/parsers.ts#L104)
11+
Defined in: [src/lib/parsers.ts:104](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/lib/parsers.ts#L104)
1212

1313
Parse an attribute as a JSON serialized object with a fallback
1414

docs-src/pages/api/functions/asNumber.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **asNumber**(`fallback?`): [`AttributeParser`](../type-aliases/AttributeParser.md)\<`number`\>
1010
11-
Defined in: [src/lib/parsers.ts:62](https://github.com/zeixcom/ui-element/blob/ef7525ef4fcd5329d68c2b65cc085220a29b7a4f/src/lib/parsers.ts#L62)
11+
Defined in: [src/lib/parsers.ts:62](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/lib/parsers.ts#L62)
1212

1313
Parse an attribute as as number with a fallback
1414

docs-src/pages/api/functions/asString.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **asString**(`fallback?`): [`AttributeParser`](../type-aliases/AttributeParser.md)\<`string`\>
1010
11-
Defined in: [src/lib/parsers.ts:74](https://github.com/zeixcom/ui-element/blob/ef7525ef4fcd5329d68c2b65cc085220a29b7a4f/src/lib/parsers.ts#L74)
11+
Defined in: [src/lib/parsers.ts:74](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/lib/parsers.ts#L74)
1212

1313
Parse an attribute as a string with a fallback
1414

docs-src/pages/api/functions/component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **component**\<`P`\>(`name`, `init`, `setup`): [`Component`](../type-aliases/Component.md)\<`P`\>
1010
11-
Defined in: [src/component.ts:279](https://github.com/zeixcom/ui-element/blob/ef7525ef4fcd5329d68c2b65cc085220a29b7a4f/src/component.ts#L279)
11+
Defined in: [src/component.ts:279](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/component.ts#L279)
1212

1313
Define a component with its states and setup function (connectedCallback)
1414

docs-src/pages/api/functions/dangerouslySetInnerHTML.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **dangerouslySetInnerHTML**\<`P`, `E`\>(`s`, `options`): [`FxFunction`](../type-aliases/FxFunction.md)\<`P`, `E`\>
1010
11-
Defined in: [src/lib/effects.ts:448](https://github.com/zeixcom/ui-element/blob/ef7525ef4fcd5329d68c2b65cc085220a29b7a4f/src/lib/effects.ts#L448)
11+
Defined in: [src/lib/effects.ts:448](https://github.com/zeixcom/ui-element/blob/0b9c1517fa2a3615fdcca3ecc679ebb5c5c255e7/src/lib/effects.ts#L448)
1212

1313
Set inner HTML of an element
1414

0 commit comments

Comments
 (0)