ripple 0.3.11 → 0.3.13
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/CHANGELOG.md +43 -0
- package/package.json +8 -2
- package/src/compiler/phases/1-parse/index.js +73 -30
- package/src/compiler/phases/2-analyze/index.js +28 -58
- package/src/compiler/phases/3-transform/client/index.js +127 -164
- package/src/compiler/phases/3-transform/segments.js +4 -8
- package/src/compiler/phases/3-transform/server/index.js +210 -360
- package/src/compiler/types/import.d.ts +0 -12
- package/src/compiler/types/index.d.ts +12 -5
- package/src/compiler/types/parse.d.ts +2 -0
- package/src/compiler/utils.js +39 -44
- package/src/helpers.d.ts +2 -0
- package/src/runtime/index-client.js +15 -13
- package/src/runtime/index-server.js +18 -11
- package/src/runtime/internal/client/blocks.js +19 -23
- package/src/runtime/internal/client/constants.js +20 -9
- package/src/runtime/internal/client/index.js +14 -4
- package/src/runtime/internal/client/runtime.js +435 -173
- package/src/runtime/internal/client/try.js +334 -156
- package/src/runtime/internal/client/types.d.ts +26 -0
- package/src/runtime/internal/server/blocks.js +183 -0
- package/src/runtime/internal/server/constants.js +7 -0
- package/src/runtime/internal/server/index.js +780 -148
- package/src/runtime/internal/server/types.d.ts +35 -0
- package/src/server/index.js +1 -1
- package/src/utils/async.js +35 -0
- package/src/utils/builders.js +3 -1
- package/tests/client/__snapshots__/computed-properties.test.rsrx.snap +49 -0
- package/tests/client/__snapshots__/for.test.rsrx.snap +319 -0
- package/tests/client/__snapshots__/html.test.rsrx.snap +40 -0
- package/tests/client/_etc.test.rsrx +7 -0
- package/tests/client/array/{array.static.test.ripple → array.static.test.rsrx} +18 -20
- package/tests/client/async-suspend.test.rsrx +662 -0
- package/tests/client/basic/__snapshots__/basic.attributes.test.rsrx.snap +60 -0
- package/tests/client/basic/__snapshots__/basic.rendering.test.rsrx.snap +59 -0
- package/tests/client/basic/{basic.errors.test.ripple → basic.errors.test.rsrx} +2 -2
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.rsrx.snap +12 -0
- package/tests/client/compiler/__snapshots__/compiler.typescript.test.rsrx.snap +46 -0
- package/tests/client/compiler/{compiler.try-in-function.test.ripple → compiler.try-in-function.test.rsrx} +8 -6
- package/tests/client/composite/__snapshots__/composite.render.test.rsrx.snap +37 -0
- package/tests/client/{function-overload.test.ripple → function-overload.test.rsrx} +1 -1
- package/tests/client/try.test.rsrx +1702 -0
- package/tests/hydration/build-components.js +5 -3
- package/tests/hydration/compiled/client/head.js +11 -11
- package/tests/hydration/compiled/client/mixed-control-flow.js +55 -70
- package/tests/hydration/compiled/client/nested-control-flow.js +72 -88
- package/tests/hydration/compiled/client/try.js +42 -54
- package/tests/hydration/compiled/server/basic.js +491 -369
- package/tests/hydration/compiled/server/composite.js +153 -128
- package/tests/hydration/compiled/server/events.js +166 -145
- package/tests/hydration/compiled/server/for.js +821 -677
- package/tests/hydration/compiled/server/head.js +200 -165
- package/tests/hydration/compiled/server/hmr.js +62 -54
- package/tests/hydration/compiled/server/html-in-template.js +64 -55
- package/tests/hydration/compiled/server/html.js +1477 -1360
- package/tests/hydration/compiled/server/if-children.js +448 -408
- package/tests/hydration/compiled/server/if.js +204 -171
- package/tests/hydration/compiled/server/mixed-control-flow.js +237 -195
- package/tests/hydration/compiled/server/nested-control-flow.js +533 -467
- package/tests/hydration/compiled/server/portal.js +94 -107
- package/tests/hydration/compiled/server/reactivity.js +87 -64
- package/tests/hydration/compiled/server/return.js +1424 -1174
- package/tests/hydration/compiled/server/switch.js +268 -238
- package/tests/hydration/compiled/server/try.js +98 -87
- package/tests/hydration/components/{mixed-control-flow.ripple → mixed-control-flow.rsrx} +2 -2
- package/tests/hydration/components/{try.ripple → try.rsrx} +4 -2
- package/tests/hydration/mixed-control-flow.test.js +14 -0
- package/tests/hydration/nested-control-flow.test.js +50 -48
- package/tests/hydration/try.test.js +25 -0
- package/tests/server/__snapshots__/compiler.test.ripple.snap +0 -32
- package/tests/server/__snapshots__/compiler.test.rsrx.snap +95 -0
- package/tests/server/{compiler.test.ripple → compiler.test.rsrx} +0 -17
- package/tests/server/{html-nesting-validation.test.ripple → html-nesting-validation.test.rsrx} +3 -3
- package/tests/server/streaming-ssr.test.rsrx +115 -0
- package/tests/server/try.test.rsrx +503 -0
- package/tests/utils/compiler-compat-config.test.js +3 -3
- package/tests/utils/vite-plugin-config.test.js +1 -1
- package/tests/utils/vite-plugin-hmr.test.js +5 -5
- package/tsconfig.json +4 -0
- package/types/index.d.ts +13 -23
- package/types/server.d.ts +43 -16
- package/tests/client/_etc.test.ripple +0 -5
- package/tests/client/async-suspend.test.ripple +0 -94
- package/tests/client/try.test.ripple +0 -196
- package/tests/server/streaming-ssr.test.ripple +0 -68
- package/tests/server/try.test.ripple +0 -82
- /package/tests/client/array/{array.copy-within.test.ripple → array.copy-within.test.rsrx} +0 -0
- /package/tests/client/array/{array.derived.test.ripple → array.derived.test.rsrx} +0 -0
- /package/tests/client/array/{array.iteration.test.ripple → array.iteration.test.rsrx} +0 -0
- /package/tests/client/array/{array.mutations.test.ripple → array.mutations.test.rsrx} +0 -0
- /package/tests/client/array/{array.to-methods.test.ripple → array.to-methods.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.attributes.test.ripple → basic.attributes.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.collections.test.ripple → basic.collections.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.components.test.ripple → basic.components.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.events.test.ripple → basic.events.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.get-set.test.ripple → basic.get-set.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.hmr.test.ripple → basic.hmr.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.reactivity.test.ripple → basic.reactivity.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.rendering.test.ripple → basic.rendering.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.styling.test.ripple → basic.styling.test.rsrx} +0 -0
- /package/tests/client/basic/{basic.utilities.test.ripple → basic.utilities.test.rsrx} +0 -0
- /package/tests/client/{boundaries.test.ripple → boundaries.test.rsrx} +0 -0
- /package/tests/client/compiler/{compiler.assignments.test.ripple → compiler.assignments.test.rsrx} +0 -0
- /package/tests/client/compiler/{compiler.attributes.test.ripple → compiler.attributes.test.rsrx} +0 -0
- /package/tests/client/compiler/{compiler.basic.test.ripple → compiler.basic.test.rsrx} +0 -0
- /package/tests/client/compiler/{compiler.regex.test.ripple → compiler.regex.test.rsrx} +0 -0
- /package/tests/client/compiler/{compiler.tracked-access.test.ripple → compiler.tracked-access.test.rsrx} +0 -0
- /package/tests/client/compiler/{compiler.typescript.test.ripple → compiler.typescript.test.rsrx} +0 -0
- /package/tests/client/composite/{composite.dynamic-components.test.ripple → composite.dynamic-components.test.rsrx} +0 -0
- /package/tests/client/composite/{composite.generics.test.ripple → composite.generics.test.rsrx} +0 -0
- /package/tests/client/composite/{composite.props.test.ripple → composite.props.test.rsrx} +0 -0
- /package/tests/client/composite/{composite.reactivity.test.ripple → composite.reactivity.test.rsrx} +0 -0
- /package/tests/client/composite/{composite.render.test.ripple → composite.render.test.rsrx} +0 -0
- /package/tests/client/{computed-properties.test.ripple → computed-properties.test.rsrx} +0 -0
- /package/tests/client/{context.test.ripple → context.test.rsrx} +0 -0
- /package/tests/client/css/{global-additional-cases.test.ripple → global-additional-cases.test.rsrx} +0 -0
- /package/tests/client/css/{global-advanced-selectors.test.ripple → global-advanced-selectors.test.rsrx} +0 -0
- /package/tests/client/css/{global-at-rules.test.ripple → global-at-rules.test.rsrx} +0 -0
- /package/tests/client/css/{global-basic.test.ripple → global-basic.test.rsrx} +0 -0
- /package/tests/client/css/{global-classes-ids.test.ripple → global-classes-ids.test.rsrx} +0 -0
- /package/tests/client/css/{global-combinators.test.ripple → global-combinators.test.rsrx} +0 -0
- /package/tests/client/css/{global-complex-nesting.test.ripple → global-complex-nesting.test.rsrx} +0 -0
- /package/tests/client/css/{global-edge-cases.test.ripple → global-edge-cases.test.rsrx} +0 -0
- /package/tests/client/css/{global-keyframes.test.ripple → global-keyframes.test.rsrx} +0 -0
- /package/tests/client/css/{global-nested.test.ripple → global-nested.test.rsrx} +0 -0
- /package/tests/client/css/{global-pseudo.test.ripple → global-pseudo.test.rsrx} +0 -0
- /package/tests/client/css/{global-scoping.test.ripple → global-scoping.test.rsrx} +0 -0
- /package/tests/client/css/{style-identifier.test.ripple → style-identifier.test.rsrx} +0 -0
- /package/tests/client/{date.test.ripple → date.test.rsrx} +0 -0
- /package/tests/client/{dynamic-elements.test.ripple → dynamic-elements.test.rsrx} +0 -0
- /package/tests/client/{events.test.ripple → events.test.rsrx} +0 -0
- /package/tests/client/{for.test.ripple → for.test.rsrx} +0 -0
- /package/tests/client/{function-overload-import.ripple → function-overload-import.rsrx} +0 -0
- /package/tests/client/{head.test.ripple → head.test.rsrx} +0 -0
- /package/tests/client/{html.test.ripple → html.test.rsrx} +0 -0
- /package/tests/client/{input-value.test.ripple → input-value.test.rsrx} +0 -0
- /package/tests/client/{lazy-destructuring.test.ripple → lazy-destructuring.test.rsrx} +0 -0
- /package/tests/client/{map.test.ripple → map.test.rsrx} +0 -0
- /package/tests/client/{media-query.test.ripple → media-query.test.rsrx} +0 -0
- /package/tests/client/{object.test.ripple → object.test.rsrx} +0 -0
- /package/tests/client/{portal.test.ripple → portal.test.rsrx} +0 -0
- /package/tests/client/{ref.test.ripple → ref.test.rsrx} +0 -0
- /package/tests/client/{return.test.ripple → return.test.rsrx} +0 -0
- /package/tests/client/{set.test.ripple → set.test.rsrx} +0 -0
- /package/tests/client/{svg.test.ripple → svg.test.rsrx} +0 -0
- /package/tests/client/{switch.test.ripple → switch.test.rsrx} +0 -0
- /package/tests/client/{tsx.test.ripple → tsx.test.rsrx} +0 -0
- /package/tests/client/{typescript-generics.test.ripple → typescript-generics.test.rsrx} +0 -0
- /package/tests/client/url/{url.derived.test.ripple → url.derived.test.rsrx} +0 -0
- /package/tests/client/url/{url.parsing.test.ripple → url.parsing.test.rsrx} +0 -0
- /package/tests/client/url/{url.partial-removal.test.ripple → url.partial-removal.test.rsrx} +0 -0
- /package/tests/client/url/{url.reactivity.test.ripple → url.reactivity.test.rsrx} +0 -0
- /package/tests/client/url/{url.serialization.test.ripple → url.serialization.test.rsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.derived.test.ripple → url-search-params.derived.test.rsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.initialization.test.ripple → url-search-params.initialization.test.rsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.iteration.test.ripple → url-search-params.iteration.test.rsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.mutation.test.ripple → url-search-params.mutation.test.rsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.retrieval.test.ripple → url-search-params.retrieval.test.rsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.serialization.test.ripple → url-search-params.serialization.test.rsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.tracked-url.test.ripple → url-search-params.tracked-url.test.rsrx} +0 -0
- /package/tests/hydration/components/{basic.ripple → basic.rsrx} +0 -0
- /package/tests/hydration/components/{composite.ripple → composite.rsrx} +0 -0
- /package/tests/hydration/components/{events.ripple → events.rsrx} +0 -0
- /package/tests/hydration/components/{for.ripple → for.rsrx} +0 -0
- /package/tests/hydration/components/{head.ripple → head.rsrx} +0 -0
- /package/tests/hydration/components/{hmr.ripple → hmr.rsrx} +0 -0
- /package/tests/hydration/components/{html-in-template.ripple → html-in-template.rsrx} +0 -0
- /package/tests/hydration/components/{html.ripple → html.rsrx} +0 -0
- /package/tests/hydration/components/{if-children.ripple → if-children.rsrx} +0 -0
- /package/tests/hydration/components/{if.ripple → if.rsrx} +0 -0
- /package/tests/hydration/components/{nested-control-flow.ripple → nested-control-flow.rsrx} +0 -0
- /package/tests/hydration/components/{portal.ripple → portal.rsrx} +0 -0
- /package/tests/hydration/components/{reactivity.ripple → reactivity.rsrx} +0 -0
- /package/tests/hydration/components/{return.ripple → return.rsrx} +0 -0
- /package/tests/hydration/components/{switch.ripple → switch.rsrx} +0 -0
- /package/tests/server/{await.test.ripple → await.test.rsrx} +0 -0
- /package/tests/server/{basic.attributes.test.ripple → basic.attributes.test.rsrx} +0 -0
- /package/tests/server/{basic.components.test.ripple → basic.components.test.rsrx} +0 -0
- /package/tests/server/{basic.test.ripple → basic.test.rsrx} +0 -0
- /package/tests/server/{composite.props.test.ripple → composite.props.test.rsrx} +0 -0
- /package/tests/server/{composite.test.ripple → composite.test.rsrx} +0 -0
- /package/tests/server/{context.test.ripple → context.test.rsrx} +0 -0
- /package/tests/server/{dynamic-elements.test.ripple → dynamic-elements.test.rsrx} +0 -0
- /package/tests/server/{for.test.ripple → for.test.rsrx} +0 -0
- /package/tests/server/{head.test.ripple → head.test.rsrx} +0 -0
- /package/tests/server/{if.test.ripple → if.test.rsrx} +0 -0
- /package/tests/server/{lazy-destructuring.test.ripple → lazy-destructuring.test.rsrx} +0 -0
- /package/tests/server/{return.test.ripple → return.test.rsrx} +0 -0
- /package/tests/server/{style-identifier.test.ripple → style-identifier.test.rsrx} +0 -0
- /package/tests/server/{switch.test.ripple → switch.test.rsrx} +0 -0
|
@@ -3,68 +3,74 @@ import * as _$_ from 'ripple/internal/server';
|
|
|
3
3
|
|
|
4
4
|
import { track } from 'ripple/server';
|
|
5
5
|
|
|
6
|
-
export function StaticForLoop(
|
|
6
|
+
export function StaticForLoop() {
|
|
7
7
|
_$_.push_component();
|
|
8
8
|
|
|
9
9
|
const items = ['Apple', 'Banana', 'Cherry'];
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
_$_.regular_block(() => {
|
|
12
|
+
_$_.output_push('<ul');
|
|
13
|
+
_$_.output_push('>');
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
{
|
|
16
|
+
_$_.output_push('<!--[-->');
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
for (const item of items) {
|
|
19
|
+
_$_.output_push('<li');
|
|
20
|
+
_$_.output_push('>');
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
{
|
|
23
|
+
_$_.output_push(_$_.escape(item));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_$_.output_push('</li>');
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
_$_.output_push('<!--]-->');
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
}
|
|
32
|
+
_$_.output_push('</ul>');
|
|
33
|
+
});
|
|
30
34
|
|
|
31
|
-
__output.push('</ul>');
|
|
32
35
|
_$_.pop_component();
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
export function ForLoopWithIndex(
|
|
38
|
+
export function ForLoopWithIndex() {
|
|
36
39
|
_$_.push_component();
|
|
37
40
|
|
|
38
41
|
const items = ['A', 'B', 'C'];
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
_$_.regular_block(() => {
|
|
44
|
+
_$_.output_push('<ul');
|
|
45
|
+
_$_.output_push('>');
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
{
|
|
48
|
+
_$_.output_push('<!--[-->');
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
var i = 0;
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
for (const item of items) {
|
|
53
|
+
_$_.output_push('<li');
|
|
54
|
+
_$_.output_push('>');
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
{
|
|
57
|
+
_$_.output_push(_$_.escape(`${i}: ${item}`));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
_$_.output_push('</li>');
|
|
61
|
+
i++;
|
|
54
62
|
}
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
i++;
|
|
64
|
+
_$_.output_push('<!--]-->');
|
|
58
65
|
}
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
}
|
|
67
|
+
_$_.output_push('</ul>');
|
|
68
|
+
});
|
|
62
69
|
|
|
63
|
-
__output.push('</ul>');
|
|
64
70
|
_$_.pop_component();
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
export function KeyedForLoop(
|
|
73
|
+
export function KeyedForLoop() {
|
|
68
74
|
_$_.push_component();
|
|
69
75
|
|
|
70
76
|
const items = [
|
|
@@ -73,238 +79,262 @@ export function KeyedForLoop(__output) {
|
|
|
73
79
|
{ id: 3, name: 'Third' }
|
|
74
80
|
];
|
|
75
81
|
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
_$_.regular_block(() => {
|
|
83
|
+
_$_.output_push('<ul');
|
|
84
|
+
_$_.output_push('>');
|
|
78
85
|
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
{
|
|
87
|
+
_$_.output_push('<!--[-->');
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
for (const item of items) {
|
|
90
|
+
_$_.output_push('<li');
|
|
91
|
+
_$_.output_push('>');
|
|
85
92
|
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
{
|
|
94
|
+
_$_.output_push(_$_.escape(item.name));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_$_.output_push('</li>');
|
|
88
98
|
}
|
|
89
99
|
|
|
90
|
-
|
|
100
|
+
_$_.output_push('<!--]-->');
|
|
91
101
|
}
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
}
|
|
103
|
+
_$_.output_push('</ul>');
|
|
104
|
+
});
|
|
95
105
|
|
|
96
|
-
__output.push('</ul>');
|
|
97
106
|
_$_.pop_component();
|
|
98
107
|
}
|
|
99
108
|
|
|
100
|
-
export function ReactiveForLoopAdd(
|
|
109
|
+
export function ReactiveForLoopAdd() {
|
|
101
110
|
_$_.push_component();
|
|
102
111
|
|
|
103
112
|
let lazy = _$_.track(['A', 'B']);
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
_$_.regular_block(() => {
|
|
115
|
+
_$_.output_push('<button');
|
|
116
|
+
_$_.output_push(' class="add"');
|
|
117
|
+
_$_.output_push('>');
|
|
108
118
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
{
|
|
120
|
+
_$_.output_push('Add');
|
|
121
|
+
}
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
__output.push('>');
|
|
123
|
+
_$_.output_push('</button>');
|
|
124
|
+
});
|
|
116
125
|
|
|
117
|
-
{
|
|
118
|
-
|
|
126
|
+
_$_.regular_block(() => {
|
|
127
|
+
_$_.output_push('<ul');
|
|
128
|
+
_$_.output_push('>');
|
|
119
129
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
__output.push('>');
|
|
130
|
+
{
|
|
131
|
+
_$_.output_push('<!--[-->');
|
|
123
132
|
|
|
124
|
-
{
|
|
125
|
-
|
|
133
|
+
for (const item of _$_.get(lazy)) {
|
|
134
|
+
_$_.output_push('<li');
|
|
135
|
+
_$_.output_push('>');
|
|
136
|
+
|
|
137
|
+
{
|
|
138
|
+
_$_.output_push(_$_.escape(item));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
_$_.output_push('</li>');
|
|
126
142
|
}
|
|
127
143
|
|
|
128
|
-
|
|
144
|
+
_$_.output_push('<!--]-->');
|
|
129
145
|
}
|
|
130
146
|
|
|
131
|
-
|
|
132
|
-
}
|
|
147
|
+
_$_.output_push('</ul>');
|
|
148
|
+
});
|
|
133
149
|
|
|
134
|
-
__output.push('</ul>');
|
|
135
150
|
_$_.pop_component();
|
|
136
151
|
}
|
|
137
152
|
|
|
138
|
-
export function ReactiveForLoopRemove(
|
|
153
|
+
export function ReactiveForLoopRemove() {
|
|
139
154
|
_$_.push_component();
|
|
140
155
|
|
|
141
156
|
let lazy_1 = _$_.track(['A', 'B', 'C']);
|
|
142
157
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
158
|
+
_$_.regular_block(() => {
|
|
159
|
+
_$_.output_push('<button');
|
|
160
|
+
_$_.output_push(' class="remove"');
|
|
161
|
+
_$_.output_push('>');
|
|
146
162
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
163
|
+
{
|
|
164
|
+
_$_.output_push('Remove');
|
|
165
|
+
}
|
|
150
166
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
__output.push('>');
|
|
167
|
+
_$_.output_push('</button>');
|
|
168
|
+
});
|
|
154
169
|
|
|
155
|
-
{
|
|
156
|
-
|
|
170
|
+
_$_.regular_block(() => {
|
|
171
|
+
_$_.output_push('<ul');
|
|
172
|
+
_$_.output_push('>');
|
|
157
173
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
__output.push('>');
|
|
174
|
+
{
|
|
175
|
+
_$_.output_push('<!--[-->');
|
|
161
176
|
|
|
162
|
-
{
|
|
163
|
-
|
|
177
|
+
for (const item of _$_.get(lazy_1)) {
|
|
178
|
+
_$_.output_push('<li');
|
|
179
|
+
_$_.output_push('>');
|
|
180
|
+
|
|
181
|
+
{
|
|
182
|
+
_$_.output_push(_$_.escape(item));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
_$_.output_push('</li>');
|
|
164
186
|
}
|
|
165
187
|
|
|
166
|
-
|
|
188
|
+
_$_.output_push('<!--]-->');
|
|
167
189
|
}
|
|
168
190
|
|
|
169
|
-
|
|
170
|
-
}
|
|
191
|
+
_$_.output_push('</ul>');
|
|
192
|
+
});
|
|
171
193
|
|
|
172
|
-
__output.push('</ul>');
|
|
173
194
|
_$_.pop_component();
|
|
174
195
|
}
|
|
175
196
|
|
|
176
|
-
export function ForLoopInteractive(
|
|
197
|
+
export function ForLoopInteractive() {
|
|
177
198
|
_$_.push_component();
|
|
178
199
|
|
|
179
200
|
let lazy_2 = _$_.track([0, 0, 0]);
|
|
180
201
|
|
|
181
|
-
|
|
182
|
-
|
|
202
|
+
_$_.regular_block(() => {
|
|
203
|
+
_$_.output_push('<div');
|
|
204
|
+
_$_.output_push('>');
|
|
183
205
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
var i = 0;
|
|
206
|
+
{
|
|
207
|
+
_$_.output_push('<!--[-->');
|
|
188
208
|
|
|
189
|
-
|
|
190
|
-
__output.push('<div');
|
|
191
|
-
__output.push(_$_.attr('class', `item-${i}`));
|
|
192
|
-
__output.push('>');
|
|
209
|
+
var i = 0;
|
|
193
210
|
|
|
194
|
-
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
for (const count of _$_.get(lazy_2)) {
|
|
212
|
+
_$_.output_push('<div');
|
|
213
|
+
_$_.output_push(_$_.attr('class', `item-${i}`));
|
|
214
|
+
_$_.output_push('>');
|
|
198
215
|
|
|
199
216
|
{
|
|
200
|
-
|
|
201
|
-
|
|
217
|
+
_$_.output_push('<span');
|
|
218
|
+
_$_.output_push(' class="value"');
|
|
219
|
+
_$_.output_push('>');
|
|
202
220
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
__output.push('>');
|
|
221
|
+
{
|
|
222
|
+
_$_.output_push(_$_.escape(count));
|
|
223
|
+
}
|
|
207
224
|
|
|
208
|
-
|
|
209
|
-
|
|
225
|
+
_$_.output_push('</span>');
|
|
226
|
+
_$_.output_push('<button');
|
|
227
|
+
_$_.output_push(' class="increment"');
|
|
228
|
+
_$_.output_push('>');
|
|
229
|
+
|
|
230
|
+
{
|
|
231
|
+
_$_.output_push('+');
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
_$_.output_push('</button>');
|
|
210
235
|
}
|
|
211
236
|
|
|
212
|
-
|
|
237
|
+
_$_.output_push('</div>');
|
|
238
|
+
i++;
|
|
213
239
|
}
|
|
214
240
|
|
|
215
|
-
|
|
216
|
-
i++;
|
|
241
|
+
_$_.output_push('<!--]-->');
|
|
217
242
|
}
|
|
218
243
|
|
|
219
|
-
|
|
220
|
-
}
|
|
244
|
+
_$_.output_push('</div>');
|
|
245
|
+
});
|
|
221
246
|
|
|
222
|
-
__output.push('</div>');
|
|
223
247
|
_$_.pop_component();
|
|
224
248
|
}
|
|
225
249
|
|
|
226
|
-
export function NestedForLoop(
|
|
250
|
+
export function NestedForLoop() {
|
|
227
251
|
_$_.push_component();
|
|
228
252
|
|
|
229
253
|
const grid = [[1, 2], [3, 4]];
|
|
230
254
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
255
|
+
_$_.regular_block(() => {
|
|
256
|
+
_$_.output_push('<div');
|
|
257
|
+
_$_.output_push(' class="grid"');
|
|
258
|
+
_$_.output_push('>');
|
|
234
259
|
|
|
235
|
-
|
|
236
|
-
|
|
260
|
+
{
|
|
261
|
+
_$_.output_push('<!--[-->');
|
|
237
262
|
|
|
238
|
-
|
|
263
|
+
var rowIndex = 0;
|
|
239
264
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
265
|
+
for (const row of grid) {
|
|
266
|
+
_$_.output_push('<div');
|
|
267
|
+
_$_.output_push(_$_.attr('class', `row-${rowIndex}`));
|
|
268
|
+
_$_.output_push('>');
|
|
244
269
|
|
|
245
|
-
|
|
246
|
-
|
|
270
|
+
{
|
|
271
|
+
_$_.output_push('<!--[-->');
|
|
247
272
|
|
|
248
|
-
|
|
273
|
+
var colIndex = 0;
|
|
249
274
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
275
|
+
for (const cell of row) {
|
|
276
|
+
_$_.output_push('<span');
|
|
277
|
+
_$_.output_push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
|
|
278
|
+
_$_.output_push('>');
|
|
254
279
|
|
|
255
|
-
|
|
256
|
-
|
|
280
|
+
{
|
|
281
|
+
_$_.output_push(_$_.escape(cell));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
_$_.output_push('</span>');
|
|
285
|
+
colIndex++;
|
|
257
286
|
}
|
|
258
287
|
|
|
259
|
-
|
|
260
|
-
colIndex++;
|
|
288
|
+
_$_.output_push('<!--]-->');
|
|
261
289
|
}
|
|
262
290
|
|
|
263
|
-
|
|
291
|
+
_$_.output_push('</div>');
|
|
292
|
+
rowIndex++;
|
|
264
293
|
}
|
|
265
294
|
|
|
266
|
-
|
|
267
|
-
rowIndex++;
|
|
295
|
+
_$_.output_push('<!--]-->');
|
|
268
296
|
}
|
|
269
297
|
|
|
270
|
-
|
|
271
|
-
}
|
|
298
|
+
_$_.output_push('</div>');
|
|
299
|
+
});
|
|
272
300
|
|
|
273
|
-
__output.push('</div>');
|
|
274
301
|
_$_.pop_component();
|
|
275
302
|
}
|
|
276
303
|
|
|
277
|
-
export function EmptyForLoop(
|
|
304
|
+
export function EmptyForLoop() {
|
|
278
305
|
_$_.push_component();
|
|
279
306
|
|
|
280
307
|
const items = [];
|
|
281
308
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
309
|
+
_$_.regular_block(() => {
|
|
310
|
+
_$_.output_push('<div');
|
|
311
|
+
_$_.output_push(' class="container"');
|
|
312
|
+
_$_.output_push('>');
|
|
285
313
|
|
|
286
|
-
|
|
287
|
-
|
|
314
|
+
{
|
|
315
|
+
_$_.output_push('<!--[-->');
|
|
288
316
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
317
|
+
for (const item of items) {
|
|
318
|
+
_$_.output_push('<span');
|
|
319
|
+
_$_.output_push('>');
|
|
292
320
|
|
|
293
|
-
|
|
294
|
-
|
|
321
|
+
{
|
|
322
|
+
_$_.output_push(_$_.escape(item));
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
_$_.output_push('</span>');
|
|
295
326
|
}
|
|
296
327
|
|
|
297
|
-
|
|
328
|
+
_$_.output_push('<!--]-->');
|
|
298
329
|
}
|
|
299
330
|
|
|
300
|
-
|
|
301
|
-
}
|
|
331
|
+
_$_.output_push('</div>');
|
|
332
|
+
});
|
|
302
333
|
|
|
303
|
-
__output.push('</div>');
|
|
304
334
|
_$_.pop_component();
|
|
305
335
|
}
|
|
306
336
|
|
|
307
|
-
export function ForLoopComplexObjects(
|
|
337
|
+
export function ForLoopComplexObjects() {
|
|
308
338
|
_$_.push_component();
|
|
309
339
|
|
|
310
340
|
const users = [
|
|
@@ -312,49 +342,52 @@ export function ForLoopComplexObjects(__output) {
|
|
|
312
342
|
{ id: 2, name: 'Bob', role: 'User' }
|
|
313
343
|
];
|
|
314
344
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
{
|
|
319
|
-
__output.push('<!--[-->');
|
|
345
|
+
_$_.regular_block(() => {
|
|
346
|
+
_$_.output_push('<div');
|
|
347
|
+
_$_.output_push('>');
|
|
320
348
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
__output.push(_$_.attr('class', `user-${user.id}`));
|
|
324
|
-
__output.push('>');
|
|
349
|
+
{
|
|
350
|
+
_$_.output_push('<!--[-->');
|
|
325
351
|
|
|
326
|
-
{
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
352
|
+
for (const user of users) {
|
|
353
|
+
_$_.output_push('<div');
|
|
354
|
+
_$_.output_push(_$_.attr('class', `user-${user.id}`));
|
|
355
|
+
_$_.output_push('>');
|
|
330
356
|
|
|
331
357
|
{
|
|
332
|
-
|
|
333
|
-
|
|
358
|
+
_$_.output_push('<span');
|
|
359
|
+
_$_.output_push(' class="name"');
|
|
360
|
+
_$_.output_push('>');
|
|
334
361
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
__output.push('>');
|
|
362
|
+
{
|
|
363
|
+
_$_.output_push(_$_.escape(user.name));
|
|
364
|
+
}
|
|
339
365
|
|
|
340
|
-
|
|
341
|
-
|
|
366
|
+
_$_.output_push('</span>');
|
|
367
|
+
_$_.output_push('<span');
|
|
368
|
+
_$_.output_push(' class="role"');
|
|
369
|
+
_$_.output_push('>');
|
|
370
|
+
|
|
371
|
+
{
|
|
372
|
+
_$_.output_push(_$_.escape(user.role));
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
_$_.output_push('</span>');
|
|
342
376
|
}
|
|
343
377
|
|
|
344
|
-
|
|
378
|
+
_$_.output_push('</div>');
|
|
345
379
|
}
|
|
346
380
|
|
|
347
|
-
|
|
381
|
+
_$_.output_push('<!--]-->');
|
|
348
382
|
}
|
|
349
383
|
|
|
350
|
-
|
|
351
|
-
}
|
|
384
|
+
_$_.output_push('</div>');
|
|
385
|
+
});
|
|
352
386
|
|
|
353
|
-
__output.push('</div>');
|
|
354
387
|
_$_.pop_component();
|
|
355
388
|
}
|
|
356
389
|
|
|
357
|
-
export function KeyedForLoopReorder(
|
|
390
|
+
export function KeyedForLoopReorder() {
|
|
358
391
|
_$_.push_component();
|
|
359
392
|
|
|
360
393
|
let lazy_3 = _$_.track([
|
|
@@ -363,321 +396,369 @@ export function KeyedForLoopReorder(__output) {
|
|
|
363
396
|
{ id: 3, name: 'Third' }
|
|
364
397
|
]);
|
|
365
398
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
399
|
+
_$_.regular_block(() => {
|
|
400
|
+
_$_.output_push('<button');
|
|
401
|
+
_$_.output_push(' class="reorder"');
|
|
402
|
+
_$_.output_push('>');
|
|
369
403
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
404
|
+
{
|
|
405
|
+
_$_.output_push('Reorder');
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
_$_.output_push('</button>');
|
|
409
|
+
});
|
|
373
410
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
411
|
+
_$_.regular_block(() => {
|
|
412
|
+
_$_.output_push('<ul');
|
|
413
|
+
_$_.output_push('>');
|
|
377
414
|
|
|
378
|
-
|
|
379
|
-
|
|
415
|
+
{
|
|
416
|
+
_$_.output_push('<!--[-->');
|
|
380
417
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
418
|
+
for (const item of _$_.get(lazy_3)) {
|
|
419
|
+
_$_.output_push('<li');
|
|
420
|
+
_$_.output_push(_$_.attr('class', `item-${item.id}`));
|
|
421
|
+
_$_.output_push('>');
|
|
385
422
|
|
|
386
|
-
|
|
387
|
-
|
|
423
|
+
{
|
|
424
|
+
_$_.output_push(_$_.escape(item.name));
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
_$_.output_push('</li>');
|
|
388
428
|
}
|
|
389
429
|
|
|
390
|
-
|
|
430
|
+
_$_.output_push('<!--]-->');
|
|
391
431
|
}
|
|
392
432
|
|
|
393
|
-
|
|
394
|
-
}
|
|
433
|
+
_$_.output_push('</ul>');
|
|
434
|
+
});
|
|
395
435
|
|
|
396
|
-
__output.push('</ul>');
|
|
397
436
|
_$_.pop_component();
|
|
398
437
|
}
|
|
399
438
|
|
|
400
|
-
export function KeyedForLoopUpdate(
|
|
439
|
+
export function KeyedForLoopUpdate() {
|
|
401
440
|
_$_.push_component();
|
|
402
441
|
|
|
403
442
|
let lazy_4 = _$_.track([{ id: 1, name: 'Item 1' }, { id: 2, name: 'Item 2' }]);
|
|
404
443
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
444
|
+
_$_.regular_block(() => {
|
|
445
|
+
_$_.output_push('<button');
|
|
446
|
+
_$_.output_push(' class="update"');
|
|
447
|
+
_$_.output_push('>');
|
|
408
448
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
449
|
+
{
|
|
450
|
+
_$_.output_push('Update');
|
|
451
|
+
}
|
|
412
452
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
__output.push('>');
|
|
453
|
+
_$_.output_push('</button>');
|
|
454
|
+
});
|
|
416
455
|
|
|
417
|
-
{
|
|
418
|
-
|
|
456
|
+
_$_.regular_block(() => {
|
|
457
|
+
_$_.output_push('<ul');
|
|
458
|
+
_$_.output_push('>');
|
|
419
459
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
__output.push(_$_.attr('class', `item-${item.id}`));
|
|
423
|
-
__output.push('>');
|
|
460
|
+
{
|
|
461
|
+
_$_.output_push('<!--[-->');
|
|
424
462
|
|
|
425
|
-
{
|
|
426
|
-
|
|
463
|
+
for (const item of _$_.get(lazy_4)) {
|
|
464
|
+
_$_.output_push('<li');
|
|
465
|
+
_$_.output_push(_$_.attr('class', `item-${item.id}`));
|
|
466
|
+
_$_.output_push('>');
|
|
467
|
+
|
|
468
|
+
{
|
|
469
|
+
_$_.output_push(_$_.escape(item.name));
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
_$_.output_push('</li>');
|
|
427
473
|
}
|
|
428
474
|
|
|
429
|
-
|
|
475
|
+
_$_.output_push('<!--]-->');
|
|
430
476
|
}
|
|
431
477
|
|
|
432
|
-
|
|
433
|
-
}
|
|
478
|
+
_$_.output_push('</ul>');
|
|
479
|
+
});
|
|
434
480
|
|
|
435
|
-
__output.push('</ul>');
|
|
436
481
|
_$_.pop_component();
|
|
437
482
|
}
|
|
438
483
|
|
|
439
|
-
export function ForLoopMixedOperations(
|
|
484
|
+
export function ForLoopMixedOperations() {
|
|
440
485
|
_$_.push_component();
|
|
441
486
|
|
|
442
487
|
let lazy_5 = _$_.track(['A', 'B', 'C', 'D']);
|
|
443
488
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
489
|
+
_$_.regular_block(() => {
|
|
490
|
+
_$_.output_push('<button');
|
|
491
|
+
_$_.output_push(' class="shuffle"');
|
|
492
|
+
_$_.output_push('>');
|
|
447
493
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
494
|
+
{
|
|
495
|
+
_$_.output_push('Shuffle');
|
|
496
|
+
}
|
|
451
497
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
__output.push('>');
|
|
498
|
+
_$_.output_push('</button>');
|
|
499
|
+
});
|
|
455
500
|
|
|
456
|
-
{
|
|
457
|
-
|
|
501
|
+
_$_.regular_block(() => {
|
|
502
|
+
_$_.output_push('<ul');
|
|
503
|
+
_$_.output_push('>');
|
|
458
504
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
__output.push(_$_.attr('class', `item-${item}`));
|
|
462
|
-
__output.push('>');
|
|
505
|
+
{
|
|
506
|
+
_$_.output_push('<!--[-->');
|
|
463
507
|
|
|
464
|
-
{
|
|
465
|
-
|
|
508
|
+
for (const item of _$_.get(lazy_5)) {
|
|
509
|
+
_$_.output_push('<li');
|
|
510
|
+
_$_.output_push(_$_.attr('class', `item-${item}`));
|
|
511
|
+
_$_.output_push('>');
|
|
512
|
+
|
|
513
|
+
{
|
|
514
|
+
_$_.output_push(_$_.escape(item));
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
_$_.output_push('</li>');
|
|
466
518
|
}
|
|
467
519
|
|
|
468
|
-
|
|
520
|
+
_$_.output_push('<!--]-->');
|
|
469
521
|
}
|
|
470
522
|
|
|
471
|
-
|
|
472
|
-
}
|
|
523
|
+
_$_.output_push('</ul>');
|
|
524
|
+
});
|
|
473
525
|
|
|
474
|
-
__output.push('</ul>');
|
|
475
526
|
_$_.pop_component();
|
|
476
527
|
}
|
|
477
528
|
|
|
478
|
-
export function ForLoopInsideIf(
|
|
529
|
+
export function ForLoopInsideIf() {
|
|
479
530
|
_$_.push_component();
|
|
480
531
|
|
|
481
532
|
let lazy_6 = _$_.track(true);
|
|
482
533
|
let lazy_7 = _$_.track(['X', 'Y', 'Z']);
|
|
483
534
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
535
|
+
_$_.regular_block(() => {
|
|
536
|
+
_$_.output_push('<button');
|
|
537
|
+
_$_.output_push(' class="toggle"');
|
|
538
|
+
_$_.output_push('>');
|
|
487
539
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
540
|
+
{
|
|
541
|
+
_$_.output_push('Toggle List');
|
|
542
|
+
}
|
|
491
543
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
__output.push(' class="add"');
|
|
495
|
-
__output.push('>');
|
|
544
|
+
_$_.output_push('</button>');
|
|
545
|
+
});
|
|
496
546
|
|
|
497
|
-
{
|
|
498
|
-
|
|
499
|
-
|
|
547
|
+
_$_.regular_block(() => {
|
|
548
|
+
_$_.output_push('<button');
|
|
549
|
+
_$_.output_push(' class="add"');
|
|
550
|
+
_$_.output_push('>');
|
|
500
551
|
|
|
501
|
-
|
|
502
|
-
|
|
552
|
+
{
|
|
553
|
+
_$_.output_push('Add Item');
|
|
554
|
+
}
|
|
503
555
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
__output.push(' class="list"');
|
|
507
|
-
__output.push('>');
|
|
556
|
+
_$_.output_push('</button>');
|
|
557
|
+
});
|
|
508
558
|
|
|
509
|
-
|
|
510
|
-
|
|
559
|
+
_$_.regular_block(() => {
|
|
560
|
+
_$_.output_push('<!--[-->');
|
|
511
561
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
562
|
+
if (_$_.get(lazy_6)) {
|
|
563
|
+
_$_.output_push('<ul');
|
|
564
|
+
_$_.output_push(' class="list"');
|
|
565
|
+
_$_.output_push('>');
|
|
515
566
|
|
|
516
|
-
|
|
517
|
-
|
|
567
|
+
{
|
|
568
|
+
_$_.output_push('<!--[-->');
|
|
569
|
+
|
|
570
|
+
for (const item of _$_.get(lazy_7)) {
|
|
571
|
+
_$_.output_push('<li');
|
|
572
|
+
_$_.output_push('>');
|
|
573
|
+
|
|
574
|
+
{
|
|
575
|
+
_$_.output_push(_$_.escape(item));
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
_$_.output_push('</li>');
|
|
518
579
|
}
|
|
519
580
|
|
|
520
|
-
|
|
581
|
+
_$_.output_push('<!--]-->');
|
|
521
582
|
}
|
|
522
583
|
|
|
523
|
-
|
|
584
|
+
_$_.output_push('</ul>');
|
|
524
585
|
}
|
|
525
586
|
|
|
526
|
-
|
|
527
|
-
}
|
|
587
|
+
_$_.output_push('<!--]-->');
|
|
588
|
+
});
|
|
528
589
|
|
|
529
|
-
__output.push('<!--]-->');
|
|
530
590
|
_$_.pop_component();
|
|
531
591
|
}
|
|
532
592
|
|
|
533
|
-
export function ForLoopEmptyToPopulated(
|
|
593
|
+
export function ForLoopEmptyToPopulated() {
|
|
534
594
|
_$_.push_component();
|
|
535
595
|
|
|
536
596
|
let lazy_8 = _$_.track([]);
|
|
537
597
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
598
|
+
_$_.regular_block(() => {
|
|
599
|
+
_$_.output_push('<button');
|
|
600
|
+
_$_.output_push(' class="populate"');
|
|
601
|
+
_$_.output_push('>');
|
|
541
602
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
603
|
+
{
|
|
604
|
+
_$_.output_push('Populate');
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
_$_.output_push('</button>');
|
|
608
|
+
});
|
|
545
609
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
610
|
+
_$_.regular_block(() => {
|
|
611
|
+
_$_.output_push('<ul');
|
|
612
|
+
_$_.output_push(' class="list"');
|
|
613
|
+
_$_.output_push('>');
|
|
550
614
|
|
|
551
|
-
|
|
552
|
-
|
|
615
|
+
{
|
|
616
|
+
_$_.output_push('<!--[-->');
|
|
553
617
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
618
|
+
for (const item of _$_.get(lazy_8)) {
|
|
619
|
+
_$_.output_push('<li');
|
|
620
|
+
_$_.output_push('>');
|
|
557
621
|
|
|
558
|
-
|
|
559
|
-
|
|
622
|
+
{
|
|
623
|
+
_$_.output_push(_$_.escape(item));
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
_$_.output_push('</li>');
|
|
560
627
|
}
|
|
561
628
|
|
|
562
|
-
|
|
629
|
+
_$_.output_push('<!--]-->');
|
|
563
630
|
}
|
|
564
631
|
|
|
565
|
-
|
|
566
|
-
}
|
|
632
|
+
_$_.output_push('</ul>');
|
|
633
|
+
});
|
|
567
634
|
|
|
568
|
-
__output.push('</ul>');
|
|
569
635
|
_$_.pop_component();
|
|
570
636
|
}
|
|
571
637
|
|
|
572
|
-
export function ForLoopPopulatedToEmpty(
|
|
638
|
+
export function ForLoopPopulatedToEmpty() {
|
|
573
639
|
_$_.push_component();
|
|
574
640
|
|
|
575
641
|
let lazy_9 = _$_.track(['One', 'Two', 'Three']);
|
|
576
642
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
643
|
+
_$_.regular_block(() => {
|
|
644
|
+
_$_.output_push('<button');
|
|
645
|
+
_$_.output_push(' class="clear"');
|
|
646
|
+
_$_.output_push('>');
|
|
580
647
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
648
|
+
{
|
|
649
|
+
_$_.output_push('Clear');
|
|
650
|
+
}
|
|
584
651
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
__output.push(' class="list"');
|
|
588
|
-
__output.push('>');
|
|
652
|
+
_$_.output_push('</button>');
|
|
653
|
+
});
|
|
589
654
|
|
|
590
|
-
{
|
|
591
|
-
|
|
655
|
+
_$_.regular_block(() => {
|
|
656
|
+
_$_.output_push('<ul');
|
|
657
|
+
_$_.output_push(' class="list"');
|
|
658
|
+
_$_.output_push('>');
|
|
592
659
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
__output.push('>');
|
|
660
|
+
{
|
|
661
|
+
_$_.output_push('<!--[-->');
|
|
596
662
|
|
|
597
|
-
{
|
|
598
|
-
|
|
663
|
+
for (const item of _$_.get(lazy_9)) {
|
|
664
|
+
_$_.output_push('<li');
|
|
665
|
+
_$_.output_push('>');
|
|
666
|
+
|
|
667
|
+
{
|
|
668
|
+
_$_.output_push(_$_.escape(item));
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
_$_.output_push('</li>');
|
|
599
672
|
}
|
|
600
673
|
|
|
601
|
-
|
|
674
|
+
_$_.output_push('<!--]-->');
|
|
602
675
|
}
|
|
603
676
|
|
|
604
|
-
|
|
605
|
-
}
|
|
677
|
+
_$_.output_push('</ul>');
|
|
678
|
+
});
|
|
606
679
|
|
|
607
|
-
__output.push('</ul>');
|
|
608
680
|
_$_.pop_component();
|
|
609
681
|
}
|
|
610
682
|
|
|
611
|
-
export function NestedForLoopReactive(
|
|
683
|
+
export function NestedForLoopReactive() {
|
|
612
684
|
_$_.push_component();
|
|
613
685
|
|
|
614
686
|
let lazy_10 = _$_.track([[1, 2], [3, 4]]);
|
|
615
687
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
688
|
+
_$_.regular_block(() => {
|
|
689
|
+
_$_.output_push('<button');
|
|
690
|
+
_$_.output_push(' class="add-row"');
|
|
691
|
+
_$_.output_push('>');
|
|
619
692
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
693
|
+
{
|
|
694
|
+
_$_.output_push('Add Row');
|
|
695
|
+
}
|
|
623
696
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
__output.push(' class="update-cell"');
|
|
627
|
-
__output.push('>');
|
|
697
|
+
_$_.output_push('</button>');
|
|
698
|
+
});
|
|
628
699
|
|
|
629
|
-
{
|
|
630
|
-
|
|
631
|
-
|
|
700
|
+
_$_.regular_block(() => {
|
|
701
|
+
_$_.output_push('<button');
|
|
702
|
+
_$_.output_push(' class="update-cell"');
|
|
703
|
+
_$_.output_push('>');
|
|
632
704
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
__output.push('>');
|
|
705
|
+
{
|
|
706
|
+
_$_.output_push('Update Cell');
|
|
707
|
+
}
|
|
637
708
|
|
|
638
|
-
|
|
639
|
-
|
|
709
|
+
_$_.output_push('</button>');
|
|
710
|
+
});
|
|
640
711
|
|
|
641
|
-
|
|
712
|
+
_$_.regular_block(() => {
|
|
713
|
+
_$_.output_push('<div');
|
|
714
|
+
_$_.output_push(' class="grid"');
|
|
715
|
+
_$_.output_push('>');
|
|
642
716
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
__output.push(_$_.attr('class', `row-${rowIndex}`));
|
|
646
|
-
__output.push('>');
|
|
717
|
+
{
|
|
718
|
+
_$_.output_push('<!--[-->');
|
|
647
719
|
|
|
648
|
-
|
|
649
|
-
__output.push('<!--[-->');
|
|
720
|
+
var rowIndex = 0;
|
|
650
721
|
|
|
651
|
-
|
|
722
|
+
for (const row of _$_.get(lazy_10)) {
|
|
723
|
+
_$_.output_push('<div');
|
|
724
|
+
_$_.output_push(_$_.attr('class', `row-${rowIndex}`));
|
|
725
|
+
_$_.output_push('>');
|
|
652
726
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
__output.push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
|
|
656
|
-
__output.push('>');
|
|
727
|
+
{
|
|
728
|
+
_$_.output_push('<!--[-->');
|
|
657
729
|
|
|
658
|
-
|
|
659
|
-
|
|
730
|
+
var colIndex = 0;
|
|
731
|
+
|
|
732
|
+
for (const cell of row) {
|
|
733
|
+
_$_.output_push('<span');
|
|
734
|
+
_$_.output_push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
|
|
735
|
+
_$_.output_push('>');
|
|
736
|
+
|
|
737
|
+
{
|
|
738
|
+
_$_.output_push(_$_.escape(cell));
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
_$_.output_push('</span>');
|
|
742
|
+
colIndex++;
|
|
660
743
|
}
|
|
661
744
|
|
|
662
|
-
|
|
663
|
-
colIndex++;
|
|
745
|
+
_$_.output_push('<!--]-->');
|
|
664
746
|
}
|
|
665
747
|
|
|
666
|
-
|
|
748
|
+
_$_.output_push('</div>');
|
|
749
|
+
rowIndex++;
|
|
667
750
|
}
|
|
668
751
|
|
|
669
|
-
|
|
670
|
-
rowIndex++;
|
|
752
|
+
_$_.output_push('<!--]-->');
|
|
671
753
|
}
|
|
672
754
|
|
|
673
|
-
|
|
674
|
-
}
|
|
755
|
+
_$_.output_push('</div>');
|
|
756
|
+
});
|
|
675
757
|
|
|
676
|
-
__output.push('</div>');
|
|
677
758
|
_$_.pop_component();
|
|
678
759
|
}
|
|
679
760
|
|
|
680
|
-
export function ForLoopDeeplyNested(
|
|
761
|
+
export function ForLoopDeeplyNested() {
|
|
681
762
|
_$_.push_component();
|
|
682
763
|
|
|
683
764
|
const departments = [
|
|
@@ -697,128 +778,137 @@ export function ForLoopDeeplyNested(__output) {
|
|
|
697
778
|
}
|
|
698
779
|
];
|
|
699
780
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
{
|
|
705
|
-
__output.push('<!--[-->');
|
|
781
|
+
_$_.regular_block(() => {
|
|
782
|
+
_$_.output_push('<div');
|
|
783
|
+
_$_.output_push(' class="org"');
|
|
784
|
+
_$_.output_push('>');
|
|
706
785
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
__output.push(_$_.attr('class', `dept-${dept.id}`));
|
|
710
|
-
__output.push('>');
|
|
786
|
+
{
|
|
787
|
+
_$_.output_push('<!--[-->');
|
|
711
788
|
|
|
712
|
-
{
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
789
|
+
for (const dept of departments) {
|
|
790
|
+
_$_.output_push('<div');
|
|
791
|
+
_$_.output_push(_$_.attr('class', `dept-${dept.id}`));
|
|
792
|
+
_$_.output_push('>');
|
|
716
793
|
|
|
717
794
|
{
|
|
718
|
-
|
|
719
|
-
|
|
795
|
+
_$_.output_push('<h2');
|
|
796
|
+
_$_.output_push(' class="dept-name"');
|
|
797
|
+
_$_.output_push('>');
|
|
720
798
|
|
|
721
|
-
|
|
722
|
-
|
|
799
|
+
{
|
|
800
|
+
_$_.output_push(_$_.escape(dept.name));
|
|
801
|
+
}
|
|
723
802
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
__output.push(_$_.attr('class', `team-${team.id}`));
|
|
727
|
-
__output.push('>');
|
|
803
|
+
_$_.output_push('</h2>');
|
|
804
|
+
_$_.output_push('<!--[-->');
|
|
728
805
|
|
|
729
|
-
{
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
806
|
+
for (const team of dept.teams) {
|
|
807
|
+
_$_.output_push('<div');
|
|
808
|
+
_$_.output_push(_$_.attr('class', `team-${team.id}`));
|
|
809
|
+
_$_.output_push('>');
|
|
733
810
|
|
|
734
811
|
{
|
|
735
|
-
|
|
736
|
-
|
|
812
|
+
_$_.output_push('<h3');
|
|
813
|
+
_$_.output_push(' class="team-name"');
|
|
814
|
+
_$_.output_push('>');
|
|
737
815
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
816
|
+
{
|
|
817
|
+
_$_.output_push(_$_.escape(team.name));
|
|
818
|
+
}
|
|
741
819
|
|
|
742
|
-
|
|
743
|
-
|
|
820
|
+
_$_.output_push('</h3>');
|
|
821
|
+
_$_.output_push('<ul');
|
|
822
|
+
_$_.output_push('>');
|
|
823
|
+
|
|
824
|
+
{
|
|
825
|
+
_$_.output_push('<!--[-->');
|
|
826
|
+
|
|
827
|
+
for (const member of team.members) {
|
|
828
|
+
_$_.output_push('<li');
|
|
829
|
+
_$_.output_push(' class="member"');
|
|
830
|
+
_$_.output_push('>');
|
|
744
831
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
__output.push('>');
|
|
832
|
+
{
|
|
833
|
+
_$_.output_push(_$_.escape(member));
|
|
834
|
+
}
|
|
749
835
|
|
|
750
|
-
|
|
751
|
-
__output.push(_$_.escape(member));
|
|
836
|
+
_$_.output_push('</li>');
|
|
752
837
|
}
|
|
753
838
|
|
|
754
|
-
|
|
839
|
+
_$_.output_push('<!--]-->');
|
|
755
840
|
}
|
|
756
841
|
|
|
757
|
-
|
|
842
|
+
_$_.output_push('</ul>');
|
|
758
843
|
}
|
|
759
844
|
|
|
760
|
-
|
|
845
|
+
_$_.output_push('</div>');
|
|
761
846
|
}
|
|
762
847
|
|
|
763
|
-
|
|
848
|
+
_$_.output_push('<!--]-->');
|
|
764
849
|
}
|
|
765
850
|
|
|
766
|
-
|
|
851
|
+
_$_.output_push('</div>');
|
|
767
852
|
}
|
|
768
853
|
|
|
769
|
-
|
|
854
|
+
_$_.output_push('<!--]-->');
|
|
770
855
|
}
|
|
771
856
|
|
|
772
|
-
|
|
773
|
-
}
|
|
857
|
+
_$_.output_push('</div>');
|
|
858
|
+
});
|
|
774
859
|
|
|
775
|
-
__output.push('</div>');
|
|
776
860
|
_$_.pop_component();
|
|
777
861
|
}
|
|
778
862
|
|
|
779
|
-
export function ForLoopIndexUpdate(
|
|
863
|
+
export function ForLoopIndexUpdate() {
|
|
780
864
|
_$_.push_component();
|
|
781
865
|
|
|
782
866
|
let lazy_11 = _$_.track(['First', 'Second', 'Third']);
|
|
783
867
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
868
|
+
_$_.regular_block(() => {
|
|
869
|
+
_$_.output_push('<button');
|
|
870
|
+
_$_.output_push(' class="prepend"');
|
|
871
|
+
_$_.output_push('>');
|
|
872
|
+
|
|
873
|
+
{
|
|
874
|
+
_$_.output_push('Prepend');
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
_$_.output_push('</button>');
|
|
878
|
+
});
|
|
787
879
|
|
|
788
|
-
{
|
|
789
|
-
|
|
790
|
-
|
|
880
|
+
_$_.regular_block(() => {
|
|
881
|
+
_$_.output_push('<ul');
|
|
882
|
+
_$_.output_push('>');
|
|
791
883
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
__output.push('>');
|
|
884
|
+
{
|
|
885
|
+
_$_.output_push('<!--[-->');
|
|
795
886
|
|
|
796
|
-
|
|
797
|
-
__output.push('<!--[-->');
|
|
887
|
+
var i = 0;
|
|
798
888
|
|
|
799
|
-
|
|
889
|
+
for (const item of _$_.get(lazy_11)) {
|
|
890
|
+
_$_.output_push('<li');
|
|
891
|
+
_$_.output_push(_$_.attr('class', `item-${i}`));
|
|
892
|
+
_$_.output_push('>');
|
|
800
893
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
__output.push('>');
|
|
894
|
+
{
|
|
895
|
+
_$_.output_push(_$_.escape(`[${i}] ${item}`));
|
|
896
|
+
}
|
|
805
897
|
|
|
806
|
-
|
|
807
|
-
|
|
898
|
+
_$_.output_push('</li>');
|
|
899
|
+
i++;
|
|
808
900
|
}
|
|
809
901
|
|
|
810
|
-
|
|
811
|
-
i++;
|
|
902
|
+
_$_.output_push('<!--]-->');
|
|
812
903
|
}
|
|
813
904
|
|
|
814
|
-
|
|
815
|
-
}
|
|
905
|
+
_$_.output_push('</ul>');
|
|
906
|
+
});
|
|
816
907
|
|
|
817
|
-
__output.push('</ul>');
|
|
818
908
|
_$_.pop_component();
|
|
819
909
|
}
|
|
820
910
|
|
|
821
|
-
export function KeyedForLoopWithIndex(
|
|
911
|
+
export function KeyedForLoopWithIndex() {
|
|
822
912
|
_$_.push_component();
|
|
823
913
|
|
|
824
914
|
let lazy_12 = _$_.track([
|
|
@@ -827,103 +917,115 @@ export function KeyedForLoopWithIndex(__output) {
|
|
|
827
917
|
{ id: 'c', value: 'Gamma' }
|
|
828
918
|
]);
|
|
829
919
|
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
920
|
+
_$_.regular_block(() => {
|
|
921
|
+
_$_.output_push('<button');
|
|
922
|
+
_$_.output_push(' class="reorder"');
|
|
923
|
+
_$_.output_push('>');
|
|
833
924
|
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
925
|
+
{
|
|
926
|
+
_$_.output_push('Rotate');
|
|
927
|
+
}
|
|
837
928
|
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
__output.push('>');
|
|
929
|
+
_$_.output_push('</button>');
|
|
930
|
+
});
|
|
841
931
|
|
|
842
|
-
{
|
|
843
|
-
|
|
932
|
+
_$_.regular_block(() => {
|
|
933
|
+
_$_.output_push('<ul');
|
|
934
|
+
_$_.output_push('>');
|
|
844
935
|
|
|
845
|
-
|
|
936
|
+
{
|
|
937
|
+
_$_.output_push('<!--[-->');
|
|
846
938
|
|
|
847
|
-
|
|
848
|
-
__output.push('<li');
|
|
849
|
-
__output.push(_$_.attr('data-index', i, false));
|
|
850
|
-
__output.push(_$_.attr('class', `item-${item.id}`));
|
|
851
|
-
__output.push('>');
|
|
939
|
+
var i = 0;
|
|
852
940
|
|
|
853
|
-
{
|
|
854
|
-
|
|
941
|
+
for (const item of _$_.get(lazy_12)) {
|
|
942
|
+
_$_.output_push('<li');
|
|
943
|
+
_$_.output_push(_$_.attr('data-index', i, false));
|
|
944
|
+
_$_.output_push(_$_.attr('class', `item-${item.id}`));
|
|
945
|
+
_$_.output_push('>');
|
|
946
|
+
|
|
947
|
+
{
|
|
948
|
+
_$_.output_push(_$_.escape(`[${i}] ${item.id}: ${item.value}`));
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
_$_.output_push('</li>');
|
|
952
|
+
i++;
|
|
855
953
|
}
|
|
856
954
|
|
|
857
|
-
|
|
858
|
-
i++;
|
|
955
|
+
_$_.output_push('<!--]-->');
|
|
859
956
|
}
|
|
860
957
|
|
|
861
|
-
|
|
862
|
-
}
|
|
958
|
+
_$_.output_push('</ul>');
|
|
959
|
+
});
|
|
863
960
|
|
|
864
|
-
__output.push('</ul>');
|
|
865
961
|
_$_.pop_component();
|
|
866
962
|
}
|
|
867
963
|
|
|
868
|
-
export function ForLoopWithSiblings(
|
|
964
|
+
export function ForLoopWithSiblings() {
|
|
869
965
|
_$_.push_component();
|
|
870
966
|
|
|
871
967
|
let lazy_13 = _$_.track(['A', 'B']);
|
|
872
968
|
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
{
|
|
878
|
-
__output.push('<header');
|
|
879
|
-
__output.push(' class="before"');
|
|
880
|
-
__output.push('>');
|
|
969
|
+
_$_.regular_block(() => {
|
|
970
|
+
_$_.output_push('<div');
|
|
971
|
+
_$_.output_push(' class="wrapper"');
|
|
972
|
+
_$_.output_push('>');
|
|
881
973
|
|
|
882
974
|
{
|
|
883
|
-
|
|
884
|
-
|
|
975
|
+
_$_.output_push('<header');
|
|
976
|
+
_$_.output_push(' class="before"');
|
|
977
|
+
_$_.output_push('>');
|
|
885
978
|
|
|
886
|
-
|
|
887
|
-
|
|
979
|
+
{
|
|
980
|
+
_$_.output_push('Before');
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
_$_.output_push('</header>');
|
|
984
|
+
_$_.output_push('<!--[-->');
|
|
985
|
+
|
|
986
|
+
for (const item of _$_.get(lazy_13)) {
|
|
987
|
+
_$_.output_push('<div');
|
|
988
|
+
_$_.output_push(_$_.attr('class', `item-${item}`));
|
|
989
|
+
_$_.output_push('>');
|
|
990
|
+
|
|
991
|
+
{
|
|
992
|
+
_$_.output_push(_$_.escape(item));
|
|
993
|
+
}
|
|
888
994
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
995
|
+
_$_.output_push('</div>');
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
_$_.output_push('<!--]-->');
|
|
999
|
+
_$_.output_push('<footer');
|
|
1000
|
+
_$_.output_push(' class="after"');
|
|
1001
|
+
_$_.output_push('>');
|
|
893
1002
|
|
|
894
1003
|
{
|
|
895
|
-
|
|
1004
|
+
_$_.output_push('After');
|
|
896
1005
|
}
|
|
897
1006
|
|
|
898
|
-
|
|
1007
|
+
_$_.output_push('</footer>');
|
|
899
1008
|
}
|
|
900
1009
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1010
|
+
_$_.output_push('</div>');
|
|
1011
|
+
});
|
|
1012
|
+
|
|
1013
|
+
_$_.regular_block(() => {
|
|
1014
|
+
_$_.output_push('<button');
|
|
1015
|
+
_$_.output_push(' class="add"');
|
|
1016
|
+
_$_.output_push('>');
|
|
905
1017
|
|
|
906
1018
|
{
|
|
907
|
-
|
|
1019
|
+
_$_.output_push('Add');
|
|
908
1020
|
}
|
|
909
1021
|
|
|
910
|
-
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
__output.push('</div>');
|
|
914
|
-
__output.push('<button');
|
|
915
|
-
__output.push(' class="add"');
|
|
916
|
-
__output.push('>');
|
|
1022
|
+
_$_.output_push('</button>');
|
|
1023
|
+
});
|
|
917
1024
|
|
|
918
|
-
{
|
|
919
|
-
__output.push('Add');
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
__output.push('</button>');
|
|
923
1025
|
_$_.pop_component();
|
|
924
1026
|
}
|
|
925
1027
|
|
|
926
|
-
export function ForLoopItemState(
|
|
1028
|
+
export function ForLoopItemState() {
|
|
927
1029
|
_$_.push_component();
|
|
928
1030
|
|
|
929
1031
|
const initialItems = [
|
|
@@ -932,313 +1034,355 @@ export function ForLoopItemState(__output) {
|
|
|
932
1034
|
{ id: 3, text: 'Todo 3' }
|
|
933
1035
|
];
|
|
934
1036
|
|
|
935
|
-
|
|
936
|
-
|
|
1037
|
+
_$_.regular_block(() => {
|
|
1038
|
+
_$_.output_push('<div');
|
|
1039
|
+
_$_.output_push('>');
|
|
937
1040
|
|
|
938
|
-
|
|
939
|
-
|
|
1041
|
+
{
|
|
1042
|
+
_$_.output_push('<!--[-->');
|
|
940
1043
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1044
|
+
for (const item of initialItems) {
|
|
1045
|
+
{
|
|
1046
|
+
const comp = TodoItem;
|
|
1047
|
+
const args = [{ id: item.id, text: item.text }];
|
|
945
1048
|
|
|
946
|
-
|
|
1049
|
+
comp(...args);
|
|
1050
|
+
}
|
|
947
1051
|
}
|
|
1052
|
+
|
|
1053
|
+
_$_.output_push('<!--]-->');
|
|
948
1054
|
}
|
|
949
1055
|
|
|
950
|
-
|
|
951
|
-
}
|
|
1056
|
+
_$_.output_push('</div>');
|
|
1057
|
+
});
|
|
952
1058
|
|
|
953
|
-
__output.push('</div>');
|
|
954
1059
|
_$_.pop_component();
|
|
955
1060
|
}
|
|
956
1061
|
|
|
957
|
-
function TodoItem(
|
|
1062
|
+
function TodoItem(props) {
|
|
958
1063
|
_$_.push_component();
|
|
959
1064
|
|
|
960
1065
|
let lazy_14 = _$_.track(false);
|
|
961
1066
|
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
{
|
|
967
|
-
__output.push('<input');
|
|
968
|
-
__output.push(' type="checkbox"');
|
|
969
|
-
__output.push(_$_.attr('checked', _$_.get(lazy_14), true));
|
|
970
|
-
__output.push(' class="checkbox"');
|
|
971
|
-
__output.push(' />');
|
|
972
|
-
__output.push('<span');
|
|
973
|
-
__output.push(_$_.attr('class', _$_.get(lazy_14) ? 'completed' : 'pending'));
|
|
974
|
-
__output.push('>');
|
|
1067
|
+
_$_.regular_block(() => {
|
|
1068
|
+
_$_.output_push('<div');
|
|
1069
|
+
_$_.output_push(_$_.attr('class', `todo-${props.id}`));
|
|
1070
|
+
_$_.output_push('>');
|
|
975
1071
|
|
|
976
1072
|
{
|
|
977
|
-
|
|
1073
|
+
_$_.output_push('<input');
|
|
1074
|
+
_$_.output_push(' type="checkbox"');
|
|
1075
|
+
_$_.output_push(_$_.attr('checked', _$_.get(lazy_14), true));
|
|
1076
|
+
_$_.output_push(' class="checkbox"');
|
|
1077
|
+
_$_.output_push(' />');
|
|
1078
|
+
_$_.output_push('<span');
|
|
1079
|
+
_$_.output_push(_$_.attr('class', _$_.get(lazy_14) ? 'completed' : 'pending'));
|
|
1080
|
+
_$_.output_push('>');
|
|
1081
|
+
|
|
1082
|
+
{
|
|
1083
|
+
_$_.output_push(_$_.escape(props.text));
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
_$_.output_push('</span>');
|
|
978
1087
|
}
|
|
979
1088
|
|
|
980
|
-
|
|
981
|
-
}
|
|
1089
|
+
_$_.output_push('</div>');
|
|
1090
|
+
});
|
|
982
1091
|
|
|
983
|
-
__output.push('</div>');
|
|
984
1092
|
_$_.pop_component();
|
|
985
1093
|
}
|
|
986
1094
|
|
|
987
|
-
export function ForLoopSingleItem(
|
|
1095
|
+
export function ForLoopSingleItem() {
|
|
988
1096
|
_$_.push_component();
|
|
989
1097
|
|
|
990
1098
|
const items = ['Only'];
|
|
991
1099
|
|
|
992
|
-
|
|
993
|
-
|
|
1100
|
+
_$_.regular_block(() => {
|
|
1101
|
+
_$_.output_push('<ul');
|
|
1102
|
+
_$_.output_push('>');
|
|
994
1103
|
|
|
995
|
-
|
|
996
|
-
|
|
1104
|
+
{
|
|
1105
|
+
_$_.output_push('<!--[-->');
|
|
997
1106
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1107
|
+
for (const item of items) {
|
|
1108
|
+
_$_.output_push('<li');
|
|
1109
|
+
_$_.output_push(' class="single"');
|
|
1110
|
+
_$_.output_push('>');
|
|
1002
1111
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1112
|
+
{
|
|
1113
|
+
_$_.output_push(_$_.escape(item));
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
_$_.output_push('</li>');
|
|
1005
1117
|
}
|
|
1006
1118
|
|
|
1007
|
-
|
|
1119
|
+
_$_.output_push('<!--]-->');
|
|
1008
1120
|
}
|
|
1009
1121
|
|
|
1010
|
-
|
|
1011
|
-
}
|
|
1122
|
+
_$_.output_push('</ul>');
|
|
1123
|
+
});
|
|
1012
1124
|
|
|
1013
|
-
__output.push('</ul>');
|
|
1014
1125
|
_$_.pop_component();
|
|
1015
1126
|
}
|
|
1016
1127
|
|
|
1017
|
-
export function ForLoopAddAtBeginning(
|
|
1128
|
+
export function ForLoopAddAtBeginning() {
|
|
1018
1129
|
_$_.push_component();
|
|
1019
1130
|
|
|
1020
1131
|
let lazy_15 = _$_.track(['B', 'C']);
|
|
1021
1132
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1133
|
+
_$_.regular_block(() => {
|
|
1134
|
+
_$_.output_push('<button');
|
|
1135
|
+
_$_.output_push(' class="prepend"');
|
|
1136
|
+
_$_.output_push('>');
|
|
1025
1137
|
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1138
|
+
{
|
|
1139
|
+
_$_.output_push('Prepend A');
|
|
1140
|
+
}
|
|
1029
1141
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
__output.push('>');
|
|
1142
|
+
_$_.output_push('</button>');
|
|
1143
|
+
});
|
|
1033
1144
|
|
|
1034
|
-
{
|
|
1035
|
-
|
|
1145
|
+
_$_.regular_block(() => {
|
|
1146
|
+
_$_.output_push('<ul');
|
|
1147
|
+
_$_.output_push('>');
|
|
1036
1148
|
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
__output.push(_$_.attr('class', `item-${item}`));
|
|
1040
|
-
__output.push('>');
|
|
1149
|
+
{
|
|
1150
|
+
_$_.output_push('<!--[-->');
|
|
1041
1151
|
|
|
1042
|
-
{
|
|
1043
|
-
|
|
1152
|
+
for (const item of _$_.get(lazy_15)) {
|
|
1153
|
+
_$_.output_push('<li');
|
|
1154
|
+
_$_.output_push(_$_.attr('class', `item-${item}`));
|
|
1155
|
+
_$_.output_push('>');
|
|
1156
|
+
|
|
1157
|
+
{
|
|
1158
|
+
_$_.output_push(_$_.escape(item));
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
_$_.output_push('</li>');
|
|
1044
1162
|
}
|
|
1045
1163
|
|
|
1046
|
-
|
|
1164
|
+
_$_.output_push('<!--]-->');
|
|
1047
1165
|
}
|
|
1048
1166
|
|
|
1049
|
-
|
|
1050
|
-
}
|
|
1167
|
+
_$_.output_push('</ul>');
|
|
1168
|
+
});
|
|
1051
1169
|
|
|
1052
|
-
__output.push('</ul>');
|
|
1053
1170
|
_$_.pop_component();
|
|
1054
1171
|
}
|
|
1055
1172
|
|
|
1056
|
-
export function ForLoopAddInMiddle(
|
|
1173
|
+
export function ForLoopAddInMiddle() {
|
|
1057
1174
|
_$_.push_component();
|
|
1058
1175
|
|
|
1059
1176
|
let lazy_16 = _$_.track(['A', 'C']);
|
|
1060
1177
|
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1178
|
+
_$_.regular_block(() => {
|
|
1179
|
+
_$_.output_push('<button');
|
|
1180
|
+
_$_.output_push(' class="insert"');
|
|
1181
|
+
_$_.output_push('>');
|
|
1182
|
+
|
|
1183
|
+
{
|
|
1184
|
+
_$_.output_push('Insert B');
|
|
1185
|
+
}
|
|
1064
1186
|
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
}
|
|
1187
|
+
_$_.output_push('</button>');
|
|
1188
|
+
});
|
|
1068
1189
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1190
|
+
_$_.regular_block(() => {
|
|
1191
|
+
_$_.output_push('<ul');
|
|
1192
|
+
_$_.output_push('>');
|
|
1072
1193
|
|
|
1073
|
-
|
|
1074
|
-
|
|
1194
|
+
{
|
|
1195
|
+
_$_.output_push('<!--[-->');
|
|
1075
1196
|
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1197
|
+
for (const item of _$_.get(lazy_16)) {
|
|
1198
|
+
_$_.output_push('<li');
|
|
1199
|
+
_$_.output_push(_$_.attr('class', `item-${item}`));
|
|
1200
|
+
_$_.output_push('>');
|
|
1080
1201
|
|
|
1081
|
-
|
|
1082
|
-
|
|
1202
|
+
{
|
|
1203
|
+
_$_.output_push(_$_.escape(item));
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
_$_.output_push('</li>');
|
|
1083
1207
|
}
|
|
1084
1208
|
|
|
1085
|
-
|
|
1209
|
+
_$_.output_push('<!--]-->');
|
|
1086
1210
|
}
|
|
1087
1211
|
|
|
1088
|
-
|
|
1089
|
-
}
|
|
1212
|
+
_$_.output_push('</ul>');
|
|
1213
|
+
});
|
|
1090
1214
|
|
|
1091
|
-
__output.push('</ul>');
|
|
1092
1215
|
_$_.pop_component();
|
|
1093
1216
|
}
|
|
1094
1217
|
|
|
1095
|
-
export function ForLoopRemoveFromMiddle(
|
|
1218
|
+
export function ForLoopRemoveFromMiddle() {
|
|
1096
1219
|
_$_.push_component();
|
|
1097
1220
|
|
|
1098
1221
|
let lazy_17 = _$_.track(['A', 'B', 'C']);
|
|
1099
1222
|
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1223
|
+
_$_.regular_block(() => {
|
|
1224
|
+
_$_.output_push('<button');
|
|
1225
|
+
_$_.output_push(' class="remove-middle"');
|
|
1226
|
+
_$_.output_push('>');
|
|
1103
1227
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1228
|
+
{
|
|
1229
|
+
_$_.output_push('Remove B');
|
|
1230
|
+
}
|
|
1107
1231
|
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
__output.push('>');
|
|
1232
|
+
_$_.output_push('</button>');
|
|
1233
|
+
});
|
|
1111
1234
|
|
|
1112
|
-
{
|
|
1113
|
-
|
|
1235
|
+
_$_.regular_block(() => {
|
|
1236
|
+
_$_.output_push('<ul');
|
|
1237
|
+
_$_.output_push('>');
|
|
1114
1238
|
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
__output.push(_$_.attr('class', `item-${item}`));
|
|
1118
|
-
__output.push('>');
|
|
1239
|
+
{
|
|
1240
|
+
_$_.output_push('<!--[-->');
|
|
1119
1241
|
|
|
1120
|
-
{
|
|
1121
|
-
|
|
1242
|
+
for (const item of _$_.get(lazy_17)) {
|
|
1243
|
+
_$_.output_push('<li');
|
|
1244
|
+
_$_.output_push(_$_.attr('class', `item-${item}`));
|
|
1245
|
+
_$_.output_push('>');
|
|
1246
|
+
|
|
1247
|
+
{
|
|
1248
|
+
_$_.output_push(_$_.escape(item));
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
_$_.output_push('</li>');
|
|
1122
1252
|
}
|
|
1123
1253
|
|
|
1124
|
-
|
|
1254
|
+
_$_.output_push('<!--]-->');
|
|
1125
1255
|
}
|
|
1126
1256
|
|
|
1127
|
-
|
|
1128
|
-
}
|
|
1257
|
+
_$_.output_push('</ul>');
|
|
1258
|
+
});
|
|
1129
1259
|
|
|
1130
|
-
__output.push('</ul>');
|
|
1131
1260
|
_$_.pop_component();
|
|
1132
1261
|
}
|
|
1133
1262
|
|
|
1134
|
-
export function ForLoopLargeList(
|
|
1263
|
+
export function ForLoopLargeList() {
|
|
1135
1264
|
_$_.push_component();
|
|
1136
1265
|
|
|
1137
1266
|
const items = Array.from({ length: 50 }, (_, i) => `Item ${i + 1}`);
|
|
1138
1267
|
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1268
|
+
_$_.regular_block(() => {
|
|
1269
|
+
_$_.output_push('<ul');
|
|
1270
|
+
_$_.output_push(' class="large-list"');
|
|
1271
|
+
_$_.output_push('>');
|
|
1142
1272
|
|
|
1143
|
-
|
|
1144
|
-
|
|
1273
|
+
{
|
|
1274
|
+
_$_.output_push('<!--[-->');
|
|
1145
1275
|
|
|
1146
|
-
|
|
1276
|
+
var i = 0;
|
|
1147
1277
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1278
|
+
for (const item of items) {
|
|
1279
|
+
_$_.output_push('<li');
|
|
1280
|
+
_$_.output_push(_$_.attr('class', `item-${i}`));
|
|
1281
|
+
_$_.output_push('>');
|
|
1152
1282
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1283
|
+
{
|
|
1284
|
+
_$_.output_push(_$_.escape(item));
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
_$_.output_push('</li>');
|
|
1288
|
+
i++;
|
|
1155
1289
|
}
|
|
1156
1290
|
|
|
1157
|
-
|
|
1158
|
-
i++;
|
|
1291
|
+
_$_.output_push('<!--]-->');
|
|
1159
1292
|
}
|
|
1160
1293
|
|
|
1161
|
-
|
|
1162
|
-
}
|
|
1294
|
+
_$_.output_push('</ul>');
|
|
1295
|
+
});
|
|
1163
1296
|
|
|
1164
|
-
__output.push('</ul>');
|
|
1165
1297
|
_$_.pop_component();
|
|
1166
1298
|
}
|
|
1167
1299
|
|
|
1168
|
-
export function ForLoopSwap(
|
|
1300
|
+
export function ForLoopSwap() {
|
|
1169
1301
|
_$_.push_component();
|
|
1170
1302
|
|
|
1171
1303
|
let lazy_18 = _$_.track(['A', 'B', 'C', 'D']);
|
|
1172
1304
|
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1305
|
+
_$_.regular_block(() => {
|
|
1306
|
+
_$_.output_push('<button');
|
|
1307
|
+
_$_.output_push(' class="swap"');
|
|
1308
|
+
_$_.output_push('>');
|
|
1176
1309
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1310
|
+
{
|
|
1311
|
+
_$_.output_push('Swap First and Last');
|
|
1312
|
+
}
|
|
1180
1313
|
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
__output.push('>');
|
|
1314
|
+
_$_.output_push('</button>');
|
|
1315
|
+
});
|
|
1184
1316
|
|
|
1185
|
-
{
|
|
1186
|
-
|
|
1317
|
+
_$_.regular_block(() => {
|
|
1318
|
+
_$_.output_push('<ul');
|
|
1319
|
+
_$_.output_push('>');
|
|
1187
1320
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
__output.push(_$_.attr('class', `item-${item}`));
|
|
1191
|
-
__output.push('>');
|
|
1321
|
+
{
|
|
1322
|
+
_$_.output_push('<!--[-->');
|
|
1192
1323
|
|
|
1193
|
-
{
|
|
1194
|
-
|
|
1324
|
+
for (const item of _$_.get(lazy_18)) {
|
|
1325
|
+
_$_.output_push('<li');
|
|
1326
|
+
_$_.output_push(_$_.attr('class', `item-${item}`));
|
|
1327
|
+
_$_.output_push('>');
|
|
1328
|
+
|
|
1329
|
+
{
|
|
1330
|
+
_$_.output_push(_$_.escape(item));
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
_$_.output_push('</li>');
|
|
1195
1334
|
}
|
|
1196
1335
|
|
|
1197
|
-
|
|
1336
|
+
_$_.output_push('<!--]-->');
|
|
1198
1337
|
}
|
|
1199
1338
|
|
|
1200
|
-
|
|
1201
|
-
}
|
|
1339
|
+
_$_.output_push('</ul>');
|
|
1340
|
+
});
|
|
1202
1341
|
|
|
1203
|
-
__output.push('</ul>');
|
|
1204
1342
|
_$_.pop_component();
|
|
1205
1343
|
}
|
|
1206
1344
|
|
|
1207
|
-
export function ForLoopReverse(
|
|
1345
|
+
export function ForLoopReverse() {
|
|
1208
1346
|
_$_.push_component();
|
|
1209
1347
|
|
|
1210
1348
|
let lazy_19 = _$_.track(['A', 'B', 'C', 'D']);
|
|
1211
1349
|
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1350
|
+
_$_.regular_block(() => {
|
|
1351
|
+
_$_.output_push('<button');
|
|
1352
|
+
_$_.output_push(' class="reverse"');
|
|
1353
|
+
_$_.output_push('>');
|
|
1354
|
+
|
|
1355
|
+
{
|
|
1356
|
+
_$_.output_push('Reverse');
|
|
1357
|
+
}
|
|
1215
1358
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
}
|
|
1359
|
+
_$_.output_push('</button>');
|
|
1360
|
+
});
|
|
1219
1361
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1362
|
+
_$_.regular_block(() => {
|
|
1363
|
+
_$_.output_push('<ul');
|
|
1364
|
+
_$_.output_push('>');
|
|
1223
1365
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1366
|
+
{
|
|
1367
|
+
_$_.output_push('<!--[-->');
|
|
1226
1368
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1369
|
+
for (const item of _$_.get(lazy_19)) {
|
|
1370
|
+
_$_.output_push('<li');
|
|
1371
|
+
_$_.output_push(_$_.attr('class', `item-${item}`));
|
|
1372
|
+
_$_.output_push('>');
|
|
1231
1373
|
|
|
1232
|
-
|
|
1233
|
-
|
|
1374
|
+
{
|
|
1375
|
+
_$_.output_push(_$_.escape(item));
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
_$_.output_push('</li>');
|
|
1234
1379
|
}
|
|
1235
1380
|
|
|
1236
|
-
|
|
1381
|
+
_$_.output_push('<!--]-->');
|
|
1237
1382
|
}
|
|
1238
1383
|
|
|
1239
|
-
|
|
1240
|
-
}
|
|
1384
|
+
_$_.output_push('</ul>');
|
|
1385
|
+
});
|
|
1241
1386
|
|
|
1242
|
-
__output.push('</ul>');
|
|
1243
1387
|
_$_.pop_component();
|
|
1244
1388
|
}
|