Skip to content

refactor: Use pure react new life cycle method #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 46 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
51dbb92
use father
zombieJ Sep 30, 2019
0e7a7b8
init lint config
zombieJ Sep 30, 2019
bce11b0
fix lint
zombieJ Sep 30, 2019
e66b79f
typescript PopupInner
zombieJ Sep 30, 2019
84214aa
fix ref issue
zombieJ Sep 30, 2019
2907142
Popup to ts
zombieJ Sep 30, 2019
45abd16
mock to ts
zombieJ Sep 30, 2019
8278f67
more ts
zombieJ Sep 30, 2019
32d26cd
add align define
zombieJ Sep 30, 2019
5a16813
util add type define
zombieJ Sep 30, 2019
472d236
clean up ts
zombieJ Sep 30, 2019
ebc4190
move trigger ts define out
zombieJ Sep 30, 2019
3434b0a
done ts define
zombieJ Sep 30, 2019
b2645a4
fix lint
zombieJ Sep 30, 2019
819be9a
add motion define
zombieJ Sep 30, 2019
1471607
remove LazyBox in Popup
zombieJ Sep 30, 2019
3536a2c
rm LazyRenderBox
zombieJ Sep 30, 2019
276eec0
add case demo
zombieJ Sep 30, 2019
bc18572
update demo
zombieJ Sep 30, 2019
f74b00c
add montionName support
zombieJ Oct 8, 2019
bda171d
add missing visible
zombieJ Oct 8, 2019
849b500
use rc-util find dom node
zombieJ Oct 9, 2019
72d7ede
step of stretch
zombieJ Oct 9, 2019
6eca917
add align logic
zombieJ Oct 9, 2019
83be6b1
support motion and no-motion
zombieJ Oct 9, 2019
09eac69
fix visible logic
zombieJ Oct 9, 2019
7f68274
support leave motion
zombieJ Oct 9, 2019
20b8106
support no-motion leave
zombieJ Oct 9, 2019
d4f3542
fix new re-render logic
zombieJ Oct 9, 2019
1bf301a
move update logic into static
zombieJ Oct 9, 2019
1c55d32
restore align
zombieJ Oct 9, 2019
2f938bb
fix point logic
zombieJ Oct 9, 2019
4ac2f63
add comment
zombieJ Oct 9, 2019
b4f46f3
support legacy props
zombieJ Oct 9, 2019
e102b02
use new context
zombieJ Oct 9, 2019
57eaeb9
fix ci
zombieJ Oct 9, 2019
5929934
add now
zombieJ Oct 9, 2019
a8c1b95
rm legacy lib
zombieJ Oct 9, 2019
acc7eee
update test case
zombieJ Oct 9, 2019
500af1e
add nest test case
zombieJ Oct 10, 2019
acbef3c
forcerender support
zombieJ Oct 10, 2019
fd4cadc
destroy test
zombieJ Oct 10, 2019
608fbe1
basic test
zombieJ Oct 10, 2019
02f0982
point test case
zombieJ Oct 10, 2019
6faa071
update mock test
zombieJ Oct 10, 2019
9cddc01
disable sort-comp
zombieJ Oct 10, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const base = require('@umijs/fabric/dist/eslint');

module.exports = {
...base,
rules: {
...base.rules,
'default-case': 0,
'react/no-find-dom-node': 0,
'react/no-did-update-set-state': 0,
'react/no-unused-state': 1,
'react/sort-comp': 0,
'jsx-a11y/label-has-for': 0,
'jsx-a11y/label-has-associated-control': 0,
},
};
8 changes: 8 additions & 0 deletions .fatherrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
cjs: 'babel',
esm: { type: 'babel', importLibToEs: true },
preCommit: {
eslint: true,
prettier: true,
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.storybook
*.iml
*.log
.idea
Expand Down
22 changes: 4 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
language: node_js

sudo: false

notifications:
email:
- [email protected]

node_js:
- 6.9.1
- 10

before_install:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
then
echo "Only docs were updated, stopping build process."
exit
fi
phantomjs --version
script:
- |
if [ "$TEST_TYPE" = test ]; then
npm test
npm run coverage && \
bash <(curl -s https://codecov.io/bash)
else
npm run $TEST_TYPE
fi
env:
matrix:
- TEST_TYPE=lint
- TEST_TYPE=test
- TEST_TYPE=coverage
- TEST_TYPE=test
105 changes: 105 additions & 0 deletions examples/case.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// ======================= Popup =======================
.case-motion {
transform-origin: 50% 50%;

animation-duration: 0.3s;
animation-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28);
animation-fill-mode: both;

&::after {
content: 'Animating...';
position: absolute;
bottom: -3em;
}

&-appear,
&-enter {
animation-play-state: paused;

&-active {
animation-name: case-zoom-in;
animation-play-state: running;
}
}

&-leave {
animation-play-state: paused;

&-active {
animation-name: case-zoom-out;
animation-play-state: running;
}
}
}

@keyframes case-zoom-in {
0% {
opacity: 0;
transform: scale(0);
}
100% {
opacity: 1;
transform: scale(1);
}
}

@keyframes case-zoom-out {
0% {
opacity: 1;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(1.2);
}
}

// ======================= Mask =======================
.mask-motion {
animation-duration: 0.3s;
animation-fill-mode: both;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);

&-appear,
&-enter {
animation-play-state: paused;
opacity: 0;

&-active {
animation-name: mask-zoom-in;
animation-play-state: running;
}
}

&-leave {
animation-play-state: paused;

&-active {
animation-name: mask-zoom-out;
animation-play-state: running;
}
}
}

@keyframes mask-zoom-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes mask-zoom-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
Loading