Skip to content

Commit

Permalink
Merge pull request #3 from BQXBQX/dev-bqx
Browse files Browse the repository at this point in the history
Dev bqx
  • Loading branch information
BQXBQX authored Jan 23, 2024
2 parents 9dd5fc8 + bc06bb2 commit cad4a9c
Show file tree
Hide file tree
Showing 28 changed files with 1,059 additions and 2,166 deletions.
9 changes: 6 additions & 3 deletions packages/competition/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Input } from "@sast/oj-ui";
import { Checkbox, Dialog, Input, Radio, RadioGroup } from "@sast/oj-ui";

function App() {
const test = (value, e) => {
const test = (value: boolean) => {
console.log(value);
};
return (
<>
<Input placeholder="" onChange={test}></Input>
{/* <Input placeholder="" onChange={test}></Input> */}
<Checkbox onChecked={test}></Checkbox>
{/* <RadioGroup direction="vertical" onChange={test} defaultValue="vuejs" /> */}
{/* <Dialog></Dialog> */}
</>
);
}
Expand Down
102 changes: 1 addition & 101 deletions packages/ui/coverage/.tmp/coverage-0.json
Original file line number Diff line number Diff line change
@@ -1,101 +1 @@
{
"result": [
{
"scriptId": "1455",
"url": "file:///Users/maxtune/workspace/sastoj-frontend/packages/ui/lib/test/setup.ts",
"functions": [
{
"functionName": "",
"ranges": [{ "startOffset": 0, "endOffset": 1690, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [{ "startOffset": 13, "endOffset": 1690, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [{ "startOffset": 1008, "endOffset": 1052, "count": 2 }],
"isBlockCoverage": true
}
]
},
{
"scriptId": "2050",
"url": "file:///Users/maxtune/workspace/sastoj-frontend/packages/ui/lib/Button/Button.test.tsx",
"functions": [
{
"functionName": "",
"ranges": [{ "startOffset": 0, "endOffset": 4614, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [{ "startOffset": 13, "endOffset": 4614, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [{ "startOffset": 1425, "endOffset": 1926, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [{ "startOffset": 1990, "endOffset": 2644, "count": 1 }],
"isBlockCoverage": true
}
]
},
{
"scriptId": "2143",
"url": "file:///Users/maxtune/workspace/sastoj-frontend/packages/ui/lib/Button/Button.tsx",
"functions": [
{
"functionName": "",
"ranges": [{ "startOffset": 0, "endOffset": 4022, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [{ "startOffset": 13, "endOffset": 4022, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [
{ "startOffset": 1020, "endOffset": 1661, "count": 2 },
{ "startOffset": 1300, "endOffset": 1312, "count": 0 }
],
"isBlockCoverage": true
},
{
"functionName": "get",
"ranges": [{ "startOffset": 1758, "endOffset": 1780, "count": 2 }],
"isBlockCoverage": true
}
]
},
{
"scriptId": "2145",
"url": "file:///Users/maxtune/workspace/sastoj-frontend/packages/ui/lib/Button/Button.module.scss",
"functions": [
{
"functionName": "",
"ranges": [{ "startOffset": 0, "endOffset": 1381, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "",
"ranges": [{ "startOffset": 13, "endOffset": 1381, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "get",
"ranges": [{ "startOffset": 261, "endOffset": 331, "count": 8 }],
"isBlockCoverage": true
}
]
}
]
}
{"result":[{"scriptId":"1090","url":"file:///D:/Projects/SAST/sastoj-frontend/packages/ui/lib/test/setup.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1677,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1677,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":987,"endOffset":1031,"count":2}],"isBlockCoverage":true}]},{"scriptId":"1685","url":"file:///D:/Projects/SAST/sastoj-frontend/packages/ui/lib/Button/Button.test.tsx","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":4626,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":4626,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1397,"endOffset":1890,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1954,"endOffset":2600,"count":1}],"isBlockCoverage":true}]},{"scriptId":"1778","url":"file:///D:/Projects/SAST/sastoj-frontend/packages/ui/lib/Button/Button.tsx","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":4472,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":4472,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":999,"endOffset":1707,"count":2},{"startOffset":1297,"endOffset":1309,"count":0},{"startOffset":1356,"endOffset":1366,"count":0}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":1804,"endOffset":1826,"count":2}],"isBlockCoverage":true}]},{"scriptId":"1780","url":"file:///D:/Projects/SAST/sastoj-frontend/packages/ui/lib/Button/Button.module.scss","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1381,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1381,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":261,"endOffset":331,"count":10}],"isBlockCoverage":true}]}]}
179 changes: 89 additions & 90 deletions packages/ui/coverage/Button.tsx.html
Original file line number Diff line number Diff line change
@@ -1,78 +1,68 @@

<!doctype html>
<html lang="en">
<head>

<head>
<title>Code coverage report for Button.tsx</title>
<meta charset="utf-8" />
<link
rel="stylesheet"
href="prettify.css"
/>
<link
rel="stylesheet"
href="base.css"
/>
<link
rel="shortcut icon"
type="image/x-icon"
href="favicon.png"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1"
/>
<style type="text/css">
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>

<body>
<div class="wrapper">
<div class="pad1">
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> Button.tsx</h1>
<div class="clearfix">
<div class="fl pad1y space-right2">
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class="fraction">41/41</span>
</div>

<div class="fl pad1y space-right2">
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class="fraction">1/2</span>
</div>

<div class="fl pad1y space-right2">
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class="fraction">0/0</span>
</div>

<div class="fl pad1y space-right2">
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class="fraction">41/41</span>
</div>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>46/46</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">33.33% </span>
<span class="quiet">Branches</span>
<span class='fraction'>1/3</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>46/46</span>
</div>


</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>,
<em>p</em> or <em>k</em> for the previous block.
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input
oninput="onInput()"
type="search"
id="fileSearch"
/>
</div>
<div class="quiet">
Filter:
<input oninput="onInput()" type="search" id="fileSearch">
</div>
</template>
</div>
<div class="status-line high"></div>
<pre><table class="coverage">
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
Expand Down Expand Up @@ -114,7 +104,13 @@ <h1><a href="index.html">All files</a> Button.tsx</h1>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
Expand All @@ -137,6 +133,10 @@ <h1><a href="index.html">All files</a> Button.tsx</h1>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
Expand All @@ -163,7 +163,7 @@ <h1><a href="index.html">All files</a> Button.tsx</h1>
/**
* The color of the button.
*/
color?: 'primary' | 'secondary' | 'danger';
color?: 'primary' | 'secondary' | 'tertiary' | 'danger';
&nbsp;
/**
* The size of the button.
Expand All @@ -174,15 +174,20 @@ <h1><a href="index.html">All files</a> Button.tsx</h1>
* If `true`, the button will be disabled.
*/
disabled?: boolean;
/**
* If `true`, the shadow will be appear
*/
isShadow?: boolean;
}
&nbsp;
export const Button = React.forwardRef&lt;HTMLButtonElement, ButtonProps&gt;(
({ color = 'primary', size = 'medium', disabled = false, ...rest }, ref) =&gt; {
({ color = 'primary', size = 'medium', disabled = false, isShadow = false, ...rest }, ref) =&gt; {
const btnClass = classnames(
styles['base'],
styles[color],
styles[size],
styles[<span class="branch-0 cbranch-no" title="branch not covered" >disabled ? 'disabled' : '</span>'],
styles[<span class="branch-0 cbranch-no" title="branch not covered" >isShadow ? 'shadow' : '</span>'],
);
return (
&lt;button
Expand All @@ -198,27 +203,21 @@ <h1><a href="index.html">All files</a> Button.tsx</h1>
Button.displayName = 'Button';
&nbsp;</pre></td></tr></table></pre>

<div class="push"></div>
<!-- for sticky footer -->
</div>
<!-- /wrapper -->
<div class="footer quiet pad2 space-top1 center small">
Code coverage generated by
<a
href="https://istanbul.js.org/"
target="_blank"
rel="noopener noreferrer"
>istanbul</a
>
at 2023-12-19T07:05:45.286Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-01-20T11:47:03.031Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

Loading

0 comments on commit cad4a9c

Please sign in to comment.