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,295 +3,328 @@ import * as _$_ from 'ripple/internal/server';
|
|
|
3
3
|
|
|
4
4
|
import { track } from 'ripple/server';
|
|
5
5
|
|
|
6
|
-
export function IfTruthy(
|
|
6
|
+
export function IfTruthy() {
|
|
7
7
|
_$_.push_component();
|
|
8
8
|
|
|
9
9
|
const show = true;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
_$_.regular_block(() => {
|
|
12
|
+
_$_.output_push('<!--[-->');
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (show) {
|
|
15
|
+
_$_.output_push('<div');
|
|
16
|
+
_$_.output_push(' class="shown"');
|
|
17
|
+
_$_.output_push('>');
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
{
|
|
20
|
+
_$_.output_push('Visible');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_$_.output_push('</div>');
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
}
|
|
26
|
+
_$_.output_push('<!--]-->');
|
|
27
|
+
});
|
|
24
28
|
|
|
25
|
-
__output.push('<!--]-->');
|
|
26
29
|
_$_.pop_component();
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
export function IfFalsy(
|
|
32
|
+
export function IfFalsy() {
|
|
30
33
|
_$_.push_component();
|
|
31
34
|
|
|
32
35
|
const show = false;
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
_$_.regular_block(() => {
|
|
38
|
+
_$_.output_push('<!--[-->');
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
if (show) {
|
|
41
|
+
_$_.output_push('<div');
|
|
42
|
+
_$_.output_push(' class="shown"');
|
|
43
|
+
_$_.output_push('>');
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
{
|
|
46
|
+
_$_.output_push('Visible');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_$_.output_push('</div>');
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
|
|
46
|
-
}
|
|
52
|
+
_$_.output_push('<!--]-->');
|
|
53
|
+
});
|
|
47
54
|
|
|
48
|
-
__output.push('<!--]-->');
|
|
49
55
|
_$_.pop_component();
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
export function IfElse(
|
|
58
|
+
export function IfElse() {
|
|
53
59
|
_$_.push_component();
|
|
54
60
|
|
|
55
61
|
const isLoggedIn = true;
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
_$_.regular_block(() => {
|
|
64
|
+
_$_.output_push('<!--[-->');
|
|
58
65
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
if (isLoggedIn) {
|
|
67
|
+
_$_.output_push('<div');
|
|
68
|
+
_$_.output_push(' class="logged-in"');
|
|
69
|
+
_$_.output_push('>');
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
{
|
|
72
|
+
_$_.output_push('Welcome back!');
|
|
73
|
+
}
|
|
67
74
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
_$_.output_push('</div>');
|
|
76
|
+
} else {
|
|
77
|
+
_$_.output_push('<div');
|
|
78
|
+
_$_.output_push(' class="logged-out"');
|
|
79
|
+
_$_.output_push('>');
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
{
|
|
82
|
+
_$_.output_push('Please log in');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
_$_.output_push('</div>');
|
|
76
86
|
}
|
|
77
87
|
|
|
78
|
-
|
|
79
|
-
}
|
|
88
|
+
_$_.output_push('<!--]-->');
|
|
89
|
+
});
|
|
80
90
|
|
|
81
|
-
__output.push('<!--]-->');
|
|
82
91
|
_$_.pop_component();
|
|
83
92
|
}
|
|
84
93
|
|
|
85
|
-
export function ReactiveIf(
|
|
94
|
+
export function ReactiveIf() {
|
|
86
95
|
_$_.push_component();
|
|
87
96
|
|
|
88
97
|
let lazy = _$_.track(true);
|
|
89
98
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
_$_.regular_block(() => {
|
|
100
|
+
_$_.output_push('<button');
|
|
101
|
+
_$_.output_push(' class="toggle"');
|
|
102
|
+
_$_.output_push('>');
|
|
93
103
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
{
|
|
105
|
+
_$_.output_push('Toggle');
|
|
106
|
+
}
|
|
97
107
|
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
_$_.output_push('</button>');
|
|
109
|
+
});
|
|
100
110
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
__output.push(' class="content"');
|
|
104
|
-
__output.push('>');
|
|
111
|
+
_$_.regular_block(() => {
|
|
112
|
+
_$_.output_push('<!--[-->');
|
|
105
113
|
|
|
106
|
-
{
|
|
107
|
-
|
|
114
|
+
if (_$_.get(lazy)) {
|
|
115
|
+
_$_.output_push('<div');
|
|
116
|
+
_$_.output_push(' class="content"');
|
|
117
|
+
_$_.output_push('>');
|
|
118
|
+
|
|
119
|
+
{
|
|
120
|
+
_$_.output_push('Content visible');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_$_.output_push('</div>');
|
|
108
124
|
}
|
|
109
125
|
|
|
110
|
-
|
|
111
|
-
}
|
|
126
|
+
_$_.output_push('<!--]-->');
|
|
127
|
+
});
|
|
112
128
|
|
|
113
|
-
__output.push('<!--]-->');
|
|
114
129
|
_$_.pop_component();
|
|
115
130
|
}
|
|
116
131
|
|
|
117
|
-
export function ReactiveIfElse(
|
|
132
|
+
export function ReactiveIfElse() {
|
|
118
133
|
_$_.push_component();
|
|
119
134
|
|
|
120
135
|
let lazy_1 = _$_.track(false);
|
|
121
136
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
137
|
+
_$_.regular_block(() => {
|
|
138
|
+
_$_.output_push('<button');
|
|
139
|
+
_$_.output_push(' class="toggle"');
|
|
140
|
+
_$_.output_push('>');
|
|
125
141
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
{
|
|
143
|
+
_$_.output_push('Toggle');
|
|
144
|
+
}
|
|
129
145
|
|
|
130
|
-
|
|
131
|
-
|
|
146
|
+
_$_.output_push('</button>');
|
|
147
|
+
});
|
|
132
148
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
__output.push(' class="on"');
|
|
136
|
-
__output.push('>');
|
|
149
|
+
_$_.regular_block(() => {
|
|
150
|
+
_$_.output_push('<!--[-->');
|
|
137
151
|
|
|
138
|
-
{
|
|
139
|
-
|
|
140
|
-
|
|
152
|
+
if (_$_.get(lazy_1)) {
|
|
153
|
+
_$_.output_push('<div');
|
|
154
|
+
_$_.output_push(' class="on"');
|
|
155
|
+
_$_.output_push('>');
|
|
141
156
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
__output.push(' class="off"');
|
|
146
|
-
__output.push('>');
|
|
157
|
+
{
|
|
158
|
+
_$_.output_push('ON');
|
|
159
|
+
}
|
|
147
160
|
|
|
148
|
-
|
|
149
|
-
|
|
161
|
+
_$_.output_push('</div>');
|
|
162
|
+
} else {
|
|
163
|
+
_$_.output_push('<div');
|
|
164
|
+
_$_.output_push(' class="off"');
|
|
165
|
+
_$_.output_push('>');
|
|
166
|
+
|
|
167
|
+
{
|
|
168
|
+
_$_.output_push('OFF');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
_$_.output_push('</div>');
|
|
150
172
|
}
|
|
151
173
|
|
|
152
|
-
|
|
153
|
-
}
|
|
174
|
+
_$_.output_push('<!--]-->');
|
|
175
|
+
});
|
|
154
176
|
|
|
155
|
-
__output.push('<!--]-->');
|
|
156
177
|
_$_.pop_component();
|
|
157
178
|
}
|
|
158
179
|
|
|
159
|
-
export function NestedIf(
|
|
180
|
+
export function NestedIf() {
|
|
160
181
|
_$_.push_component();
|
|
161
182
|
|
|
162
183
|
let lazy_2 = _$_.track(true);
|
|
163
184
|
let lazy_3 = _$_.track(true);
|
|
164
185
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
186
|
+
_$_.regular_block(() => {
|
|
187
|
+
_$_.output_push('<button');
|
|
188
|
+
_$_.output_push(' class="outer-toggle"');
|
|
189
|
+
_$_.output_push('>');
|
|
190
|
+
|
|
191
|
+
{
|
|
192
|
+
_$_.output_push('Outer');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
_$_.output_push('</button>');
|
|
196
|
+
});
|
|
168
197
|
|
|
169
|
-
{
|
|
170
|
-
|
|
171
|
-
|
|
198
|
+
_$_.regular_block(() => {
|
|
199
|
+
_$_.output_push('<button');
|
|
200
|
+
_$_.output_push(' class="inner-toggle"');
|
|
201
|
+
_$_.output_push('>');
|
|
172
202
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
__output.push('>');
|
|
203
|
+
{
|
|
204
|
+
_$_.output_push('Inner');
|
|
205
|
+
}
|
|
177
206
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
207
|
+
_$_.output_push('</button>');
|
|
208
|
+
});
|
|
181
209
|
|
|
182
|
-
|
|
183
|
-
|
|
210
|
+
_$_.regular_block(() => {
|
|
211
|
+
_$_.output_push('<!--[-->');
|
|
184
212
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
213
|
+
if (_$_.get(lazy_2)) {
|
|
214
|
+
_$_.output_push('<div');
|
|
215
|
+
_$_.output_push(' class="outer-content"');
|
|
216
|
+
_$_.output_push('>');
|
|
189
217
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
218
|
+
{
|
|
219
|
+
_$_.output_push('Outer');
|
|
220
|
+
_$_.output_push('<!--[-->');
|
|
193
221
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
222
|
+
if (_$_.get(lazy_3)) {
|
|
223
|
+
_$_.output_push('<span');
|
|
224
|
+
_$_.output_push(' class="inner-content"');
|
|
225
|
+
_$_.output_push('>');
|
|
198
226
|
|
|
199
|
-
|
|
200
|
-
|
|
227
|
+
{
|
|
228
|
+
_$_.output_push('Inner');
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
_$_.output_push('</span>');
|
|
201
232
|
}
|
|
202
233
|
|
|
203
|
-
|
|
234
|
+
_$_.output_push('<!--]-->');
|
|
204
235
|
}
|
|
205
236
|
|
|
206
|
-
|
|
237
|
+
_$_.output_push('</div>');
|
|
207
238
|
}
|
|
208
239
|
|
|
209
|
-
|
|
210
|
-
}
|
|
240
|
+
_$_.output_push('<!--]-->');
|
|
241
|
+
});
|
|
211
242
|
|
|
212
|
-
__output.push('<!--]-->');
|
|
213
243
|
_$_.pop_component();
|
|
214
244
|
}
|
|
215
245
|
|
|
216
|
-
export function IfElseIfChain(
|
|
246
|
+
export function IfElseIfChain() {
|
|
217
247
|
_$_.push_component();
|
|
218
248
|
|
|
219
249
|
let lazy_4 = _$_.track('loading');
|
|
220
250
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
{
|
|
225
|
-
__output.push('<button');
|
|
226
|
-
__output.push(' class="success"');
|
|
227
|
-
__output.push('>');
|
|
228
|
-
|
|
229
|
-
{
|
|
230
|
-
__output.push('Success');
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
__output.push('</button>');
|
|
234
|
-
__output.push('<button');
|
|
235
|
-
__output.push(' class="error"');
|
|
236
|
-
__output.push('>');
|
|
251
|
+
_$_.regular_block(() => {
|
|
252
|
+
_$_.output_push('<div');
|
|
253
|
+
_$_.output_push('>');
|
|
237
254
|
|
|
238
255
|
{
|
|
239
|
-
|
|
240
|
-
|
|
256
|
+
_$_.output_push('<button');
|
|
257
|
+
_$_.output_push(' class="success"');
|
|
258
|
+
_$_.output_push('>');
|
|
241
259
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
__output.push('>');
|
|
260
|
+
{
|
|
261
|
+
_$_.output_push('Success');
|
|
262
|
+
}
|
|
246
263
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
264
|
+
_$_.output_push('</button>');
|
|
265
|
+
_$_.output_push('<button');
|
|
266
|
+
_$_.output_push(' class="error"');
|
|
267
|
+
_$_.output_push('>');
|
|
250
268
|
|
|
251
|
-
|
|
252
|
-
|
|
269
|
+
{
|
|
270
|
+
_$_.output_push('Error');
|
|
271
|
+
}
|
|
253
272
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
273
|
+
_$_.output_push('</button>');
|
|
274
|
+
_$_.output_push('<button');
|
|
275
|
+
_$_.output_push(' class="loading"');
|
|
276
|
+
_$_.output_push('>');
|
|
258
277
|
|
|
259
278
|
{
|
|
260
|
-
|
|
279
|
+
_$_.output_push('Loading');
|
|
261
280
|
}
|
|
262
281
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
__output.push('<!--[-->');
|
|
282
|
+
_$_.output_push('</button>');
|
|
283
|
+
_$_.output_push('<!--[-->');
|
|
266
284
|
|
|
267
|
-
if (_$_.get(lazy_4) === '
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
285
|
+
if (_$_.get(lazy_4) === 'loading') {
|
|
286
|
+
_$_.output_push('<div');
|
|
287
|
+
_$_.output_push(' class="state"');
|
|
288
|
+
_$_.output_push('>');
|
|
271
289
|
|
|
272
290
|
{
|
|
273
|
-
|
|
291
|
+
_$_.output_push('Loading...');
|
|
274
292
|
}
|
|
275
293
|
|
|
276
|
-
|
|
294
|
+
_$_.output_push('</div>');
|
|
277
295
|
} else {
|
|
278
|
-
|
|
279
|
-
__output.push(' class="state"');
|
|
280
|
-
__output.push('>');
|
|
296
|
+
_$_.output_push('<!--[-->');
|
|
281
297
|
|
|
282
|
-
{
|
|
283
|
-
|
|
298
|
+
if (_$_.get(lazy_4) === 'success') {
|
|
299
|
+
_$_.output_push('<div');
|
|
300
|
+
_$_.output_push(' class="state"');
|
|
301
|
+
_$_.output_push('>');
|
|
302
|
+
|
|
303
|
+
{
|
|
304
|
+
_$_.output_push('Success!');
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
_$_.output_push('</div>');
|
|
308
|
+
} else {
|
|
309
|
+
_$_.output_push('<div');
|
|
310
|
+
_$_.output_push(' class="state"');
|
|
311
|
+
_$_.output_push('>');
|
|
312
|
+
|
|
313
|
+
{
|
|
314
|
+
_$_.output_push('Error occurred');
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
_$_.output_push('</div>');
|
|
284
318
|
}
|
|
285
319
|
|
|
286
|
-
|
|
320
|
+
_$_.output_push('<!--]-->');
|
|
287
321
|
}
|
|
288
322
|
|
|
289
|
-
|
|
323
|
+
_$_.output_push('<!--]-->');
|
|
290
324
|
}
|
|
291
325
|
|
|
292
|
-
|
|
293
|
-
}
|
|
326
|
+
_$_.output_push('</div>');
|
|
327
|
+
});
|
|
294
328
|
|
|
295
|
-
__output.push('</div>');
|
|
296
329
|
_$_.pop_component();
|
|
297
330
|
}
|