Skip to content

Commit

Permalink
v2.0.9 feat(Circle): add pointProps props. #142 81e7515
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Feb 23, 2024
1 parent 85c4234 commit 6cadaf0
Show file tree
Hide file tree
Showing 74 changed files with 133 additions and 126 deletions.
22 changes: 11 additions & 11 deletions asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"files": {
"main.css": "/static/css/main.6ef0c5a4.css",
"main.js": "/static/js/main.e193cafa.js",
"main.js": "/static/js/main.d4abf292.js",
"static/css/313.b92d3464.chunk.css": "/static/css/313.b92d3464.chunk.css",
"static/js/313.3d0b54ec.chunk.js": "/static/js/313.3d0b54ec.chunk.js",
"static/js/313.ae434549.chunk.js": "/static/js/313.ae434549.chunk.js",
"static/js/914.66a7179f.chunk.js": "/static/js/914.66a7179f.chunk.js",
"static/js/288.bb69d613.chunk.js": "/static/js/288.bb69d613.chunk.js",
"static/js/995.8a6c0a16.chunk.js": "/static/js/995.8a6c0a16.chunk.js",
"static/js/328.51b11b19.chunk.js": "/static/js/328.51b11b19.chunk.js",
"static/js/328.6e003764.chunk.js": "/static/js/328.6e003764.chunk.js",
"static/js/563.29775ec6.chunk.js": "/static/js/563.29775ec6.chunk.js",
"static/js/993.59fac0cc.chunk.js": "/static/js/993.59fac0cc.chunk.js",
"static/js/241.6e875e2b.chunk.js": "/static/js/241.6e875e2b.chunk.js",
Expand Down Expand Up @@ -44,24 +44,24 @@
"static/js/939.6ce3216d.chunk.js": "/static/js/939.6ce3216d.chunk.js",
"static/js/256.bf755a81.chunk.js": "/static/js/256.bf755a81.chunk.js",
"static/js/428.58bee991.chunk.js": "/static/js/428.58bee991.chunk.js",
"static/js/135.5169b410.chunk.js": "/static/js/135.5169b410.chunk.js",
"static/js/135.5a608439.chunk.js": "/static/js/135.5a608439.chunk.js",
"static/js/583.b627d957.chunk.js": "/static/js/583.b627d957.chunk.js",
"static/js/24.a08ae066.chunk.js": "/static/js/24.a08ae066.chunk.js",
"refractor-vendor.js": "/static/js/refractor-vendor.c5f44634.chunk.js",
"react-vendor.js": "/static/js/react-vendor.9874219f.js",
"static/css/18.df4b68c9.chunk.css": "/static/css/18.df4b68c9.chunk.css",
"static/js/18.a5f00d4f.chunk.js": "/static/js/18.a5f00d4f.chunk.js",
"static/js/18.92981000.chunk.js": "/static/js/18.92981000.chunk.js",
"static/js/592.f6c00de2.chunk.js": "/static/js/592.f6c00de2.chunk.js",
"index.html": "/index.html",
"static/media/home.svg": "/static/media/home.7d51f25c64fe597ec540c3e724748f4e.svg",
"main.6ef0c5a4.css.map": "/static/css/main.6ef0c5a4.css.map",
"main.e193cafa.js.map": "/static/js/main.e193cafa.js.map",
"main.d4abf292.js.map": "/static/js/main.d4abf292.js.map",
"313.b92d3464.chunk.css.map": "/static/css/313.b92d3464.chunk.css.map",
"313.3d0b54ec.chunk.js.map": "/static/js/313.3d0b54ec.chunk.js.map",
"313.ae434549.chunk.js.map": "/static/js/313.ae434549.chunk.js.map",
"914.66a7179f.chunk.js.map": "/static/js/914.66a7179f.chunk.js.map",
"288.bb69d613.chunk.js.map": "/static/js/288.bb69d613.chunk.js.map",
"995.8a6c0a16.chunk.js.map": "/static/js/995.8a6c0a16.chunk.js.map",
"328.51b11b19.chunk.js.map": "/static/js/328.51b11b19.chunk.js.map",
"328.6e003764.chunk.js.map": "/static/js/328.6e003764.chunk.js.map",
"563.29775ec6.chunk.js.map": "/static/js/563.29775ec6.chunk.js.map",
"993.59fac0cc.chunk.js.map": "/static/js/993.59fac0cc.chunk.js.map",
"241.6e875e2b.chunk.js.map": "/static/js/241.6e875e2b.chunk.js.map",
Expand Down Expand Up @@ -98,18 +98,18 @@
"939.6ce3216d.chunk.js.map": "/static/js/939.6ce3216d.chunk.js.map",
"256.bf755a81.chunk.js.map": "/static/js/256.bf755a81.chunk.js.map",
"428.58bee991.chunk.js.map": "/static/js/428.58bee991.chunk.js.map",
"135.5169b410.chunk.js.map": "/static/js/135.5169b410.chunk.js.map",
"135.5a608439.chunk.js.map": "/static/js/135.5a608439.chunk.js.map",
"583.b627d957.chunk.js.map": "/static/js/583.b627d957.chunk.js.map",
"24.a08ae066.chunk.js.map": "/static/js/24.a08ae066.chunk.js.map",
"refractor-vendor.c5f44634.chunk.js.map": "/static/js/refractor-vendor.c5f44634.chunk.js.map",
"react-vendor.9874219f.js.map": "/static/js/react-vendor.9874219f.js.map",
"18.df4b68c9.chunk.css.map": "/static/css/18.df4b68c9.chunk.css.map",
"18.a5f00d4f.chunk.js.map": "/static/js/18.a5f00d4f.chunk.js.map",
"18.92981000.chunk.js.map": "/static/js/18.92981000.chunk.js.map",
"592.f6c00de2.chunk.js.map": "/static/js/592.f6c00de2.chunk.js.map"
},
"entrypoints": [
"static/js/react-vendor.9874219f.js",
"static/css/main.6ef0c5a4.css",
"static/js/main.e193cafa.js"
"static/js/main.d4abf292.js"
]
}
8 changes: 4 additions & 4 deletions coverage/badges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions coverage/coverage-summary.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{"total": {"lines":{"total":668,"covered":667,"skipped":0,"pct":99.85},"statements":{"total":715,"covered":713,"skipped":0,"pct":99.72},"functions":{"total":167,"covered":167,"skipped":0,"pct":100},"branches":{"total":649,"covered":633,"skipped":0,"pct":97.53},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
{"total": {"lines":{"total":669,"covered":668,"skipped":0,"pct":99.85},"statements":{"total":716,"covered":714,"skipped":0,"pct":99.72},"functions":{"total":167,"covered":167,"skipped":0,"pct":100},"branches":{"total":649,"covered":633,"skipped":0,"pct":97.53},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-alpha/src/Pointer.tsx": {"lines":{"total":4,"covered":4,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":4,"covered":4,"skipped":0,"pct":100},"branches":{"total":4,"covered":4,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-alpha/src/index.tsx": {"lines":{"total":15,"covered":15,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":15,"covered":15,"skipped":0,"pct":100},"branches":{"total":23,"covered":21,"skipped":0,"pct":91.3}}
,"/home/runner/work/react-color/react-color/packages/color-block/src/index.tsx": {"lines":{"total":17,"covered":17,"skipped":0,"pct":100},"functions":{"total":5,"covered":5,"skipped":0,"pct":100},"statements":{"total":17,"covered":17,"skipped":0,"pct":100},"branches":{"total":17,"covered":17,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-chrome/src/Arrow.tsx": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-chrome/src/index.tsx": {"lines":{"total":27,"covered":27,"skipped":0,"pct":100},"functions":{"total":11,"covered":11,"skipped":0,"pct":100},"statements":{"total":28,"covered":28,"skipped":0,"pct":100},"branches":{"total":31,"covered":30,"skipped":0,"pct":96.77}}
,"/home/runner/work/react-color/react-color/packages/color-circle/src/Point.tsx": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":6,"covered":6,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-circle/src/index.tsx": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":13,"covered":13,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-circle/src/index.tsx": {"lines":{"total":10,"covered":10,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":10,"covered":10,"skipped":0,"pct":100},"branches":{"total":13,"covered":13,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-colorful/src/index.tsx": {"lines":{"total":15,"covered":15,"skipped":0,"pct":100},"functions":{"total":9,"covered":9,"skipped":0,"pct":100},"statements":{"total":16,"covered":16,"skipped":0,"pct":100},"branches":{"total":17,"covered":16,"skipped":0,"pct":94.11}}
,"/home/runner/work/react-color/react-color/packages/color-compact/src/index.tsx": {"lines":{"total":18,"covered":18,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":20,"covered":20,"skipped":0,"pct":100},"branches":{"total":21,"covered":21,"skipped":0,"pct":100}}
,"/home/runner/work/react-color/react-color/packages/color-convert/src/index.ts": {"lines":{"total":145,"covered":145,"skipped":0,"pct":100},"functions":{"total":32,"covered":32,"skipped":0,"pct":100},"statements":{"total":160,"covered":160,"skipped":0,"pct":100},"branches":{"total":84,"covered":84,"skipped":0,"pct":100}}
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-alpha/src/Pointer.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-alpha/
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-alpha/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1><a href="../../index.html">All files</a> color-alpha/src</h1>
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-alpha/src/index.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-alpha/
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-block/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h1><a href="../../index.html">All files</a> color-block/src</h1>
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-block/src/index.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-block/
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-chrome/src/Arrow.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-chrome
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-chrome/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1><a href="../../index.html">All files</a> color-chrome/src</h1>
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-chrome/src/index.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-chrome
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/color-circle/src/Point.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-circle
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
10 changes: 5 additions & 5 deletions coverage/lcov-report/color-circle/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1><a href="../../index.html">All files</a> color-circle/src</h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>16/16</span>
<span class='fraction'>17/17</span>
</div>


Expand All @@ -46,7 +46,7 @@ <h1><a href="../../index.html">All files</a> color-circle/src</h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>16/16</span>
<span class='fraction'>17/17</span>
</div>


Expand Down Expand Up @@ -99,13 +99,13 @@ <h1><a href="../../index.html">All files</a> color-circle/src</h1>
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="9" class="abs high">9/9</td>
<td data-value="10" class="abs high">10/10</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="13" class="abs high">13/13</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="9" class="abs high">9/9</td>
<td data-value="10" class="abs high">10/10</td>
</tr>

</tbody>
Expand All @@ -116,7 +116,7 @@ <h1><a href="../../index.html">All files</a> color-circle/src</h1>
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
18 changes: 12 additions & 6 deletions coverage/lcov-report/color-circle/src/index.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-circle
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>9/9</span>
<span class='fraction'>10/10</span>
</div>


Expand All @@ -46,7 +46,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-circle
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>9/9</span>
<span class='fraction'>10/10</span>
</div>


Expand Down Expand Up @@ -96,7 +96,10 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-circle
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -112,6 +115,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-circle
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -137,21 +141,23 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-circle
export interface CircleProps extends Omit&lt;SwatchProps, 'color' | 'onChange'&gt; {
color?: string | HsvaColor;
onChange?: (color: ColorResult) =&gt; void;
pointProps?: React.HTMLAttributes&lt;HTMLDivElement&gt;;
}
&nbsp;
const Circle = React.forwardRef&lt;HTMLDivElement, CircleProps&gt;((props, ref) =&gt; {
const { prefixCls = 'w-color-circle', className, color, colors = [], rectProps = {}, onChange, ...other } = props;
const { prefixCls = 'w-color-circle', className, color, colors = [], rectProps = {}, pointProps, onChange, ...other } = props;
const hsva = (typeof color === 'string' &amp;&amp; validHex(color) ? hexToHsva(color) : color || {}) as HsvaColor;
const hex = color ? hsvaToHex(hsva) : '';
const cls = [prefixCls, className].filter(Boolean).join(' ');
const clsPoint = [`${prefixCls}-point`, pointProps?.className].filter(Boolean).join(' ');
return (
&lt;Swatch
ref={ref}
colors={colors}
color={hex}
{...other}
className={cls}
rectRender={({ ...props }) =&gt; &lt;Point {...props} className={`${prefixCls}-point`} rectProps={rectProps} /&gt;}
rectRender={({ ...props }) =&gt; &lt;Point {...props} {...pointProps} className={clsPoint} rectProps={rectProps} /&gt;}
onChange={(hsvColor) =&gt; {
onChange &amp;&amp; onChange(handleColor(hsvColor));
}}
Expand All @@ -169,7 +175,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">color-circle
<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-02-23T11:22:05.806Z
at 2024-02-23T15:45:13.823Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
Loading

0 comments on commit 6cadaf0

Please sign in to comment.