jac-client 0.2.10__py3-none-any.whl → 0.2.12__py3-none-any.whl
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.
- jac_client/examples/all-in-one/button.jac +4 -3
- jac_client/examples/all-in-one/components/CategoryFilter.jac +36 -24
- jac_client/examples/all-in-one/components/Header.jac +12 -8
- jac_client/examples/all-in-one/components/ProfitOverview.jac +49 -35
- jac_client/examples/all-in-one/components/Summary.jac +59 -36
- jac_client/examples/all-in-one/components/TransactionForm.jac +142 -112
- jac_client/examples/all-in-one/components/TransactionItem.jac +37 -30
- jac_client/examples/all-in-one/components/TransactionList.jac +33 -26
- jac_client/examples/all-in-one/components/button.jac +4 -3
- jac_client/examples/all-in-one/components/navigation.jac +111 -117
- jac_client/examples/all-in-one/constants/categories.jac +23 -24
- jac_client/examples/all-in-one/constants/clients.jac +7 -8
- jac_client/examples/all-in-one/context/BudgetContext.jac +9 -6
- jac_client/examples/all-in-one/hooks/useBudget.jac +18 -12
- jac_client/examples/all-in-one/hooks/useLocalStorage.jac +14 -13
- jac_client/examples/all-in-one/main.jac +340 -371
- jac_client/examples/all-in-one/pages/BudgetPlanner.jac +19 -12
- jac_client/examples/all-in-one/pages/FeaturesTest.jac +31 -15
- jac_client/examples/all-in-one/pages/LandingPage.jac +113 -90
- jac_client/examples/all-in-one/pages/budget_planner_ui.cl.jac +34 -39
- jac_client/examples/all-in-one/pages/features_test_ui.cl.jac +464 -352
- jac_client/examples/all-in-one/pages/loginPage.jac +114 -119
- jac_client/examples/all-in-one/pages/nestedDemo.jac +43 -50
- jac_client/examples/all-in-one/pages/notFound.jac +14 -15
- jac_client/examples/all-in-one/pages/signupPage.jac +113 -119
- jac_client/examples/all-in-one/utils/formatters.jac +5 -8
- jac_client/examples/asset-serving/css-with-image/main.jac +77 -73
- jac_client/examples/asset-serving/image-asset/main.jac +47 -46
- jac_client/examples/asset-serving/import-alias/main.jac +93 -95
- jac_client/examples/basic/main.jac +17 -15
- jac_client/examples/basic-auth/main.jac +246 -254
- jac_client/examples/basic-auth-with-router/main.jac +272 -285
- jac_client/examples/basic-full-stack/main.jac +245 -242
- jac_client/examples/css-styling/js-styling/main.jac +41 -62
- jac_client/examples/css-styling/material-ui/main.jac +90 -90
- jac_client/examples/css-styling/pure-css/main.jac +35 -44
- jac_client/examples/css-styling/sass-example/main.jac +35 -44
- jac_client/examples/css-styling/styled-components/main.jac +38 -47
- jac_client/examples/css-styling/tailwind-example/main.jac +54 -43
- jac_client/examples/full-stack-with-auth/main.jac +407 -433
- jac_client/examples/little-x/main.jac +306 -344
- jac_client/examples/little-x/src/submit-button.jac +15 -14
- jac_client/examples/nested-folders/nested-advance/main.jac +18 -27
- jac_client/examples/nested-folders/nested-advance/src/ButtonRoot.jac +4 -6
- jac_client/examples/nested-folders/nested-advance/src/level1/ButtonSecondL.jac +9 -13
- jac_client/examples/nested-folders/nested-advance/src/level1/Card.jac +29 -32
- jac_client/examples/nested-folders/nested-advance/src/level1/level2/ButtonThirdL.jac +12 -18
- jac_client/examples/nested-folders/nested-basic/main.jac +7 -5
- jac_client/examples/nested-folders/nested-basic/src/button.jac +4 -3
- jac_client/examples/nested-folders/nested-basic/src/components/button.jac +4 -3
- jac_client/examples/ts-support/main.jac +26 -26
- jac_client/examples/with-router/main.jac +186 -223
- jac_client/plugin/client_runtime.cl.jac +5 -3
- jac_client/plugin/impl/client_runtime.impl.jac +1 -1
- jac_client/plugin/plugin_config.jac +53 -99
- jac_client/plugin/src/__init__.jac +0 -2
- jac_client/plugin/src/compiler.jac +0 -1
- jac_client/plugin/src/impl/compiler.impl.jac +49 -17
- jac_client/plugin/src/impl/jac_to_js.impl.jac +5 -1
- jac_client/plugin/src/impl/package_installer.impl.jac +20 -20
- jac_client/plugin/src/impl/vite_bundler.impl.jac +146 -84
- jac_client/plugin/src/targets/impl/desktop_target.impl.jac +54 -41
- jac_client/plugin/utils/__init__.jac +3 -0
- jac_client/plugin/utils/bun_installer.jac +16 -0
- jac_client/plugin/utils/client_deps.jac +14 -0
- jac_client/plugin/utils/impl/bun_installer.impl.jac +99 -0
- jac_client/plugin/utils/impl/client_deps.impl.jac +73 -0
- jac_client/templates/client.jacpack +0 -4
- jac_client/templates/fullstack.jacpack +1 -5
- jac_client/tests/conftest.py +56 -41
- jac_client/tests/fixtures/spawn_test/app.jac +49 -52
- jac_client/tests/fixtures/with-ts/app.jac +27 -27
- jac_client/tests/test_cli.py +71 -6
- jac_client/tests/test_helpers.py +11 -18
- jac_client/tests/test_it.py +1 -1
- {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/METADATA +5 -5
- jac_client-0.2.12.dist-info/RECORD +115 -0
- {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/WHEEL +1 -1
- jac_client/plugin/src/babel_processor.jac +0 -18
- jac_client/plugin/src/impl/babel_processor.impl.jac +0 -89
- jac_client/plugin/utils/impl/node_installer.impl.jac +0 -249
- jac_client/plugin/utils/node_installer.jac +0 -41
- jac_client-0.2.10.dist-info/RECORD +0 -115
- {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/entry_points.txt +0 -0
- {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/top_level.txt +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
# Pages
|
|
2
|
-
cl import from react { useEffect }
|
|
3
2
|
cl import from .styles { default as styles }
|
|
4
3
|
|
|
5
4
|
cl {
|
|
6
5
|
def:pub app -> any {
|
|
7
6
|
has count: int = 0;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
can with count entry {
|
|
9
|
+
console.log("Count changed: ", count);
|
|
10
|
+
}
|
|
10
11
|
|
|
11
|
-
handleIncrement = lambda
|
|
12
|
+
handleIncrement = lambda e: any -> None { count = count + 1;};
|
|
12
13
|
|
|
13
|
-
handleDecrement = lambda
|
|
14
|
+
handleDecrement = lambda e: any -> None { count = count - 1;};
|
|
14
15
|
|
|
15
|
-
handleReset = lambda
|
|
16
|
+
handleReset = lambda e: any -> None { count = 0;};
|
|
16
17
|
|
|
17
18
|
countStyle = styles.countDisplayZero
|
|
18
19
|
if count == 0
|
|
@@ -20,65 +21,43 @@ cl {
|
|
|
20
21
|
styles.countDisplayPositive if count > 0 else styles.countDisplayNegative
|
|
21
22
|
);
|
|
22
23
|
|
|
23
|
-
return
|
|
24
|
-
style={styles.container}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
style={styles.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<div
|
|
38
|
-
style={styles.counterSection}
|
|
39
|
-
>
|
|
40
|
-
<div
|
|
41
|
-
style={styles.label}
|
|
42
|
-
>
|
|
43
|
-
Current Count
|
|
24
|
+
return
|
|
25
|
+
<div style={styles.container}>
|
|
26
|
+
<div style={styles.card}>
|
|
27
|
+
<h1 style={styles.title}>
|
|
28
|
+
Counter Application
|
|
29
|
+
</h1>
|
|
30
|
+
<div style={styles.divider}></div>
|
|
31
|
+
<div style={styles.counterSection}>
|
|
32
|
+
<div style={styles.label}>
|
|
33
|
+
Current Count
|
|
34
|
+
</div>
|
|
35
|
+
<div style={countStyle}>
|
|
36
|
+
{count}
|
|
37
|
+
</div>
|
|
44
38
|
</div>
|
|
45
|
-
<div
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
<div style={styles.divider}></div>
|
|
40
|
+
<div style={styles.buttonGroup}>
|
|
41
|
+
<button
|
|
42
|
+
style={styles.buttonDecrement}
|
|
43
|
+
onClick={handleDecrement}
|
|
44
|
+
>
|
|
45
|
+
-
|
|
46
|
+
</button>
|
|
47
|
+
<button style={styles.buttonReset} onClick={handleReset}>
|
|
48
|
+
↻
|
|
49
|
+
</button>
|
|
50
|
+
<button
|
|
51
|
+
style={styles.buttonIncrement}
|
|
52
|
+
onClick={handleIncrement}
|
|
53
|
+
>
|
|
54
|
+
+
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
<div style={styles.hint}>
|
|
58
|
+
Click the buttons to increment, decrement, or reset the counter
|
|
49
59
|
</div>
|
|
50
60
|
</div>
|
|
51
|
-
|
|
52
|
-
style={styles.divider}
|
|
53
|
-
></div>
|
|
54
|
-
<div
|
|
55
|
-
style={styles.buttonGroup}
|
|
56
|
-
>
|
|
57
|
-
<button
|
|
58
|
-
style={styles.buttonDecrement}
|
|
59
|
-
onClick={handleDecrement}
|
|
60
|
-
>
|
|
61
|
-
-
|
|
62
|
-
</button>
|
|
63
|
-
<button
|
|
64
|
-
style={styles.buttonReset}
|
|
65
|
-
onClick={handleReset}
|
|
66
|
-
>
|
|
67
|
-
↻
|
|
68
|
-
</button>
|
|
69
|
-
<button
|
|
70
|
-
style={styles.buttonIncrement}
|
|
71
|
-
onClick={handleIncrement}
|
|
72
|
-
>
|
|
73
|
-
+
|
|
74
|
-
</button>
|
|
75
|
-
</div>
|
|
76
|
-
<div
|
|
77
|
-
style={styles.hint}
|
|
78
|
-
>
|
|
79
|
-
Click the buttons to increment, decrement, or reset the counter
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>;
|
|
61
|
+
</div>;
|
|
83
62
|
}
|
|
84
63
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
cl import from react { useEffect }
|
|
2
1
|
cl import from '@mui/material/Button' { default as Button }
|
|
3
2
|
cl import from '@mui/material/Card' { default as Card }
|
|
4
3
|
cl import from '@mui/material/CardContent' { default as CardContent }
|
|
@@ -15,108 +14,109 @@ cl {
|
|
|
15
14
|
def:pub app -> any {
|
|
16
15
|
has count: int = 0;
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
can with count entry {
|
|
18
|
+
console.log("Count changed: ", count);
|
|
19
|
+
}
|
|
19
20
|
|
|
20
|
-
handleIncrement = lambda
|
|
21
|
+
handleIncrement = lambda e: any -> None { count = count + 1;};
|
|
21
22
|
|
|
22
|
-
handleDecrement = lambda
|
|
23
|
+
handleDecrement = lambda e: any -> None { count = count - 1;};
|
|
23
24
|
|
|
24
|
-
handleReset = lambda
|
|
25
|
+
handleReset = lambda e: any -> None { count = 0;};
|
|
25
26
|
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<Card
|
|
36
|
-
sx={{"minWidth": 400, "boxShadow": 3}}
|
|
27
|
+
return
|
|
28
|
+
<Box
|
|
29
|
+
sx={{
|
|
30
|
+
"display": "flex",
|
|
31
|
+
"justifyContent": "center",
|
|
32
|
+
"alignItems": "center",
|
|
33
|
+
"minHeight": "100vh",
|
|
34
|
+
"backgroundColor": "#f5f5f5"
|
|
35
|
+
}}
|
|
37
36
|
>
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
variant="h4"
|
|
41
|
-
component="div"
|
|
42
|
-
gutterBottom
|
|
43
|
-
sx={{"textAlign": "center", "color": "primary.main"}}
|
|
44
|
-
>
|
|
45
|
-
Counter Application
|
|
46
|
-
</Typography>
|
|
47
|
-
<Divider
|
|
48
|
-
sx={{"my": 2}}
|
|
49
|
-
/>
|
|
50
|
-
<Box
|
|
51
|
-
sx={{
|
|
52
|
-
"display": "flex",
|
|
53
|
-
"flexDirection": "column",
|
|
54
|
-
"alignItems": "center",
|
|
55
|
-
"py": 3
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
37
|
+
<Card sx={{"minWidth": 400, "boxShadow": 3}}>
|
|
38
|
+
<CardContent>
|
|
58
39
|
<Typography
|
|
59
|
-
variant="
|
|
60
|
-
|
|
40
|
+
variant="h4"
|
|
41
|
+
component="div"
|
|
61
42
|
gutterBottom
|
|
43
|
+
sx={{"textAlign": "center", "color": "primary.main"}}
|
|
62
44
|
>
|
|
63
|
-
|
|
45
|
+
Counter Application
|
|
64
46
|
</Typography>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
component="div"
|
|
47
|
+
<Divider sx={{"my": 2}} />
|
|
48
|
+
<Box
|
|
68
49
|
sx={{
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
50
|
+
"display": "flex",
|
|
51
|
+
"flexDirection": "column",
|
|
52
|
+
"alignItems": "center",
|
|
53
|
+
"py": 3
|
|
73
54
|
}}
|
|
74
55
|
>
|
|
75
|
-
|
|
56
|
+
<Typography
|
|
57
|
+
variant="h6"
|
|
58
|
+
color="text.secondary"
|
|
59
|
+
gutterBottom
|
|
60
|
+
>
|
|
61
|
+
Current Count
|
|
62
|
+
</Typography>
|
|
63
|
+
<Typography
|
|
64
|
+
variant="h1"
|
|
65
|
+
component="div"
|
|
66
|
+
sx={{
|
|
67
|
+
"fontWeight": "bold",
|
|
68
|
+
"color": "success.main"
|
|
69
|
+
if count > 0
|
|
70
|
+
else "error.main" if count < 0 else "text.primary"
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
{count}
|
|
74
|
+
</Typography>
|
|
75
|
+
</Box>
|
|
76
|
+
</CardContent>
|
|
77
|
+
<Divider />
|
|
78
|
+
<CardActions
|
|
79
|
+
sx={{
|
|
80
|
+
"display": "flex",
|
|
81
|
+
"justifyContent": "space-around",
|
|
82
|
+
"p": 2
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<IconButton
|
|
86
|
+
color="error"
|
|
87
|
+
size="large"
|
|
88
|
+
onClick={handleDecrement}
|
|
89
|
+
sx={{"border": "2px solid", "borderColor": "error.main"}}
|
|
90
|
+
>
|
|
91
|
+
<RemoveIcon />
|
|
92
|
+
</IconButton>
|
|
93
|
+
<IconButton
|
|
94
|
+
color="primary"
|
|
95
|
+
size="large"
|
|
96
|
+
onClick={handleReset}
|
|
97
|
+
sx={{"border": "2px solid", "borderColor": "primary.main"}}
|
|
98
|
+
>
|
|
99
|
+
<RefreshIcon />
|
|
100
|
+
</IconButton>
|
|
101
|
+
<IconButton
|
|
102
|
+
color="success"
|
|
103
|
+
size="large"
|
|
104
|
+
onClick={handleIncrement}
|
|
105
|
+
sx={{"border": "2px solid", "borderColor": "success.main"}}
|
|
106
|
+
>
|
|
107
|
+
<AddIcon />
|
|
108
|
+
</IconButton>
|
|
109
|
+
</CardActions>
|
|
110
|
+
<Box sx={{"px": 3, "pb": 2}}>
|
|
111
|
+
<Typography
|
|
112
|
+
variant="caption"
|
|
113
|
+
color="text.secondary"
|
|
114
|
+
sx={{"display": "block", "textAlign": "center"}}
|
|
115
|
+
>
|
|
116
|
+
Click the buttons to increment, decrement, or reset the counter
|
|
76
117
|
</Typography>
|
|
77
118
|
</Box>
|
|
78
|
-
</
|
|
79
|
-
|
|
80
|
-
<CardActions
|
|
81
|
-
sx={{"display": "flex", "justifyContent": "space-around", "p": 2}}
|
|
82
|
-
>
|
|
83
|
-
<IconButton
|
|
84
|
-
color="error"
|
|
85
|
-
size="large"
|
|
86
|
-
onClick={handleDecrement}
|
|
87
|
-
sx={{"border": "2px solid", "borderColor": "error.main"}}
|
|
88
|
-
>
|
|
89
|
-
<RemoveIcon />
|
|
90
|
-
</IconButton>
|
|
91
|
-
<IconButton
|
|
92
|
-
color="primary"
|
|
93
|
-
size="large"
|
|
94
|
-
onClick={handleReset}
|
|
95
|
-
sx={{"border": "2px solid", "borderColor": "primary.main"}}
|
|
96
|
-
>
|
|
97
|
-
<RefreshIcon />
|
|
98
|
-
</IconButton>
|
|
99
|
-
<IconButton
|
|
100
|
-
color="success"
|
|
101
|
-
size="large"
|
|
102
|
-
onClick={handleIncrement}
|
|
103
|
-
sx={{"border": "2px solid", "borderColor": "success.main"}}
|
|
104
|
-
>
|
|
105
|
-
<AddIcon />
|
|
106
|
-
</IconButton>
|
|
107
|
-
</CardActions>
|
|
108
|
-
<Box
|
|
109
|
-
sx={{"px": 3, "pb": 2}}
|
|
110
|
-
>
|
|
111
|
-
<Typography
|
|
112
|
-
variant="caption"
|
|
113
|
-
color="text.secondary"
|
|
114
|
-
sx={{"display": "block", "textAlign": "center"}}
|
|
115
|
-
>
|
|
116
|
-
Click the buttons to increment, decrement, or reset the counter
|
|
117
|
-
</Typography>
|
|
118
|
-
</Box>
|
|
119
|
-
</Card>
|
|
120
|
-
</Box>;
|
|
119
|
+
</Card>
|
|
120
|
+
</Box>;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -1,64 +1,55 @@
|
|
|
1
1
|
# Pages
|
|
2
|
-
cl import from react { useEffect }
|
|
3
2
|
cl import ".styles.css";
|
|
4
3
|
|
|
5
4
|
cl {
|
|
6
5
|
def:pub app -> any {
|
|
7
6
|
has count: int = 0;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
can with count entry {
|
|
9
|
+
console.log("Count changed: ", count);
|
|
10
|
+
}
|
|
10
11
|
|
|
11
|
-
handleIncrement = lambda
|
|
12
|
+
handleIncrement = lambda e: any -> None { count = count + 1;};
|
|
12
13
|
|
|
13
|
-
handleDecrement = lambda
|
|
14
|
+
handleDecrement = lambda e: any -> None { count = count - 1;};
|
|
14
15
|
|
|
15
|
-
handleReset = lambda
|
|
16
|
+
handleReset = lambda e: any -> None { count = 0;};
|
|
16
17
|
|
|
17
18
|
countClass = "countDisplay " + (
|
|
18
19
|
"positive" if count > 0 else "negative" if count < 0 else "zero"
|
|
19
20
|
);
|
|
20
21
|
|
|
21
|
-
return
|
|
22
|
-
<div className="
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div className="
|
|
29
|
-
|
|
22
|
+
return
|
|
23
|
+
<div className="container">
|
|
24
|
+
<div className="card">
|
|
25
|
+
<h1 className="title">
|
|
26
|
+
Counter Application
|
|
27
|
+
</h1>
|
|
28
|
+
<div className="divider"></div>
|
|
29
|
+
<div className="counterSection">
|
|
30
|
+
<div className="label">
|
|
31
|
+
Current Count
|
|
32
|
+
</div>
|
|
33
|
+
<div className={countClass}>
|
|
34
|
+
{count}
|
|
35
|
+
</div>
|
|
30
36
|
</div>
|
|
31
|
-
<div
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
<div className="divider"></div>
|
|
38
|
+
<div className="buttonGroup">
|
|
39
|
+
<button className="btn btnDecrement" onClick={handleDecrement}>
|
|
40
|
+
-
|
|
41
|
+
</button>
|
|
42
|
+
<button className="btn btnReset" onClick={handleReset}>
|
|
43
|
+
↻
|
|
44
|
+
</button>
|
|
45
|
+
<button className="btn btnIncrement" onClick={handleIncrement}>
|
|
46
|
+
+
|
|
47
|
+
</button>
|
|
48
|
+
</div>
|
|
49
|
+
<div className="hint">
|
|
50
|
+
Click the buttons to increment, decrement, or reset the counter
|
|
35
51
|
</div>
|
|
36
52
|
</div>
|
|
37
|
-
|
|
38
|
-
<div className="buttonGroup">
|
|
39
|
-
<button
|
|
40
|
-
className="btn btnDecrement"
|
|
41
|
-
onClick={handleDecrement}
|
|
42
|
-
>
|
|
43
|
-
-
|
|
44
|
-
</button>
|
|
45
|
-
<button
|
|
46
|
-
className="btn btnReset"
|
|
47
|
-
onClick={handleReset}
|
|
48
|
-
>
|
|
49
|
-
↻
|
|
50
|
-
</button>
|
|
51
|
-
<button
|
|
52
|
-
className="btn btnIncrement"
|
|
53
|
-
onClick={handleIncrement}
|
|
54
|
-
>
|
|
55
|
-
+
|
|
56
|
-
</button>
|
|
57
|
-
</div>
|
|
58
|
-
<div className="hint">
|
|
59
|
-
Click the buttons to increment, decrement, or reset the counter
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>;
|
|
53
|
+
</div>;
|
|
63
54
|
}
|
|
64
55
|
}
|
|
@@ -1,64 +1,55 @@
|
|
|
1
1
|
# Pages
|
|
2
|
-
cl import from react { useEffect }
|
|
3
2
|
cl import ".styles.scss";
|
|
4
3
|
|
|
5
4
|
cl {
|
|
6
5
|
def:pub app -> any {
|
|
7
6
|
has count: int = 0;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
can with count entry {
|
|
9
|
+
console.log("Count changed: ", count);
|
|
10
|
+
}
|
|
10
11
|
|
|
11
|
-
handleIncrement = lambda
|
|
12
|
+
handleIncrement = lambda e: any -> None { count = count + 1;};
|
|
12
13
|
|
|
13
|
-
handleDecrement = lambda
|
|
14
|
+
handleDecrement = lambda e: any -> None { count = count - 1;};
|
|
14
15
|
|
|
15
|
-
handleReset = lambda
|
|
16
|
+
handleReset = lambda e: any -> None { count = 0;};
|
|
16
17
|
|
|
17
18
|
countClass = "countDisplay " + (
|
|
18
19
|
"positive" if count > 0 else "negative" if count < 0 else "zero"
|
|
19
20
|
);
|
|
20
21
|
|
|
21
|
-
return
|
|
22
|
-
<div className="
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div className="
|
|
29
|
-
|
|
22
|
+
return
|
|
23
|
+
<div className="container">
|
|
24
|
+
<div className="card">
|
|
25
|
+
<h1 className="title">
|
|
26
|
+
Counter Application
|
|
27
|
+
</h1>
|
|
28
|
+
<div className="divider"></div>
|
|
29
|
+
<div className="counterSection">
|
|
30
|
+
<div className="label">
|
|
31
|
+
Current Count
|
|
32
|
+
</div>
|
|
33
|
+
<div className={countClass}>
|
|
34
|
+
{count}
|
|
35
|
+
</div>
|
|
30
36
|
</div>
|
|
31
|
-
<div
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
<div className="divider"></div>
|
|
38
|
+
<div className="buttonGroup">
|
|
39
|
+
<button className="btn btnDecrement" onClick={handleDecrement}>
|
|
40
|
+
-
|
|
41
|
+
</button>
|
|
42
|
+
<button className="btn btnReset" onClick={handleReset}>
|
|
43
|
+
↻
|
|
44
|
+
</button>
|
|
45
|
+
<button className="btn btnIncrement" onClick={handleIncrement}>
|
|
46
|
+
+
|
|
47
|
+
</button>
|
|
48
|
+
</div>
|
|
49
|
+
<div className="hint">
|
|
50
|
+
Click the buttons to increment, decrement, or reset the counter
|
|
35
51
|
</div>
|
|
36
52
|
</div>
|
|
37
|
-
|
|
38
|
-
<div className="buttonGroup">
|
|
39
|
-
<button
|
|
40
|
-
className="btn btnDecrement"
|
|
41
|
-
onClick={handleDecrement}
|
|
42
|
-
>
|
|
43
|
-
-
|
|
44
|
-
</button>
|
|
45
|
-
<button
|
|
46
|
-
className="btn btnReset"
|
|
47
|
-
onClick={handleReset}
|
|
48
|
-
>
|
|
49
|
-
↻
|
|
50
|
-
</button>
|
|
51
|
-
<button
|
|
52
|
-
className="btn btnIncrement"
|
|
53
|
-
onClick={handleIncrement}
|
|
54
|
-
>
|
|
55
|
-
+
|
|
56
|
-
</button>
|
|
57
|
-
</div>
|
|
58
|
-
<div className="hint">
|
|
59
|
-
Click the buttons to increment, decrement, or reset the counter
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>;
|
|
53
|
+
</div>;
|
|
63
54
|
}
|
|
64
55
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# Pages
|
|
2
|
-
cl import from react { useEffect }
|
|
3
2
|
cl import from .styled {
|
|
4
3
|
Container,
|
|
5
4
|
Card,
|
|
@@ -17,55 +16,47 @@ cl {
|
|
|
17
16
|
def:pub app -> any {
|
|
18
17
|
has count: int = 0;
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
can with count entry {
|
|
20
|
+
console.log("Count changed: ", count);
|
|
21
|
+
}
|
|
21
22
|
|
|
22
|
-
handleIncrement = lambda
|
|
23
|
+
handleIncrement = lambda e: any -> None { count = count + 1;};
|
|
23
24
|
|
|
24
|
-
handleDecrement = lambda
|
|
25
|
+
handleDecrement = lambda e: any -> None { count = count - 1;};
|
|
25
26
|
|
|
26
|
-
handleReset = lambda
|
|
27
|
+
handleReset = lambda e: any -> None { count = 0;};
|
|
27
28
|
|
|
28
|
-
return
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
count={count}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onClick={
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
>
|
|
56
|
-
|
|
57
|
-
</
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onClick={handleIncrement}
|
|
61
|
-
>
|
|
62
|
-
+
|
|
63
|
-
</Button>
|
|
64
|
-
</ButtonGroup>
|
|
65
|
-
<Hint>
|
|
66
|
-
Click the buttons to increment, decrement, or reset the counter
|
|
67
|
-
</Hint>
|
|
68
|
-
</Card>
|
|
69
|
-
</Container>;
|
|
29
|
+
return
|
|
30
|
+
<Container>
|
|
31
|
+
<Card>
|
|
32
|
+
<Title>
|
|
33
|
+
Counter Application
|
|
34
|
+
</Title>
|
|
35
|
+
<Divider></Divider>
|
|
36
|
+
<CounterSection>
|
|
37
|
+
<Label>
|
|
38
|
+
Current Count
|
|
39
|
+
</Label>
|
|
40
|
+
<CountDisplay count={count}>
|
|
41
|
+
{count}
|
|
42
|
+
</CountDisplay>
|
|
43
|
+
</CounterSection>
|
|
44
|
+
<Divider></Divider>
|
|
45
|
+
<ButtonGroup>
|
|
46
|
+
<Button bgColor="#ef4444" onClick={handleDecrement}>
|
|
47
|
+
-
|
|
48
|
+
</Button>
|
|
49
|
+
<Button bgColor="#6b7280" onClick={handleReset}>
|
|
50
|
+
↻
|
|
51
|
+
</Button>
|
|
52
|
+
<Button bgColor="#22c55e" onClick={handleIncrement}>
|
|
53
|
+
+
|
|
54
|
+
</Button>
|
|
55
|
+
</ButtonGroup>
|
|
56
|
+
<Hint>
|
|
57
|
+
Click the buttons to increment, decrement, or reset the counter
|
|
58
|
+
</Hint>
|
|
59
|
+
</Card>
|
|
60
|
+
</Container>;
|
|
70
61
|
}
|
|
71
62
|
}
|