@fluffjs/fluff 0.0.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.min.js +1 -0
- package/decorators/Component.d.ts +0 -1
- package/decorators/Component.js +0 -3
- package/decorators/HostBinding.d.ts +4 -0
- package/decorators/HostBinding.js +3 -10
- package/decorators/HostListener.d.ts +4 -0
- package/decorators/HostListener.js +3 -10
- package/decorators/Input.d.ts +1 -1
- package/decorators/Input.js +2 -16
- package/decorators/InputOutputHelper.d.ts +1 -0
- package/decorators/InputOutputHelper.js +18 -0
- package/decorators/MetadataArrayHelper.d.ts +4 -0
- package/decorators/MetadataArrayHelper.js +14 -0
- package/decorators/Output.d.ts +1 -1
- package/decorators/Output.js +2 -16
- package/decorators/ViewChild.d.ts +4 -0
- package/decorators/ViewChild.js +3 -10
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/interfaces/BreakMarkerConfig.d.ts +3 -0
- package/interfaces/BreakMarkerConfig.js +1 -0
- package/interfaces/FluffHostElement.d.ts +5 -0
- package/interfaces/FluffHostElement.js +1 -0
- package/interfaces/ForMarkerConfig.d.ts +8 -0
- package/interfaces/ForMarkerConfig.js +1 -0
- package/interfaces/IfMarkerConfig.d.ts +7 -0
- package/interfaces/IfMarkerConfig.js +1 -0
- package/interfaces/MarkerConfig.d.ts +6 -0
- package/interfaces/MarkerConfig.js +1 -0
- package/interfaces/PropertyChain.d.ts +1 -0
- package/interfaces/PropertyChain.js +1 -0
- package/interfaces/RenderContext.d.ts +3 -0
- package/interfaces/RenderContext.js +1 -0
- package/interfaces/SwitchMarkerConfig.d.ts +10 -0
- package/interfaces/SwitchMarkerConfig.js +1 -0
- package/interfaces/TextMarkerConfig.d.ts +9 -0
- package/interfaces/TextMarkerConfig.js +1 -0
- package/package.json +1 -1
- package/runtime/BreakController.d.ts +8 -0
- package/runtime/BreakController.js +13 -0
- package/runtime/FluffBase.d.ts +40 -0
- package/runtime/FluffBase.js +271 -0
- package/runtime/FluffElement.d.ts +5 -39
- package/runtime/FluffElement.js +3 -272
- package/runtime/FluffElementImpl.d.ts +49 -0
- package/runtime/FluffElementImpl.js +315 -0
- package/runtime/FluffMarkers.d.ts +8 -0
- package/runtime/FluffMarkers.js +8 -0
- package/runtime/ForController.d.ts +10 -0
- package/runtime/ForController.js +43 -0
- package/runtime/IfController.d.ts +10 -0
- package/runtime/IfController.js +46 -0
- package/runtime/MarkerConfigGuards.d.ts +15 -0
- package/runtime/MarkerConfigGuards.js +20 -0
- package/runtime/MarkerController.d.ts +46 -0
- package/runtime/MarkerController.js +235 -0
- package/runtime/MarkerManager.d.ts +16 -0
- package/runtime/MarkerManager.js +136 -0
- package/runtime/MarkerManagerInterface.d.ts +4 -0
- package/runtime/MarkerManagerInterface.js +1 -0
- package/runtime/ScopeRegistry.d.ts +9 -0
- package/runtime/ScopeRegistry.js +13 -0
- package/runtime/SwitchController.d.ts +9 -0
- package/runtime/SwitchController.js +42 -0
- package/runtime/TextController.d.ts +10 -0
- package/runtime/TextController.js +53 -0
- package/runtime/tests/DirectOutputChild.d.ts +10 -0
- package/runtime/tests/DirectOutputChild.js +14 -0
- package/runtime/tests/DirectOutputParent.d.ts +9 -0
- package/runtime/tests/DirectOutputParent.js +17 -0
- package/runtime/tests/TaskStats.d.ts +9 -0
- package/runtime/tests/TaskStats.js +1 -0
- package/runtime/tests/TestChildTasksListComponent.d.ts +8 -0
- package/runtime/tests/TestChildTasksListComponent.js +28 -0
- package/runtime/tests/TestForChildComponent.d.ts +6 -0
- package/runtime/tests/TestForChildComponent.js +10 -0
- package/runtime/tests/TestForComponent.d.ts +6 -0
- package/runtime/tests/TestForComponent.js +21 -0
- package/runtime/tests/TestForReinsertBindsInputParentComponent.d.ts +12 -0
- package/runtime/tests/TestForReinsertBindsInputParentComponent.js +57 -0
- package/runtime/tests/TestForTextMarkerCollisionNoTrackParentComponent.d.ts +8 -0
- package/runtime/tests/TestForTextMarkerCollisionNoTrackParentComponent.js +29 -0
- package/runtime/tests/TestForTextMarkerCollisionParentComponent.d.ts +9 -0
- package/runtime/tests/TestForTextMarkerCollisionParentComponent.js +46 -0
- package/runtime/tests/TestForUnsubscribeNestedParentComponent.d.ts +8 -0
- package/runtime/tests/TestForUnsubscribeNestedParentComponent.js +35 -0
- package/runtime/tests/TestGetterReactivityComponent.d.ts +9 -0
- package/runtime/tests/TestGetterReactivityComponent.js +27 -0
- package/runtime/tests/TestIfReinsertBindsInputChildComponent.d.ts +9 -0
- package/runtime/tests/TestIfReinsertBindsInputChildComponent.js +39 -0
- package/runtime/tests/TestIfReinsertBindsInputParentComponent.d.ts +12 -0
- package/runtime/tests/TestIfReinsertBindsInputParentComponent.js +54 -0
- package/runtime/tests/TestIfUnsubscribeNestedParentComponent.d.ts +8 -0
- package/runtime/tests/TestIfUnsubscribeNestedParentComponent.js +32 -0
- package/runtime/tests/TestLateDefineForChildComponent.d.ts +6 -0
- package/runtime/tests/TestLateDefineForChildComponent.js +10 -0
- package/runtime/tests/TestLateDefineForComponent.d.ts +9 -0
- package/runtime/tests/TestLateDefineForComponent.js +25 -0
- package/runtime/tests/TestNullInputTextComponent.d.ts +14 -0
- package/runtime/tests/TestNullInputTextComponent.js +37 -0
- package/runtime/tests/TestOutputBindingChildComponent.d.ts +10 -0
- package/runtime/tests/TestOutputBindingChildComponent.js +20 -0
- package/runtime/tests/TestOutputBindingParentComponent.d.ts +13 -0
- package/runtime/tests/TestOutputBindingParentComponent.js +38 -0
- package/runtime/tests/TestParentBindsTasksComponent.d.ts +7 -0
- package/runtime/tests/TestParentBindsTasksComponent.js +22 -0
- package/runtime/tests/TestSwitchReinsertBindsInputChildComponent.d.ts +9 -0
- package/runtime/tests/TestSwitchReinsertBindsInputChildComponent.js +39 -0
- package/runtime/tests/TestSwitchReinsertBindsInputParentComponent.d.ts +12 -0
- package/runtime/tests/TestSwitchReinsertBindsInputParentComponent.js +65 -0
- package/runtime/tests/TestSwitchUnsubscribeNestedParentComponent.d.ts +8 -0
- package/runtime/tests/TestSwitchUnsubscribeNestedParentComponent.js +42 -0
- package/runtime/tests/TestTemplateNestedMarkersComponent.d.ts +11 -0
- package/runtime/tests/TestTemplateNestedMarkersComponent.js +39 -0
- package/runtime/tests/TestUnsubscribeNestedChildComponent.d.ts +11 -0
- package/runtime/tests/TestUnsubscribeNestedChildComponent.js +43 -0
- package/runtime/tests/TestUnsubscribeNestedGrandchildComponent.d.ts +9 -0
- package/runtime/tests/TestUnsubscribeNestedGrandchildComponent.js +39 -0
- package/runtime/tests/TestUnsubscribeNestedParentBaseComponent.d.ts +8 -0
- package/runtime/tests/TestUnsubscribeNestedParentBaseComponent.js +33 -0
- package/utils/DomUtils.d.ts +3 -0
- package/utils/DomUtils.js +6 -0
- package/utils/Property.d.ts +8 -3
- package/utils/Property.js +26 -20
- package/utils/Publisher.d.ts +2 -1
- package/utils/Publisher.js +16 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
3
|
+
export class TestForComponent extends FluffElement {
|
|
4
|
+
items = ['a', 'b', 'c'];
|
|
5
|
+
__render() {
|
|
6
|
+
this.__getShadowRoot().innerHTML = `
|
|
7
|
+
<!--fluff:for:0-->
|
|
8
|
+
<!--/fluff:for:0-->
|
|
9
|
+
<template data-fluff-tpl="test-for-component-0">
|
|
10
|
+
<test-for-child data-lid="l0"></test-for-child>
|
|
11
|
+
</template>
|
|
12
|
+
`;
|
|
13
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
14
|
+
[0, { type: 'for', iterator: 'item', iterableExprId: 0, deps: ['items'], hasEmpty: false }]
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
__setupBindings() {
|
|
18
|
+
this.__initializeMarkers(MarkerManager);
|
|
19
|
+
super.__setupBindings();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
2
|
+
import type { TaskStats } from './TaskStats.js';
|
|
3
|
+
export declare class TestForReinsertBindsInputParentComponent extends FluffElement {
|
|
4
|
+
private readonly __items;
|
|
5
|
+
private readonly __stats;
|
|
6
|
+
get items(): number[];
|
|
7
|
+
set items(value: number[]);
|
|
8
|
+
get stats(): TaskStats;
|
|
9
|
+
set stats(value: TaskStats);
|
|
10
|
+
protected __render(): void;
|
|
11
|
+
protected __setupBindings(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestForReinsertBindsInputParentComponent extends FluffElement {
|
|
5
|
+
__items = new Property({ initialValue: [0], propertyName: 'items' });
|
|
6
|
+
__stats = new Property({
|
|
7
|
+
initialValue: {
|
|
8
|
+
total: 8,
|
|
9
|
+
byStatus: { 'todo': 0, 'in-progress': 0, 'done': 8 },
|
|
10
|
+
byPriority: { 'low': 0, 'medium': 0, 'high': 0, 'urgent': 0 },
|
|
11
|
+
overdue: 0,
|
|
12
|
+
dueToday: 0
|
|
13
|
+
},
|
|
14
|
+
propertyName: 'stats'
|
|
15
|
+
});
|
|
16
|
+
get items() {
|
|
17
|
+
return this.__items.getValue() ?? [];
|
|
18
|
+
}
|
|
19
|
+
set items(value) {
|
|
20
|
+
this.__items.setValue(value);
|
|
21
|
+
}
|
|
22
|
+
get stats() {
|
|
23
|
+
return this.__stats.getValue() ?? {
|
|
24
|
+
total: 0,
|
|
25
|
+
byStatus: { 'todo': 0, 'in-progress': 0, 'done': 0 },
|
|
26
|
+
byPriority: { 'low': 0, 'medium': 0, 'high': 0, 'urgent': 0 },
|
|
27
|
+
overdue: 0,
|
|
28
|
+
dueToday: 0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
set stats(value) {
|
|
32
|
+
this.__stats.setValue(value);
|
|
33
|
+
}
|
|
34
|
+
__render() {
|
|
35
|
+
this.__getShadowRoot().innerHTML = `
|
|
36
|
+
<!--fluff:for:0-->
|
|
37
|
+
<!--/fluff:for:0-->
|
|
38
|
+
<template data-fluff-tpl="test-for-reinsert-binds-input-parent-0">
|
|
39
|
+
<test-if-reinsert-binds-input-child x-fluff-component data-lid="l0"></test-if-reinsert-binds-input-child>
|
|
40
|
+
</template>
|
|
41
|
+
<template data-fluff-empty="test-for-reinsert-binds-input-parent-0">
|
|
42
|
+
<div class="empty">empty</div>
|
|
43
|
+
</template>
|
|
44
|
+
`;
|
|
45
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
46
|
+
[0, { type: 'for', iterator: 'item', iterableExprId: 0, deps: ['items'], hasEmpty: true }]
|
|
47
|
+
]));
|
|
48
|
+
const bindings = {
|
|
49
|
+
l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
|
|
50
|
+
};
|
|
51
|
+
Reflect.set(this.constructor, '__bindings', bindings);
|
|
52
|
+
}
|
|
53
|
+
__setupBindings() {
|
|
54
|
+
this.__initializeMarkers(MarkerManager);
|
|
55
|
+
super.__setupBindings();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
2
|
+
export declare class TestForTextMarkerCollisionNoTrackParentComponent extends FluffElement {
|
|
3
|
+
private readonly __tags;
|
|
4
|
+
get tags(): string[];
|
|
5
|
+
set tags(value: string[]);
|
|
6
|
+
protected __render(): void;
|
|
7
|
+
protected __setupBindings(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestForTextMarkerCollisionNoTrackParentComponent extends FluffElement {
|
|
5
|
+
__tags = new Property({ initialValue: ['a', 'a'], propertyName: 'tags' });
|
|
6
|
+
get tags() {
|
|
7
|
+
return this.__tags.getValue() ?? [];
|
|
8
|
+
}
|
|
9
|
+
set tags(value) {
|
|
10
|
+
this.__tags.setValue(value);
|
|
11
|
+
}
|
|
12
|
+
__render() {
|
|
13
|
+
this.__getShadowRoot().innerHTML = `
|
|
14
|
+
<!--fluff:for:0-->
|
|
15
|
+
<!--/fluff:for:0-->
|
|
16
|
+
<template data-fluff-tpl="test-for-text-marker-collision-no-track-parent-0">
|
|
17
|
+
<span class="tag"><!--fluff:text:9--><!--/fluff:text:9--></span>
|
|
18
|
+
</template>
|
|
19
|
+
`;
|
|
20
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
21
|
+
[0, { type: 'for', iterator: 'tag', iterableExprId: 0, deps: ['tags'], hasEmpty: false }],
|
|
22
|
+
[9, { type: 'text', exprId: 1, deps: ['tag'] }]
|
|
23
|
+
]));
|
|
24
|
+
}
|
|
25
|
+
__setupBindings() {
|
|
26
|
+
this.__initializeMarkers(MarkerManager);
|
|
27
|
+
super.__setupBindings();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
2
|
+
export declare class TestForTextMarkerCollisionParentComponent extends FluffElement {
|
|
3
|
+
private readonly __tags;
|
|
4
|
+
__pipes: Record<string, (v: unknown, ...args: unknown[]) => unknown>;
|
|
5
|
+
get tags(): string[];
|
|
6
|
+
set tags(value: string[]);
|
|
7
|
+
protected __render(): void;
|
|
8
|
+
protected __setupBindings(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestForTextMarkerCollisionParentComponent extends FluffElement {
|
|
5
|
+
__tags = new Property({ initialValue: ['docs', 'api'], propertyName: 'tags' });
|
|
6
|
+
__pipes = {
|
|
7
|
+
lowercase: (v) => String(v)
|
|
8
|
+
.toLowerCase(),
|
|
9
|
+
capitalize: (v) => {
|
|
10
|
+
const str = String(v);
|
|
11
|
+
return str.charAt(0)
|
|
12
|
+
.toUpperCase() + str.slice(1)
|
|
13
|
+
.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
get tags() {
|
|
17
|
+
return this.__tags.getValue() ?? [];
|
|
18
|
+
}
|
|
19
|
+
set tags(value) {
|
|
20
|
+
this.__tags.setValue(value);
|
|
21
|
+
}
|
|
22
|
+
__render() {
|
|
23
|
+
this.__getShadowRoot().innerHTML = `
|
|
24
|
+
<!--fluff:for:0-->
|
|
25
|
+
<!--/fluff:for:0-->
|
|
26
|
+
<template data-fluff-tpl="test-for-text-marker-collision-parent-0">
|
|
27
|
+
<span class="tag"><!--fluff:text:9--><!--/fluff:text:9--></span>
|
|
28
|
+
</template>
|
|
29
|
+
`;
|
|
30
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
31
|
+
[0, { type: 'for', iterator: 'tag', iterableExprId: 0, deps: ['tags'], trackBy: 'tag', hasEmpty: false }],
|
|
32
|
+
[9,
|
|
33
|
+
{
|
|
34
|
+
type: 'text',
|
|
35
|
+
exprId: 1,
|
|
36
|
+
deps: ['tag'],
|
|
37
|
+
pipes: [{ name: 'lowercase', argExprIds: [] }, { name: 'capitalize', argExprIds: [] }]
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
]));
|
|
41
|
+
}
|
|
42
|
+
__setupBindings() {
|
|
43
|
+
this.__initializeMarkers(MarkerManager);
|
|
44
|
+
super.__setupBindings();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TestUnsubscribeNestedParentBaseComponent } from './TestUnsubscribeNestedParentBaseComponent.js';
|
|
2
|
+
export declare class TestForUnsubscribeNestedParentComponent extends TestUnsubscribeNestedParentBaseComponent {
|
|
3
|
+
private readonly __items;
|
|
4
|
+
get items(): number[];
|
|
5
|
+
set items(value: number[]);
|
|
6
|
+
protected __render(): void;
|
|
7
|
+
protected __setupBindings(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
3
|
+
import { TestUnsubscribeNestedParentBaseComponent } from './TestUnsubscribeNestedParentBaseComponent.js';
|
|
4
|
+
export class TestForUnsubscribeNestedParentComponent extends TestUnsubscribeNestedParentBaseComponent {
|
|
5
|
+
__items = new Property({ initialValue: [0], propertyName: 'items' });
|
|
6
|
+
get items() {
|
|
7
|
+
return this.__items.getValue() ?? [];
|
|
8
|
+
}
|
|
9
|
+
set items(value) {
|
|
10
|
+
this.__items.setValue(value);
|
|
11
|
+
}
|
|
12
|
+
__render() {
|
|
13
|
+
this.__getShadowRoot().innerHTML = `
|
|
14
|
+
<!--fluff:for:0-->
|
|
15
|
+
<!--/fluff:for:0-->
|
|
16
|
+
<template data-fluff-tpl="test-for-unsubscribe-nested-parent-0">
|
|
17
|
+
<test-unsubscribe-nested-child x-fluff-component data-lid="l0"></test-unsubscribe-nested-child>
|
|
18
|
+
</template>
|
|
19
|
+
<template data-fluff-empty="test-for-unsubscribe-nested-parent-0">
|
|
20
|
+
<div class="empty">empty</div>
|
|
21
|
+
</template>
|
|
22
|
+
`;
|
|
23
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
24
|
+
[0, { type: 'for', iterator: 'item', iterableExprId: 0, deps: ['items'], hasEmpty: true }]
|
|
25
|
+
]));
|
|
26
|
+
const bindings = {
|
|
27
|
+
l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
|
|
28
|
+
};
|
|
29
|
+
Reflect.set(this.constructor, '__bindings', bindings);
|
|
30
|
+
}
|
|
31
|
+
__setupBindings() {
|
|
32
|
+
this.__initializeMarkers(MarkerManager);
|
|
33
|
+
super.__setupBindings();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
export declare class TestGetterReactivityComponent extends FluffElement {
|
|
3
|
+
private readonly __items;
|
|
4
|
+
get items(): string[];
|
|
5
|
+
set items(value: string[]);
|
|
6
|
+
get itemCount(): number;
|
|
7
|
+
protected __render(): void;
|
|
8
|
+
protected __setupBindings(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElement.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestGetterReactivityComponent extends FluffElement {
|
|
5
|
+
__items = new Property([]);
|
|
6
|
+
get items() {
|
|
7
|
+
return this.__items.getValue() ?? [];
|
|
8
|
+
}
|
|
9
|
+
set items(value) {
|
|
10
|
+
this.__items.setValue(value);
|
|
11
|
+
}
|
|
12
|
+
get itemCount() {
|
|
13
|
+
return this.items.length;
|
|
14
|
+
}
|
|
15
|
+
__render() {
|
|
16
|
+
this.__getShadowRoot().innerHTML = `
|
|
17
|
+
<div class="count"><!--fluff:text:0--><!--/fluff:text:0--></div>
|
|
18
|
+
`;
|
|
19
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
20
|
+
[0, { type: 'text', exprId: 0, deps: ['items'], pipes: [] }]
|
|
21
|
+
]));
|
|
22
|
+
}
|
|
23
|
+
__setupBindings() {
|
|
24
|
+
this.__initializeMarkers(MarkerManager);
|
|
25
|
+
super.__setupBindings();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
2
|
+
import type { TaskStats } from './TaskStats.js';
|
|
3
|
+
export declare class TestIfReinsertBindsInputChildComponent extends FluffElement {
|
|
4
|
+
private readonly __stats;
|
|
5
|
+
get stats(): TaskStats;
|
|
6
|
+
set stats(value: TaskStats);
|
|
7
|
+
protected __render(): void;
|
|
8
|
+
protected __setupBindings(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestIfReinsertBindsInputChildComponent extends FluffElement {
|
|
5
|
+
__stats = new Property({
|
|
6
|
+
initialValue: {
|
|
7
|
+
total: 0,
|
|
8
|
+
byStatus: { 'todo': 0, 'in-progress': 0, 'done': 0 },
|
|
9
|
+
byPriority: { 'low': 0, 'medium': 0, 'high': 0, 'urgent': 0 },
|
|
10
|
+
overdue: 0,
|
|
11
|
+
dueToday: 0
|
|
12
|
+
},
|
|
13
|
+
propertyName: 'stats'
|
|
14
|
+
});
|
|
15
|
+
get stats() {
|
|
16
|
+
return this.__stats.getValue() ?? {
|
|
17
|
+
total: 0,
|
|
18
|
+
byStatus: { 'todo': 0, 'in-progress': 0, 'done': 0 },
|
|
19
|
+
byPriority: { 'low': 0, 'medium': 0, 'high': 0, 'urgent': 0 },
|
|
20
|
+
overdue: 0,
|
|
21
|
+
dueToday: 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
set stats(value) {
|
|
25
|
+
this.__stats.setValue(value);
|
|
26
|
+
}
|
|
27
|
+
__render() {
|
|
28
|
+
this.__getShadowRoot().innerHTML = `
|
|
29
|
+
<div class="total"><!--fluff:text:0--><!--/fluff:text:0--></div>
|
|
30
|
+
`;
|
|
31
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
32
|
+
[0, { type: 'text', exprId: 2, deps: ['stats'], pipes: [] }]
|
|
33
|
+
]));
|
|
34
|
+
}
|
|
35
|
+
__setupBindings() {
|
|
36
|
+
this.__initializeMarkers(MarkerManager);
|
|
37
|
+
super.__setupBindings();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
2
|
+
import type { TaskStats } from './TaskStats.js';
|
|
3
|
+
export declare class TestIfReinsertBindsInputParentComponent extends FluffElement {
|
|
4
|
+
private readonly __show;
|
|
5
|
+
private readonly __stats;
|
|
6
|
+
get show(): boolean;
|
|
7
|
+
set show(value: boolean);
|
|
8
|
+
get stats(): TaskStats;
|
|
9
|
+
set stats(value: TaskStats);
|
|
10
|
+
protected __render(): void;
|
|
11
|
+
protected __setupBindings(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestIfReinsertBindsInputParentComponent extends FluffElement {
|
|
5
|
+
__show = new Property({ initialValue: true, propertyName: 'show' });
|
|
6
|
+
__stats = new Property({
|
|
7
|
+
initialValue: {
|
|
8
|
+
total: 8,
|
|
9
|
+
byStatus: { 'todo': 0, 'in-progress': 0, 'done': 8 },
|
|
10
|
+
byPriority: { 'low': 0, 'medium': 0, 'high': 0, 'urgent': 0 },
|
|
11
|
+
overdue: 0,
|
|
12
|
+
dueToday: 0
|
|
13
|
+
},
|
|
14
|
+
propertyName: 'stats'
|
|
15
|
+
});
|
|
16
|
+
get show() {
|
|
17
|
+
return this.__show.getValue() ?? false;
|
|
18
|
+
}
|
|
19
|
+
set show(value) {
|
|
20
|
+
this.__show.setValue(value);
|
|
21
|
+
}
|
|
22
|
+
get stats() {
|
|
23
|
+
return this.__stats.getValue() ?? {
|
|
24
|
+
total: 0,
|
|
25
|
+
byStatus: { 'todo': 0, 'in-progress': 0, 'done': 0 },
|
|
26
|
+
byPriority: { 'low': 0, 'medium': 0, 'high': 0, 'urgent': 0 },
|
|
27
|
+
overdue: 0,
|
|
28
|
+
dueToday: 0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
set stats(value) {
|
|
32
|
+
this.__stats.setValue(value);
|
|
33
|
+
}
|
|
34
|
+
__render() {
|
|
35
|
+
this.__getShadowRoot().innerHTML = `
|
|
36
|
+
<!--fluff:if:0-->
|
|
37
|
+
<!--/fluff:if:0-->
|
|
38
|
+
<template data-fluff-branch="test-if-reinsert-binds-input-parent-0-0">
|
|
39
|
+
<test-if-reinsert-binds-input-child x-fluff-component data-lid="l0"></test-if-reinsert-binds-input-child>
|
|
40
|
+
</template>
|
|
41
|
+
`;
|
|
42
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
43
|
+
[0, { type: 'if', branches: [{ exprId: 0, deps: ['show'] }] }]
|
|
44
|
+
]));
|
|
45
|
+
const bindings = {
|
|
46
|
+
l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
|
|
47
|
+
};
|
|
48
|
+
Reflect.set(this.constructor, '__bindings', bindings);
|
|
49
|
+
}
|
|
50
|
+
__setupBindings() {
|
|
51
|
+
this.__initializeMarkers(MarkerManager);
|
|
52
|
+
super.__setupBindings();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TestUnsubscribeNestedParentBaseComponent } from './TestUnsubscribeNestedParentBaseComponent.js';
|
|
2
|
+
export declare class TestIfUnsubscribeNestedParentComponent extends TestUnsubscribeNestedParentBaseComponent {
|
|
3
|
+
private readonly __show;
|
|
4
|
+
get show(): boolean;
|
|
5
|
+
set show(value: boolean);
|
|
6
|
+
protected __render(): void;
|
|
7
|
+
protected __setupBindings(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
3
|
+
import { TestUnsubscribeNestedParentBaseComponent } from './TestUnsubscribeNestedParentBaseComponent.js';
|
|
4
|
+
export class TestIfUnsubscribeNestedParentComponent extends TestUnsubscribeNestedParentBaseComponent {
|
|
5
|
+
__show = new Property({ initialValue: true, propertyName: 'show' });
|
|
6
|
+
get show() {
|
|
7
|
+
return this.__show.getValue() ?? false;
|
|
8
|
+
}
|
|
9
|
+
set show(value) {
|
|
10
|
+
this.__show.setValue(value);
|
|
11
|
+
}
|
|
12
|
+
__render() {
|
|
13
|
+
this.__getShadowRoot().innerHTML = `
|
|
14
|
+
<!--fluff:if:0-->
|
|
15
|
+
<!--/fluff:if:0-->
|
|
16
|
+
<template data-fluff-branch="test-if-unsubscribe-nested-parent-0-0">
|
|
17
|
+
<test-unsubscribe-nested-child x-fluff-component data-lid="l0"></test-unsubscribe-nested-child>
|
|
18
|
+
</template>
|
|
19
|
+
`;
|
|
20
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
21
|
+
[0, { type: 'if', branches: [{ exprId: 0, deps: ['show'] }] }]
|
|
22
|
+
]));
|
|
23
|
+
const bindings = {
|
|
24
|
+
l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
|
|
25
|
+
};
|
|
26
|
+
Reflect.set(this.constructor, '__bindings', bindings);
|
|
27
|
+
}
|
|
28
|
+
__setupBindings() {
|
|
29
|
+
this.__initializeMarkers(MarkerManager);
|
|
30
|
+
super.__setupBindings();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
export class TestLateDefineForChildComponent extends FluffElement {
|
|
3
|
+
column = null;
|
|
4
|
+
__render() {
|
|
5
|
+
this.__getShadowRoot().innerHTML = '<span>late-child</span>';
|
|
6
|
+
}
|
|
7
|
+
__setupBindings() {
|
|
8
|
+
super.__setupBindings();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
export interface TestLateDefineForColumn {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class TestLateDefineForComponent extends FluffElement {
|
|
6
|
+
columns: TestLateDefineForColumn[];
|
|
7
|
+
protected __render(): void;
|
|
8
|
+
protected __setupBindings(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
3
|
+
export class TestLateDefineForComponent extends FluffElement {
|
|
4
|
+
columns = [
|
|
5
|
+
{ id: 'todo' },
|
|
6
|
+
{ id: 'doing' },
|
|
7
|
+
{ id: 'done' }
|
|
8
|
+
];
|
|
9
|
+
__render() {
|
|
10
|
+
this.__getShadowRoot().innerHTML = `
|
|
11
|
+
<!--fluff:for:0-->
|
|
12
|
+
<!--/fluff:for:0-->
|
|
13
|
+
<template data-fluff-tpl="late-define-for-component-0">
|
|
14
|
+
<late-define-for-child x-fluff-component="" data-lid="l0"></late-define-for-child>
|
|
15
|
+
</template>
|
|
16
|
+
`;
|
|
17
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
18
|
+
[0, { type: 'for', iterator: 'column', iterableExprId: 0, deps: ['columns'], hasEmpty: false }]
|
|
19
|
+
]));
|
|
20
|
+
}
|
|
21
|
+
__setupBindings() {
|
|
22
|
+
this.__initializeMarkers(MarkerManager);
|
|
23
|
+
super.__setupBindings();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
export interface TestTask {
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class TestNullInputTextComponent extends FluffElement {
|
|
6
|
+
private readonly __isEditing;
|
|
7
|
+
private readonly __task;
|
|
8
|
+
get isEditing(): boolean;
|
|
9
|
+
set isEditing(value: boolean);
|
|
10
|
+
get task(): TestTask | null;
|
|
11
|
+
set task(value: TestTask | null);
|
|
12
|
+
protected __render(): void;
|
|
13
|
+
protected __setupBindings(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Property as PropertyImpl } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElement.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestNullInputTextComponent extends FluffElement {
|
|
5
|
+
__isEditing = new PropertyImpl(false);
|
|
6
|
+
__task = new PropertyImpl(null);
|
|
7
|
+
get isEditing() {
|
|
8
|
+
return this.__isEditing.getValue() ?? false;
|
|
9
|
+
}
|
|
10
|
+
set isEditing(value) {
|
|
11
|
+
this.__isEditing.setValue(value);
|
|
12
|
+
}
|
|
13
|
+
get task() {
|
|
14
|
+
return this.__task.getValue() ?? null;
|
|
15
|
+
}
|
|
16
|
+
set task(value) {
|
|
17
|
+
this.__task.setValue(value);
|
|
18
|
+
}
|
|
19
|
+
__render() {
|
|
20
|
+
this.__getShadowRoot().innerHTML = `
|
|
21
|
+
<!--fluff:if:0-->
|
|
22
|
+
<!--/fluff:if:0-->
|
|
23
|
+
<template data-fluff-branch="test-null-input-text-0-0">
|
|
24
|
+
<div class="title"><!--fluff:text:1--><!--/fluff:text:1--></div>
|
|
25
|
+
</template>
|
|
26
|
+
<template data-fluff-branch="test-null-input-text-0-1"></template>
|
|
27
|
+
`;
|
|
28
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
29
|
+
[0, { type: 'if', branches: [{ exprId: 0, deps: ['isEditing'] }, { exprId: undefined, deps: [] }] }],
|
|
30
|
+
[1, { type: 'text', exprId: 1, deps: ['task'], pipes: [] }]
|
|
31
|
+
]));
|
|
32
|
+
}
|
|
33
|
+
__setupBindings() {
|
|
34
|
+
this.__initializeMarkers(MarkerManager);
|
|
35
|
+
super.__setupBindings();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Publisher } from '../../utils/Publisher.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
export declare class TestOutputBindingChildComponent extends FluffElement {
|
|
4
|
+
edit: Publisher<{
|
|
5
|
+
taskId: number;
|
|
6
|
+
}>;
|
|
7
|
+
onEdit(): void;
|
|
8
|
+
protected __render(): void;
|
|
9
|
+
protected __setupBindings(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Publisher } from '../../utils/Publisher.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestOutputBindingChildComponent extends FluffElement {
|
|
5
|
+
edit = new Publisher();
|
|
6
|
+
onEdit() {
|
|
7
|
+
this.edit.emit({ taskId: 42 });
|
|
8
|
+
}
|
|
9
|
+
__render() {
|
|
10
|
+
this.__getShadowRoot().innerHTML = '<button data-lid="l0">Edit</button>';
|
|
11
|
+
const bindings = {
|
|
12
|
+
l0: [{ n: 'click', b: 'event', h: 1, d: ['onEdit'] }]
|
|
13
|
+
};
|
|
14
|
+
Reflect.set(this.constructor, '__bindings', bindings);
|
|
15
|
+
}
|
|
16
|
+
__setupBindings() {
|
|
17
|
+
this.__initializeMarkers(MarkerManager);
|
|
18
|
+
super.__setupBindings();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
2
|
+
export declare class TestOutputBindingParentComponent extends FluffElement {
|
|
3
|
+
private readonly __show;
|
|
4
|
+
editCount: number;
|
|
5
|
+
lastTaskId: number | null;
|
|
6
|
+
get show(): boolean;
|
|
7
|
+
set show(value: boolean);
|
|
8
|
+
onChildEdit(event: {
|
|
9
|
+
taskId: number;
|
|
10
|
+
}): void;
|
|
11
|
+
protected __render(): void;
|
|
12
|
+
protected __setupBindings(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Property } from '../../utils/Property.js';
|
|
2
|
+
import { FluffElement } from '../FluffElementImpl.js';
|
|
3
|
+
import { MarkerManager } from '../MarkerManager.js';
|
|
4
|
+
export class TestOutputBindingParentComponent extends FluffElement {
|
|
5
|
+
__show = new Property({ initialValue: true, propertyName: 'show' });
|
|
6
|
+
editCount = 0;
|
|
7
|
+
lastTaskId = null;
|
|
8
|
+
get show() {
|
|
9
|
+
return this.__show.getValue() ?? false;
|
|
10
|
+
}
|
|
11
|
+
set show(value) {
|
|
12
|
+
this.__show.setValue(value);
|
|
13
|
+
}
|
|
14
|
+
onChildEdit(event) {
|
|
15
|
+
this.editCount++;
|
|
16
|
+
this.lastTaskId = event?.taskId ?? null;
|
|
17
|
+
}
|
|
18
|
+
__render() {
|
|
19
|
+
this.__getShadowRoot().innerHTML = `
|
|
20
|
+
<!--fluff:if:0-->
|
|
21
|
+
<!--/fluff:if:0-->
|
|
22
|
+
<template data-fluff-branch="test-output-binding-parent-0-0">
|
|
23
|
+
<test-output-binding-child x-fluff-component data-lid="l0"></test-output-binding-child>
|
|
24
|
+
</template>
|
|
25
|
+
`;
|
|
26
|
+
this.__setMarkerConfigs(JSON.stringify([
|
|
27
|
+
[0, { type: 'if', branches: [{ exprId: 0, deps: ['show'] }] }]
|
|
28
|
+
]));
|
|
29
|
+
const bindings = {
|
|
30
|
+
l0: [{ n: 'edit', b: 'event', h: 0, d: ['onChildEdit'] }]
|
|
31
|
+
};
|
|
32
|
+
Reflect.set(this.constructor, '__bindings', bindings);
|
|
33
|
+
}
|
|
34
|
+
__setupBindings() {
|
|
35
|
+
this.__initializeMarkers(MarkerManager);
|
|
36
|
+
super.__setupBindings();
|
|
37
|
+
}
|
|
38
|
+
}
|