Skip to content

Commit cc2fd04

Browse files
committed
merge master
2 parents e645a90 + bfe42ea commit cc2fd04

15 files changed

+132
-228
lines changed

.github/FUNDING.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: ant-design # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+5-112
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,7 @@
1-
name: CI
2-
3-
on:
4-
push:
5-
branches: [master]
6-
pull_request:
7-
branches: [master]
1+
name: ✅ test
2+
on: [push, pull_request]
83

94
jobs:
10-
setup:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: checkout
14-
uses: actions/checkout@master
15-
16-
- uses: actions/setup-node@v1
17-
with:
18-
node-version: '18'
19-
20-
- name: cache package-lock.json
21-
uses: actions/cache@v2
22-
with:
23-
path: package-temp-dir
24-
key: lock-${{ github.sha }}
25-
26-
- name: create package-lock.json
27-
run: npm i --package-lock-only --ignore-scripts
28-
29-
- name: hack for singe file
30-
run: |
31-
if [ ! -d "package-temp-dir" ]; then
32-
mkdir package-temp-dir
33-
fi
34-
cp package-lock.json package-temp-dir
35-
36-
- name: cache node_modules
37-
id: node_modules_cache_id
38-
uses: actions/cache@v2
39-
with:
40-
path: node_modules
41-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
42-
43-
- name: install
44-
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
45-
run: npm ci
46-
47-
lint:
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: checkout
51-
uses: actions/checkout@master
52-
53-
- name: restore cache from package-lock.json
54-
uses: actions/cache@v2
55-
with:
56-
path: package-temp-dir
57-
key: lock-${{ github.sha }}
58-
59-
- name: restore cache from node_modules
60-
uses: actions/cache@v2
61-
with:
62-
path: node_modules
63-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
64-
65-
- name: lint
66-
run: npm run lint
67-
68-
needs: setup
69-
70-
compile:
71-
runs-on: ubuntu-latest
72-
steps:
73-
- name: checkout
74-
uses: actions/checkout@master
75-
76-
- name: restore cache from package-lock.json
77-
uses: actions/cache@v2
78-
with:
79-
path: package-temp-dir
80-
key: lock-${{ github.sha }}
81-
82-
- name: restore cache from node_modules
83-
uses: actions/cache@v2
84-
with:
85-
path: node_modules
86-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
87-
88-
- name: compile
89-
run: npm run compile
90-
91-
needs: setup
92-
93-
coverage:
94-
runs-on: ubuntu-latest
95-
steps:
96-
- name: checkout
97-
uses: actions/checkout@master
98-
99-
- name: restore cache from package-lock.json
100-
uses: actions/cache@v2
101-
with:
102-
path: package-temp-dir
103-
key: lock-${{ github.sha }}
104-
105-
- name: restore cache from node_modules
106-
uses: actions/cache@v2
107-
with:
108-
path: node_modules
109-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
110-
111-
- name: coverage
112-
run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash)
113-
114-
needs: setup
5+
test:
6+
uses: react-component/rc-test/.github/workflows/test.yml@main
7+
secrets: inherit

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ package-lock.json
3737
.dumi/tmp-test
3838
.dumi/tmp-production
3939
.env.local
40+
41+
bun.lockb

bunfig.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[install]
2+
peer = false

docs/examples/fast-progress.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import * as React from 'react';
2-
import { Line, Circle, ProgressProps } from 'rc-progress';
1+
import React from 'react';
2+
import { Line, Circle } from 'rc-progress';
3+
import type { ProgressProps } from 'rc-progress';
34

