-
Notifications
You must be signed in to change notification settings - Fork 124
/
code.js
205 lines (165 loc) · 4.27 KB
/
code.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import * as styles from './styles.module.css';
const selected = true;
let id = "my-h1";
let link;
const template = (
<div id="main" {...results} classList={{ selected: unknown }} style={{ color }}>
<h1
class="base"
id={id}
{...results()}
foo
disabled
title={welcoming()}
style={{ "background-color": color(), "margin-right": "40px" }}
classList={{ dynamic: dynamic(), selected }}
>
<a href={"/"} ref={link} classList={{ "ccc ddd": true }}>
Welcome
</a>
</h1>
</div>
);
const template2 = (
<div {...getProps("test")}>
<div textContent={rowId} />
<div textContent={row.label} />
<div innerHTML={"<div/>"} />
</div>
);
const template3 = (
<div
foo
id={/*@once*/ state.id}
style={/*@once*/ { "background-color": state.color }}
name={state.name}
textContent={/*@once*/ state.content}
/>
);
const template4 = <div class="hi" className={state.class} classList={{ "ccc:ddd": true }} />;
const template5 = <div class="a" className="b"></div>;
const template6 = <div style={someStyle()} textContent="Hi" />;
let undefVar;
const template7 = (
<div
style={{ "background-color": color(), "margin-right": "40px", ...props.style }}
style:padding-top={props.top}
class:my-class={props.active}
class:other-class={undefVar}
classList={{ 'other-class2': undefVar}}
/>
);
let refTarget;
const template8 = <div ref={refTarget} />;
const template9 = <div ref={e => console.log(e)} />;
const template10 = <div ref={refFactory()} />;
const template11 = <div use:something use:another={thing} use:zero={0} />;
const template12 = <div prop:htmlFor={thing} prop:number={123} />;
const template13 = <input type="checkbox" checked={true} />;
const template14 = <input type="checkbox" checked={state.visible} />;
const template15 = <div class="`a">`$`</div>;
const template16 = (
<button
class="static"
classList={{
hi: "k"
}}
type="button"
>
Write
</button>
);
const template17 = (
<button
classList={{
a: true,
b: true,
c: true
}}
onClick={increment}
>
Hi
</button>
);
const template18 = (
<div
{...{
get [key()]() {
return props.value;
}
}}
/>
);
const template19 = <div classList={{ "bg-red-500": true }} class="flex flex-col" />;
const template20 = (
<div>
<input value={s()} min={min()} max={max()} onInput={doSomething} readonly="" />
<input checked={s2()} min={min()} max={max()} onInput={doSomethingElse} readonly={value} />
</div>
);
const template21 = <div style={{ a: "static", ...rest }}></div>;
const template22 = <div data='"hi"' data2={'"'} />;
const template23 = <div disabled={"t" in test}>{"t" in test && "true"}</div>;
const template24 = <a {...props} something />;
const template25 = (
<div>
{props.children}
<a {...props} something />
</div>
);
const template26 = (
<div start="Hi" middle={middle} {...spread}>
Hi
</div>
);
const template27 = (
<div start="Hi" {...first} middle={middle} {...second}>
Hi
</div>
);
const template28 = (
<label {...api()}>
<span {...api()}>Input is {api() ? "checked" : "unchecked"}</span>
<input {...api()} />
<div {...api()} />
</label>
);
const template29 = <div attribute={!!someValue}>{!!someValue}</div>;
const template30 = (
<div
class="class1 class2
class3 class4
class5 class6"
style="color: red;
background-color: blue !important;
border: 1px solid black;
font-size: 12px;"
random="random1 random2
random3 random4"
/>
);
const template31 = (
<div
style={{ "background-color": getStore.itemProperties.color }}
/>
);
const template32 = (
<div
style={{ "background-color": undefined }}
/>
);
const template33 = (
<>
<button class={styles.button}></button>
<button class={styles["foo--bar"]}></button>
<button class={styles.foo.bar}></button>
<button class={styles[foo()]}></button>
</>
);
const template34 = <div use:something {...somethingElse} use:zero={0} />;
const template35 = <div ref={a().b.c} />
const template36 = <div ref={a().b?.c} />
const template37 = <div ref={a() ? b : c} />
const template38 = <div ref={a() ?? b} />
const template39 = <input value={10} />
const template40 = <div style={{ color: a() }} />