File tree Expand file tree Collapse file tree 5 files changed +17
-23
lines changed Expand file tree Collapse file tree 5 files changed +17
-23
lines changed Original file line number Diff line number Diff line change 11import '../../assets/index.less' ;
22import React , { useState } from 'react' ;
3- import type { SwitchChangeEventHandler } from 'rc-switch' ;
4- import Switch from 'rc-switch' ;
3+ import type { SwitchChangeEventHandler } from '@ rc-component/ switch' ;
4+ import Switch from '@ rc-component/ switch' ;
55
66const onChange : SwitchChangeEventHandler = ( value , event ) => {
77 // eslint-disable-next-line no-console
88 console . log ( `switch checked: ${ value } ` , event ) ;
9- }
9+ } ;
1010
1111export default ( ) => {
1212 const [ disabled , setDisabled ] = useState ( false ) ;
1313
1414 const toggle = ( ) => {
1515 setDisabled ( ( prev ) => ! prev ) ;
16- }
16+ } ;
1717
1818 return (
1919 < div style = { { margin : 20 } } >
20- < Switch
21- onChange = { onChange }
22- disabled = { disabled }
23- checkedChildren = "开"
24- unCheckedChildren = "关"
25- />
20+ < Switch onChange = { onChange } disabled = { disabled } checkedChildren = "开" unCheckedChildren = "关" />
2621 < div style = { { marginTop : 20 } } >
2722 < button type = "button" onClick = { toggle } >
2823 toggle disabled
2924 </ button >
3025 </ div >
3126 </ div >
32- )
33- }
27+ ) ;
28+ } ;
Original file line number Diff line number Diff line change 11{
2- "name" : " rc-switch" ,
3- "version" : " 4.1 .0" ,
2+ "name" : " @ rc-component/ switch" ,
3+ "version" : " 1.0 .0" ,
44 "description" : " switch ui component for react" ,
55 "keywords" : [
66 " react" ,
3232 "lint" : " eslint ." ,
3333 "lint-staged" : " lint-staged" ,
3434 "prepare" : " husky install && dumi setup" ,
35- "prepublishOnly" : " npm run compile && np --yolo --no-publish " ,
35+ "prepublishOnly" : " npm run compile && rc-np " ,
3636 "postpublish" : " npm run gh-pages" ,
3737 "start" : " dumi dev" ,
3838 "test" : " umi-test"
4343 ]
4444 },
4545 "dependencies" : {
46- "@babel/runtime" : " ^7.21.0" ,
4746 "classnames" : " ^2.2.1" ,
48- "rc-util" : " ^5.30 .0"
47+ "@ rc-component/ util" : " ^1.2 .0"
4948 },
5049 "devDependencies" : {
51- "@rc-component/father-plugin" : " ^1 .0.0" ,
50+ "@rc-component/father-plugin" : " ^2 .0.0" ,
5251 "@types/classnames" : " ^2.2.10" ,
5352 "@types/jest" : " ^29.4.0" ,
5453 "@umijs/fabric" : " ^3.0.0" ,
6564 "husky" : " ^8.0.1" ,
6665 "less" : " ^4.1.3" ,
6766 "lint-staged" : " ^15.1.0" ,
68- "np" : " ^9 .0.0 " ,
67+ "@rc-component/ np" : " ^1 .0.3 " ,
6968 "prettier" : " ^3.1.0" ,
7069 "react" : " ^16.0.0" ,
7170 "react-dom" : " ^16.0.0" ,
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import classNames from 'classnames' ;
3- import useMergedState from 'rc-util/lib/hooks/useMergedState' ;
4- import KeyCode from 'rc-util/lib/KeyCode' ;
3+ import useMergedState from '@ rc-component/ util/lib/hooks/useMergedState' ;
4+ import KeyCode from '@ rc-component/ util/lib/KeyCode' ;
55
66export type SwitchChangeEventHandler = (
77 checked : boolean ,
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import KeyCode from 'rc-util/lib/KeyCode' ;
2+ import KeyCode from '@ rc-component/ util/lib/KeyCode' ;
33import { mount } from 'enzyme' ;
44import Switch from '..' ;
55
Original file line number Diff line number Diff line change 1313 "skipLibCheck" : true ,
1414 "declaration" : true ,
1515 "paths" : {
16- "rc-switch" : [" src/index.tsx " ],
16+ "@ rc-component/ switch" : [" src/" ],
1717 "@@/*" : [" .dumi/tmp/*" ]
1818 }
1919 }
You can’t perform that action at this time.
0 commit comments