ripple 0.2.199 → 0.2.201
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/package.json +5 -4
- package/src/compiler/index.d.ts +1 -5
- package/src/compiler/phases/1-parse/index.js +145 -11
- package/src/compiler/phases/2-analyze/index.js +24 -8
- package/src/compiler/phases/2-analyze/prune.js +5 -3
- package/src/compiler/phases/3-transform/client/index.js +312 -165
- package/src/compiler/phases/3-transform/segments.js +220 -70
- package/src/compiler/phases/3-transform/server/index.js +227 -77
- package/src/compiler/source-map-utils.js +74 -10
- package/src/compiler/types/index.d.ts +63 -21
- package/src/compiler/types/parse.d.ts +3 -1
- package/src/compiler/utils.js +34 -0
- package/src/helpers.d.ts +5 -0
- package/src/runtime/index-server.js +27 -47
- package/src/runtime/internal/client/composite.js +5 -0
- package/src/runtime/internal/client/events.js +1 -9
- package/src/runtime/internal/client/for.js +6 -4
- package/src/runtime/internal/client/hydration.js +2 -2
- package/src/runtime/internal/client/index.js +1 -1
- package/src/runtime/internal/client/operations.js +4 -4
- package/src/runtime/internal/client/render.js +0 -2
- package/src/runtime/internal/client/template.js +9 -1
- package/src/runtime/internal/client/types.d.ts +18 -0
- package/src/runtime/internal/client/utils.js +1 -1
- package/src/runtime/internal/server/index.js +106 -3
- package/src/utils/builders.js +25 -5
- package/tests/client/basic/basic.attributes.test.ripple +1 -1
- package/tests/client/basic/basic.components.test.ripple +47 -0
- package/tests/client/basic/basic.rendering.test.ripple +1 -1
- package/tests/client/composite/composite.props.test.ripple +49 -4
- package/tests/client/dynamic-elements.test.ripple +44 -0
- package/tests/client/switch.test.ripple +40 -0
- package/tests/client/tsconfig.json +11 -0
- package/tests/client.d.ts +5 -22
- package/tests/common.d.ts +24 -0
- package/tests/hydration/compiled/server/basic.js +109 -24
- package/tests/hydration/compiled/server/events.js +161 -72
- package/tests/hydration/compiled/server/for.js +202 -102
- package/tests/hydration/compiled/server/if.js +130 -50
- package/tests/hydration/compiled/server/reactivity.js +51 -12
- package/tests/server/__snapshots__/compiler.test.ripple.snap +11 -4
- package/tests/server/basic.attributes.test.ripple +459 -0
- package/tests/server/basic.components.test.ripple +237 -0
- package/tests/server/basic.test.ripple +25 -0
- package/tests/server/compiler.test.ripple +2 -3
- package/tests/server/composite.props.test.ripple +161 -0
- package/tests/server/dynamic-elements.test.ripple +438 -0
- package/tests/server/head.test.ripple +102 -0
- package/tests/server/switch.test.ripple +40 -0
- package/tests/server/tsconfig.json +11 -0
- package/tests/server.d.ts +7 -0
- package/tests/setup-client.js +6 -2
- package/tests/setup-server.js +16 -0
- package/types/index.d.ts +2 -2
- package/types/server.d.ts +4 -3
|
@@ -9,16 +9,24 @@ export function StaticForLoop(__output) {
|
|
|
9
9
|
|
|
10
10
|
__output.push('<ul');
|
|
11
11
|
__output.push('>');
|
|
12
|
-
__output.push('<!--[-->');
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
__output.push('
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
{
|
|
14
|
+
__output.push('<!--[-->');
|
|
15
|
+
|
|
16
|
+
for (const item of items) {
|
|
17
|
+
__output.push('<li');
|
|
18
|
+
__output.push('>');
|
|
19
|
+
|
|
20
|
+
{
|
|
21
|
+
__output.push(_$_.escape(item));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
__output.push('</li>');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
__output.push('<!--]-->');
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
__output.push('<!--]-->');
|
|
22
30
|
__output.push('</ul>');
|
|
23
31
|
_$_.pop_component();
|
|
24
32
|
}
|
|
@@ -30,19 +38,27 @@ export function ForLoopWithIndex(__output) {
|
|
|
30
38
|
|
|
31
39
|
__output.push('<ul');
|
|
32
40
|
__output.push('>');
|
|
33
|
-
__output.push('<!--[-->');
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
{
|
|
43
|
+
__output.push('<!--[-->');
|
|
44
|
+
|
|
45
|
+
var i = 0;
|
|
46
|
+
|
|
47
|
+
for (const item of items) {
|
|
48
|
+
__output.push('<li');
|
|
49
|
+
__output.push('>');
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
__output.push(_$_.escape(`${i}: ${item}`));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
__output.push('</li>');
|
|
56
|
+
i++;
|
|
57
|
+
}
|
|
36
58
|
|
|
37
|
-
|
|
38
|
-
__output.push('<li');
|
|
39
|
-
__output.push('>');
|
|
40
|
-
__output.push(_$_.escape(`${i}: ${item}`));
|
|
41
|
-
__output.push('</li>');
|
|
42
|
-
i++;
|
|
59
|
+
__output.push('<!--]-->');
|
|
43
60
|
}
|
|
44
61
|
|
|
45
|
-
__output.push('<!--]-->');
|
|
46
62
|
__output.push('</ul>');
|
|
47
63
|
_$_.pop_component();
|
|
48
64
|
}
|
|
@@ -58,16 +74,24 @@ export function KeyedForLoop(__output) {
|
|
|
58
74
|
|
|
59
75
|
__output.push('<ul');
|
|
60
76
|
__output.push('>');
|
|
61
|
-
__output.push('<!--[-->');
|
|
62
77
|
|
|
63
|
-
|
|
64
|
-
__output.push('
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
{
|
|
79
|
+
__output.push('<!--[-->');
|
|
80
|
+
|
|
81
|
+
for (const item of items) {
|
|
82
|
+
__output.push('<li');
|
|
83
|
+
__output.push('>');
|
|
84
|
+
|
|
85
|
+
{
|
|
86
|
+
__output.push(_$_.escape(item.name));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
__output.push('</li>');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
__output.push('<!--]-->');
|
|
68
93
|
}
|
|
69
94
|
|
|
70
|
-
__output.push('<!--]-->');
|
|
71
95
|
__output.push('</ul>');
|
|
72
96
|
_$_.pop_component();
|
|
73
97
|
}
|
|
@@ -80,20 +104,32 @@ export function ReactiveForLoopAdd(__output) {
|
|
|
80
104
|
__output.push('<button');
|
|
81
105
|
__output.push(' class="add"');
|
|
82
106
|
__output.push('>');
|
|
83
|
-
|
|
107
|
+
|
|
108
|
+
{
|
|
109
|
+
__output.push('Add');
|
|
110
|
+
}
|
|
111
|
+
|
|
84
112
|
__output.push('</button>');
|
|
85
113
|
__output.push('<ul');
|
|
86
114
|
__output.push('>');
|
|
87
|
-
__output.push('<!--[-->');
|
|
88
115
|
|
|
89
|
-
|
|
90
|
-
__output.push('
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
116
|
+
{
|
|
117
|
+
__output.push('<!--[-->');
|
|
118
|
+
|
|
119
|
+
for (const item of _$_.get(items)) {
|
|
120
|
+
__output.push('<li');
|
|
121
|
+
__output.push('>');
|
|
122
|
+
|
|
123
|
+
{
|
|
124
|
+
__output.push(_$_.escape(item));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
__output.push('</li>');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
__output.push('<!--]-->');
|
|
94
131
|
}
|
|
95
132
|
|
|
96
|
-
__output.push('<!--]-->');
|
|
97
133
|
__output.push('</ul>');
|
|
98
134
|
_$_.pop_component();
|
|
99
135
|
}
|
|
@@ -106,20 +142,32 @@ export function ReactiveForLoopRemove(__output) {
|
|
|
106
142
|
__output.push('<button');
|
|
107
143
|
__output.push(' class="remove"');
|
|
108
144
|
__output.push('>');
|
|
109
|
-
|
|
145
|
+
|
|
146
|
+
{
|
|
147
|
+
__output.push('Remove');
|
|
148
|
+
}
|
|
149
|
+
|
|
110
150
|
__output.push('</button>');
|
|
111
151
|
__output.push('<ul');
|
|
112
152
|
__output.push('>');
|
|
113
|
-
__output.push('<!--[-->');
|
|
114
153
|
|
|
115
|
-
|
|
116
|
-
__output.push('
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
154
|
+
{
|
|
155
|
+
__output.push('<!--[-->');
|
|
156
|
+
|
|
157
|
+
for (const item of _$_.get(items)) {
|
|
158
|
+
__output.push('<li');
|
|
159
|
+
__output.push('>');
|
|
160
|
+
|
|
161
|
+
{
|
|
162
|
+
__output.push(_$_.escape(item));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
__output.push('</li>');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
__output.push('<!--]-->');
|
|
120
169
|
}
|
|
121
170
|
|
|
122
|
-
__output.push('<!--]-->');
|
|
123
171
|
__output.push('</ul>');
|
|
124
172
|
_$_.pop_component();
|
|
125
173
|
}
|
|
@@ -131,29 +179,45 @@ export function ForLoopInteractive(__output) {
|
|
|
131
179
|
|
|
132
180
|
__output.push('<div');
|
|
133
181
|
__output.push('>');
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
182
|
+
|
|
183
|
+
{
|
|
184
|
+
__output.push('<!--[-->');
|
|
185
|
+
|
|
186
|
+
var i = 0;
|
|
187
|
+
|
|
188
|
+
for (const count of _$_.get(counts)) {
|
|
189
|
+
__output.push('<div');
|
|
190
|
+
__output.push(_$_.attr('class', `item-${i}`));
|
|
191
|
+
__output.push('>');
|
|
192
|
+
|
|
193
|
+
{
|
|
194
|
+
__output.push('<span');
|
|
195
|
+
__output.push(' class="value"');
|
|
196
|
+
__output.push('>');
|
|
197
|
+
|
|
198
|
+
{
|
|
199
|
+
__output.push(_$_.escape(count));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
__output.push('</span>');
|
|
203
|
+
__output.push('<button');
|
|
204
|
+
__output.push(' class="increment"');
|
|
205
|
+
__output.push('>');
|
|
206
|
+
|
|
207
|
+
{
|
|
208
|
+
__output.push('+');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
__output.push('</button>');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
__output.push('</div>');
|
|
215
|
+
i++;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
__output.push('<!--]-->');
|
|
154
219
|
}
|
|
155
220
|
|
|
156
|
-
__output.push('<!--]-->');
|
|
157
221
|
__output.push('</div>');
|
|
158
222
|
_$_.pop_component();
|
|
159
223
|
}
|
|
@@ -166,33 +230,45 @@ export function NestedForLoop(__output) {
|
|
|
166
230
|
__output.push('<div');
|
|
167
231
|
__output.push(' class="grid"');
|
|
168
232
|
__output.push('>');
|
|
169
|
-
__output.push('<!--[-->');
|
|
170
|
-
|
|
171
|
-
var rowIndex = 0;
|
|
172
233
|
|
|
173
|
-
|
|
174
|
-
__output.push('<div');
|
|
175
|
-
__output.push(_$_.attr('class', `row-${rowIndex}`));
|
|
176
|
-
__output.push('>');
|
|
234
|
+
{
|
|
177
235
|
__output.push('<!--[-->');
|
|
178
236
|
|
|
179
|
-
var
|
|
237
|
+
var rowIndex = 0;
|
|
180
238
|
|
|
181
|
-
for (const
|
|
182
|
-
__output.push('<
|
|
183
|
-
__output.push(_$_.attr('class', `
|
|
239
|
+
for (const row of grid) {
|
|
240
|
+
__output.push('<div');
|
|
241
|
+
__output.push(_$_.attr('class', `row-${rowIndex}`));
|
|
184
242
|
__output.push('>');
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
243
|
+
|
|
244
|
+
{
|
|
245
|
+
__output.push('<!--[-->');
|
|
246
|
+
|
|
247
|
+
var colIndex = 0;
|
|
248
|
+
|
|
249
|
+
for (const cell of row) {
|
|
250
|
+
__output.push('<span');
|
|
251
|
+
__output.push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
|
|
252
|
+
__output.push('>');
|
|
253
|
+
|
|
254
|
+
{
|
|
255
|
+
__output.push(_$_.escape(cell));
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
__output.push('</span>');
|
|
259
|
+
colIndex++;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
__output.push('<!--]-->');
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
__output.push('</div>');
|
|
266
|
+
rowIndex++;
|
|
188
267
|
}
|
|
189
268
|
|
|
190
269
|
__output.push('<!--]-->');
|
|
191
|
-
__output.push('</div>');
|
|
192
|
-
rowIndex++;
|
|
193
270
|
}
|
|
194
271
|
|
|
195
|
-
__output.push('<!--]-->');
|
|
196
272
|
__output.push('</div>');
|
|
197
273
|
_$_.pop_component();
|
|
198
274
|
}
|
|
@@ -205,16 +281,24 @@ export function EmptyForLoop(__output) {
|
|
|
205
281
|
__output.push('<div');
|
|
206
282
|
__output.push(' class="container"');
|
|
207
283
|
__output.push('>');
|
|
208
|
-
__output.push('<!--[-->');
|
|
209
284
|
|
|
210
|
-
|
|
211
|
-
__output.push('
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
285
|
+
{
|
|
286
|
+
__output.push('<!--[-->');
|
|
287
|
+
|
|
288
|
+
for (const item of items) {
|
|
289
|
+
__output.push('<span');
|
|
290
|
+
__output.push('>');
|
|
291
|
+
|
|
292
|
+
{
|
|
293
|
+
__output.push(_$_.escape(item));
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
__output.push('</span>');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
__output.push('<!--]-->');
|
|
215
300
|
}
|
|
216
301
|
|
|
217
|
-
__output.push('<!--]-->');
|
|
218
302
|
__output.push('</div>');
|
|
219
303
|
_$_.pop_component();
|
|
220
304
|
}
|
|
@@ -229,26 +313,42 @@ export function ForLoopComplexObjects(__output) {
|
|
|
229
313
|
|
|
230
314
|
__output.push('<div');
|
|
231
315
|
__output.push('>');
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
316
|
+
|
|
317
|
+
{
|
|
318
|
+
__output.push('<!--[-->');
|
|
319
|
+
|
|
320
|
+
for (const user of users) {
|
|
321
|
+
__output.push('<div');
|
|
322
|
+
__output.push(_$_.attr('class', `user-${user.id}`));
|
|
323
|
+
__output.push('>');
|
|
324
|
+
|
|
325
|
+
{
|
|
326
|
+
__output.push('<span');
|
|
327
|
+
__output.push(' class="name"');
|
|
328
|
+
__output.push('>');
|
|
329
|
+
|
|
330
|
+
{
|
|
331
|
+
__output.push(_$_.escape(user.name));
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
__output.push('</span>');
|
|
335
|
+
__output.push('<span');
|
|
336
|
+
__output.push(' class="role"');
|
|
337
|
+
__output.push('>');
|
|
338
|
+
|
|
339
|
+
{
|
|
340
|
+
__output.push(_$_.escape(user.role));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
__output.push('</span>');
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
__output.push('</div>');
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
__output.push('<!--]-->');
|
|
249
350
|
}
|
|
250
351
|
|
|
251
|
-
__output.push('<!--]-->');
|
|
252
352
|
__output.push('</div>');
|
|
253
353
|
_$_.pop_component();
|
|
254
354
|
}
|
|
@@ -13,7 +13,11 @@ export function IfTruthy(__output) {
|
|
|
13
13
|
__output.push('<div');
|
|
14
14
|
__output.push(' class="shown"');
|
|
15
15
|
__output.push('>');
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
__output.push('Visible');
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
__output.push('</div>');
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -32,7 +36,11 @@ export function IfFalsy(__output) {
|
|
|
32
36
|
__output.push('<div');
|
|
33
37
|
__output.push(' class="shown"');
|
|
34
38
|
__output.push('>');
|
|
35
|
-
|
|
39
|
+
|
|
40
|
+
{
|
|
41
|
+
__output.push('Visible');
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
__output.push('</div>');
|
|
37
45
|
}
|
|
38
46
|
|
|
@@ -51,13 +59,21 @@ export function IfElse(__output) {
|
|
|
51
59
|
__output.push('<div');
|
|
52
60
|
__output.push(' class="logged-in"');
|
|
53
61
|
__output.push('>');
|
|
54
|
-
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
__output.push('Welcome back!');
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
__output.push('</div>');
|
|
56
68
|
} else {
|
|
57
69
|
__output.push('<div');
|
|
58
70
|
__output.push(' class="logged-out"');
|
|
59
71
|
__output.push('>');
|
|
60
|
-
|
|
72
|
+
|
|
73
|
+
{
|
|
74
|
+
__output.push('Please log in');
|
|
75
|
+
}
|
|
76
|
+
|
|
61
77
|
__output.push('</div>');
|
|
62
78
|
}
|
|
63
79
|
|
|
@@ -73,7 +89,11 @@ export function ReactiveIf(__output) {
|
|
|
73
89
|
__output.push('<button');
|
|
74
90
|
__output.push(' class="toggle"');
|
|
75
91
|
__output.push('>');
|
|
76
|
-
|
|
92
|
+
|
|
93
|
+
{
|
|
94
|
+
__output.push('Toggle');
|
|
95
|
+
}
|
|
96
|
+
|
|
77
97
|
__output.push('</button>');
|
|
78
98
|
__output.push('<!--[-->');
|
|
79
99
|
|
|
@@ -81,7 +101,11 @@ export function ReactiveIf(__output) {
|
|
|
81
101
|
__output.push('<div');
|
|
82
102
|
__output.push(' class="content"');
|
|
83
103
|
__output.push('>');
|
|
84
|
-
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
__output.push('Content visible');
|
|
107
|
+
}
|
|
108
|
+
|
|
85
109
|
__output.push('</div>');
|
|
86
110
|
}
|
|
87
111
|
|
|
@@ -97,7 +121,11 @@ export function ReactiveIfElse(__output) {
|
|
|
97
121
|
__output.push('<button');
|
|
98
122
|
__output.push(' class="toggle"');
|
|
99
123
|
__output.push('>');
|
|
100
|
-
|
|
124
|
+
|
|
125
|
+
{
|
|
126
|
+
__output.push('Toggle');
|
|
127
|
+
}
|
|
128
|
+
|
|
101
129
|
__output.push('</button>');
|
|
102
130
|
__output.push('<!--[-->');
|
|
103
131
|
|
|
@@ -105,13 +133,21 @@ export function ReactiveIfElse(__output) {
|
|
|
105
133
|
__output.push('<div');
|
|
106
134
|
__output.push(' class="on"');
|
|
107
135
|
__output.push('>');
|
|
108
|
-
|
|
136
|
+
|
|
137
|
+
{
|
|
138
|
+
__output.push('ON');
|
|
139
|
+
}
|
|
140
|
+
|
|
109
141
|
__output.push('</div>');
|
|
110
142
|
} else {
|
|
111
143
|
__output.push('<div');
|
|
112
144
|
__output.push(' class="off"');
|
|
113
145
|
__output.push('>');
|
|
114
|
-
|
|
146
|
+
|
|
147
|
+
{
|
|
148
|
+
__output.push('OFF');
|
|
149
|
+
}
|
|
150
|
+
|
|
115
151
|
__output.push('</div>');
|
|
116
152
|
}
|
|
117
153
|
|
|
@@ -128,12 +164,20 @@ export function NestedIf(__output) {
|
|
|
128
164
|
__output.push('<button');
|
|
129
165
|
__output.push(' class="outer-toggle"');
|
|
130
166
|
__output.push('>');
|
|
131
|
-
|
|
167
|
+
|
|
168
|
+
{
|
|
169
|
+
__output.push('Outer');
|
|
170
|
+
}
|
|
171
|
+
|
|
132
172
|
__output.push('</button>');
|
|
133
173
|
__output.push('<button');
|
|
134
174
|
__output.push(' class="inner-toggle"');
|
|
135
175
|
__output.push('>');
|
|
136
|
-
|
|
176
|
+
|
|
177
|
+
{
|
|
178
|
+
__output.push('Inner');
|
|
179
|
+
}
|
|
180
|
+
|
|
137
181
|
__output.push('</button>');
|
|
138
182
|
__output.push('<!--[-->');
|
|
139
183
|
|
|
@@ -141,18 +185,26 @@ export function NestedIf(__output) {
|
|
|
141
185
|
__output.push('<div');
|
|
142
186
|
__output.push(' class="outer-content"');
|
|
143
187
|
__output.push('>');
|
|
144
|
-
__output.push('Outer');
|
|
145
|
-
__output.push('<!--[-->');
|
|
146
188
|
|
|
147
|
-
|
|
148
|
-
__output.push('
|
|
149
|
-
__output.push('
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
189
|
+
{
|
|
190
|
+
__output.push('Outer');
|
|
191
|
+
__output.push('<!--[-->');
|
|
192
|
+
|
|
193
|
+
if (_$_.get(inner)) {
|
|
194
|
+
__output.push('<span');
|
|
195
|
+
__output.push(' class="inner-content"');
|
|
196
|
+
__output.push('>');
|
|
197
|
+
|
|
198
|
+
{
|
|
199
|
+
__output.push('Inner');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
__output.push('</span>');
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
__output.push('<!--]-->');
|
|
153
206
|
}
|
|
154
207
|
|
|
155
|
-
__output.push('<!--]-->');
|
|
156
208
|
__output.push('</div>');
|
|
157
209
|
}
|
|
158
210
|
|
|
@@ -167,50 +219,78 @@ export function IfElseIfChain(__output) {
|
|
|
167
219
|
|
|
168
220
|
__output.push('<div');
|
|
169
221
|
__output.push('>');
|
|
170
|
-
__output.push('<button');
|
|
171
|
-
__output.push(' class="success"');
|
|
172
|
-
__output.push('>');
|
|
173
|
-
__output.push('Success');
|
|
174
|
-
__output.push('</button>');
|
|
175
|
-
__output.push('<button');
|
|
176
|
-
__output.push(' class="error"');
|
|
177
|
-
__output.push('>');
|
|
178
|
-
__output.push('Error');
|
|
179
|
-
__output.push('</button>');
|
|
180
|
-
__output.push('<button');
|
|
181
|
-
__output.push(' class="loading"');
|
|
182
|
-
__output.push('>');
|
|
183
|
-
__output.push('Loading');
|
|
184
|
-
__output.push('</button>');
|
|
185
|
-
__output.push('<!--[-->');
|
|
186
222
|
|
|
187
|
-
|
|
188
|
-
__output.push('<
|
|
189
|
-
__output.push(' class="
|
|
223
|
+
{
|
|
224
|
+
__output.push('<button');
|
|
225
|
+
__output.push(' class="success"');
|
|
190
226
|
__output.push('>');
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
227
|
+
|
|
228
|
+
{
|
|
229
|
+
__output.push('Success');
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
__output.push('</button>');
|
|
233
|
+
__output.push('<button');
|
|
234
|
+
__output.push(' class="error"');
|
|
235
|
+
__output.push('>');
|
|
236
|
+
|
|
237
|
+
{
|
|
238
|
+
__output.push('Error');
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
__output.push('</button>');
|
|
242
|
+
__output.push('<button');
|
|
243
|
+
__output.push(' class="loading"');
|
|
244
|
+
__output.push('>');
|
|
245
|
+
|
|
246
|
+
{
|
|
247
|
+
__output.push('Loading');
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
__output.push('</button>');
|
|
194
251
|
__output.push('<!--[-->');
|
|
195
252
|
|
|
196
|
-
if (_$_.get(status) === '
|
|
253
|
+
if (_$_.get(status) === 'loading') {
|
|
197
254
|
__output.push('<div');
|
|
198
255
|
__output.push(' class="state"');
|
|
199
256
|
__output.push('>');
|
|
200
|
-
|
|
257
|
+
|
|
258
|
+
{
|
|
259
|
+
__output.push('Loading...');
|
|
260
|
+
}
|
|
261
|
+
|
|
201
262
|
__output.push('</div>');
|
|
202
263
|
} else {
|
|
203
|
-
__output.push('
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
264
|
+
__output.push('<!--[-->');
|
|
265
|
+
|
|
266
|
+
if (_$_.get(status) === 'success') {
|
|
267
|
+
__output.push('<div');
|
|
268
|
+
__output.push(' class="state"');
|
|
269
|
+
__output.push('>');
|
|
270
|
+
|
|
271
|
+
{
|
|
272
|
+
__output.push('Success!');
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
__output.push('</div>');
|
|
276
|
+
} else {
|
|
277
|
+
__output.push('<div');
|
|
278
|
+
__output.push(' class="state"');
|
|
279
|
+
__output.push('>');
|
|
280
|
+
|
|
281
|
+
{
|
|
282
|
+
__output.push('Error occurred');
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
__output.push('</div>');
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
__output.push('<!--]-->');
|
|
208
289
|
}
|
|
209
290
|
|
|
210
291
|
__output.push('<!--]-->');
|
|
211
292
|
}
|
|
212
293
|
|
|
213
|
-
__output.push('<!--]-->');
|
|
214
294
|
__output.push('</div>');
|
|
215
295
|
_$_.pop_component();
|
|
216
296
|
}
|