45
class App extends React.Component<ProgressProps, any> {
5-
constructor(props) {
6+
constructor(props: ProgressProps) {
67
super(props);
78
this.state = {
89
percent: 0,

docs/examples/gap.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
import * as React from 'react';
2-
import { Circle, type ProgressProps } from 'rc-progress';
1+
import React from 'react';
2+
import { Circle } from 'rc-progress';
3+
import type { ProgressProps } from 'rc-progress';
34

45
const colorMap = ['#3FC7FA', '#85D262', '#FE8C6A', '#FF5959', '#BC3FFA'];
56

6-
function getColor(index) {
7+
const circleContainerStyle: React.CSSProperties = {
8+
width: 200,
9+
height: 200,
10+
};
11+
12+
function getColor(index: number) {
713
return colorMap[(index + colorMap.length) % colorMap.length];
814
}
915

1016
class Example extends React.Component<ProgressProps, any> {
11-
constructor(props) {
17+
constructor(props: ProgressProps) {
1218
super(props);
1319
this.state = {
1420
percent: 100,
@@ -36,10 +42,6 @@ class Example extends React.Component<ProgressProps, any> {
3642
}
3743

3844
render() {
39-
const circleContainerStyle = {
40-
width: '200px',
41-
height: '200px',
42-
};
4345
const { percent, colorIndex, subPathsCount } = this.state;
4446
const color = getColor(colorIndex);
4547

@@ -48,7 +50,7 @@ class Example extends React.Component<ProgressProps, any> {
4850
0,
4951
subPathsCount,
5052
);
51-
const multiPercentageStrokeColors = multiPercentage.map((v, index) => getColor(index));
53+
const multiPercentageStrokeColors = multiPercentage.map((_, i) => getColor(i));
5254

5355
return (
5456
<div>

docs/examples/gradient-circle.tsx

+10-21
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import { Circle } from 'rc-progress';
33

4-
const Example = () => {
5-
const circleContainerStyle = {
6-
width: '250px',
7-
height: '250px',
8-
display: 'inline-block',
9-
};
4+
const circleContainerStyle: React.CSSProperties = {
5+
width: 250,
6+
height: 250,
7+
display: 'inline-block',
8+
};
109

10+
const Example: React.FC = () => {
1111
return (
1212
<div>
1313
<h3>Circle Progress {90}%</h3>
@@ -16,10 +16,7 @@ const Example = () => {
1616
percent={90}
1717
strokeWidth={6}
1818
strokeLinecap="round"
19-
strokeColor={{
20-
'0%': '#108ee9',
21-
'100%': '#87d068',
22-
}}
19+
strokeColor={{ '0%': '#108ee9', '100%': '#87d068' }}
2320
/>
2421
</div>
2522
<h3>Circle Progress {100}%</h3>
@@ -28,23 +25,15 @@ const Example = () => {
2825
percent={100}
2926
strokeWidth={6}
3027
strokeLinecap="round"
31-
strokeColor={{
32-
'100%': '#108ee9',
33-
'0%': '#87d068',
34-
}}
28+
strokeColor={{ '100%': '#108ee9', '0%': '#87d068' }}
3529
/>
3630
</div>
37-
3831
<h3>Circle colors</h3>
3932
<div style={circleContainerStyle}>
4033
<Circle
4134
percent={90}
4235
strokeWidth={6}
43-
strokeColor={{
44-
'0%': 'green',
45-
'99%': 'red',
46-
'100%': 'blue',
47-
}}
36+
strokeColor={{ '0%': 'green', '99%': 'red', '100%': 'blue' }}
4837
/>
4938
</div>
5039
</div>

docs/examples/simple.tsx

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import * as React from 'react';
2-
import { Line, Circle, ProgressProps } from 'rc-progress';
1+
import React from 'react';
2+
import { Line, Circle } from 'rc-progress';
3+
import type { ProgressProps } from 'rc-progress';
34

45
class Example extends React.Component<ProgressProps, any> {
5-
constructor(props) {
6+
constructor(props: ProgressProps) {
67
super(props);
78
this.state = {
89
percent: 9,
@@ -20,29 +21,33 @@ class Example extends React.Component<ProgressProps, any> {
2021
percent: value,
2122
color: colorMap[parseInt((Math.random() * 3).toString(), 10)],
2223
});
23-
};
24+
}
2425

2526
changeIncrease() {
2627
this.setState(({ percent }) => {
2728
if (percent > 100) {
28-
percent = 100;
29+
return {
30+
percent: 100,
31+
};
2932
}
3033
return {
3134
percent: percent + 1,
3235
};
3336
});
34-
};
37+
}
3538

3639
changeReduce() {
3740
this.setState(({ percent }) => {
3841
if (percent < 0) {
39-
percent = 0;
42+
return {
43+
percent: 0,
44+
};
4045
}
4146
return {
4247
percent: percent - 1,
4348
};
4449
});
45-
};
50+
}
4651

4752
render() {
4853
const { percent, color } = this.state;

0 commit comments

Comments
 (0)