-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use
@rc-component/trigger
(#438)
* refactor: replace with @rc-trigger * chore: update deps * chore: update deps * chore: clean up * chore: update deps * test: Update test
- Loading branch information
Showing
12 changed files
with
148 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
export default { | ||
cjs: 'babel', | ||
esm: { type: 'babel', importLibToEs: true }, | ||
preCommit: { | ||
eslint: true, | ||
prettier: true, | ||
}, | ||
runtimeHelpers: true, | ||
}; | ||
import { defineConfig } from 'father'; | ||
|
||
export default defineConfig({ | ||
plugins: ['@rc-component/father-plugin'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Point | ||
nav: | ||
title: Demo | ||
path: /demo | ||
--- | ||
|
||
<code src="../examples/point.tsx"></code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Tooltip from 'rc-tooltip'; | ||
import React from 'react'; | ||
import '../../assets/bootstrap_white.less'; | ||
|
||
const text = <span>Tooltip Text</span>; | ||
|
||
const Test = () => { | ||
const scrollRef = React.useRef<HTMLDivElement>(); | ||
|
||
return ( | ||
<div style={{ padding: 10 }}> | ||
<div | ||
ref={scrollRef} | ||
style={{ | ||
border: '1px solid black', | ||
width: '100%', | ||
height: 'calc(100vh - 40px)', | ||
boxSizing: 'border-box', | ||
overflow: 'auto', | ||
}} | ||
> | ||
<div | ||
style={{ | ||
background: 'rgba(255,0,0,0.05)', | ||
width: '300%', | ||
height: '200%', | ||
position: 'relative', | ||
}} | ||
> | ||
<Tooltip | ||
placement="top" | ||
overlay={text} | ||
overlayInnerStyle={{ width: 300, height: 50 }} | ||
popupVisible | ||
arrowContent={<div className="rc-tooltip-arrow-inner" />} | ||
> | ||
<div | ||
style={{ | ||
background: 'rgba(0,255,0,0.3)', | ||
width: 100, | ||
height: 50, | ||
position: 'absolute', | ||
left: '30%', | ||
top: '30%', | ||
}} | ||
> | ||
Hover Me | ||
</div> | ||
</Tooltip> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,32 +17,35 @@ | |
"url": "[email protected]:react-component/tooltip.git" | ||
}, | ||
"license": "MIT", | ||
"maintainers": [ | ||
"[email protected]" | ||
], | ||
"main": "lib/index", | ||
"module": "es/index", | ||
"files": [ | ||
"dist", | ||
"lib", | ||
"es", | ||
"assets/*.css", | ||
"assets/*.less" | ||
], | ||
"main": "lib/index", | ||
"module": "es/index", | ||
"scripts": { | ||
"start": "dumi dev", | ||
"compile": "father build && lessc assets/bootstrap.less assets/bootstrap.css && lessc assets/bootstrap_white.less assets/bootstrap_white.css", | ||
"docs:build": "dumi build", | ||
"docs:deploy": "gh-pages -d .doc", | ||
"compile": "father build && lessc assets/bootstrap.less assets/bootstrap.css && lessc assets/bootstrap_white.less assets/bootstrap_white.css", | ||
"coverage": "father test --coverage", | ||
"lint": "eslint src/ --ext .tsx,.ts,.jsx,.js", | ||
"now-build": "npm run build", | ||
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish", | ||
"test": "father test" | ||
"start": "dumi dev", | ||
"test": "rc-test" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.11.2", | ||
"classnames": "^2.3.1", | ||
"rc-trigger": "^5.3.1" | ||
"@rc-component/trigger": "^1.0.4", | ||
"classnames": "^2.3.1" | ||
}, | ||
"devDependencies": { | ||
"@rc-component/father-plugin": "^1.0.0", | ||
"@testing-library/react": "^13.4.0", | ||
"@types/jest": "^26.0.0", | ||
"@types/react": "^18.0.26", | ||
|
@@ -51,18 +54,15 @@ | |
"cross-env": "^7.0.0", | ||
"dumi": "^2.1.1", | ||
"eslint": "^7.1.0", | ||
"father": "^2.23.1", | ||
"father-build": "^1.18.6", | ||
"father": "^4.0.0", | ||
"gh-pages": "^3.1.0", | ||
"less": "^3.11.1", | ||
"np": "^7.1.0", | ||
"rc-test": "^7.0.9", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"typescript": "^4.0.5" | ||
}, | ||
"maintainers": [ | ||
"[email protected]" | ||
], | ||
"peerDependencies": { | ||
"react": ">=16.9.0", | ||
"react-dom": ">=16.9.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Trigger from '@rc-component/trigger/lib/mock'; | ||
|
||
export default Trigger; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.