File tree Expand file tree Collapse file tree 6 files changed +33
-7
lines changed
Expand file tree Collapse file tree 6 files changed +33
-7
lines changed Original file line number Diff line number Diff line change 1+ examples
2+ scripts
3+ tests
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const Demo = () => {
3434 < ConfigProvider
3535 theme = { { algorithm : algorithm === "defaultAlgorithm" ? theme . defaultAlgorithm : theme . darkAlgorithm } } >
3636 < Card style = { { height : "100%" , borderRadius : 0 , border : "none" } } bodyStyle = { { padding : 0 } } >
37- < div className = "m-5" style = { { margin : 20 , maxWidth : 400 } } >
37+ < div style = { { margin : 20 , maxWidth : 400 } } >
3838 { value && (
3939 < pre style = { {
4040 background : algorithm === "defaultAlgorithm" ? "#efefef" : "#1f1f1f" ,
Original file line number Diff line number Diff line change 11{
2- "version" : " 0.2.0 " ,
2+ "version" : " 0.2.1 " ,
33 "name" : " antd-phone-input" ,
44 "description" : " Advanced, highly customizable phone input component for Ant Design." ,
55 "keywords" : [
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const PhoneInput = (inputLegacyProps: PhoneInputProps) => {
1616 const dropdownPrefixCls = getPrefixCls ( "dropdown" ) ;
1717 const [ _1 , inputCls ] = genComponentStyleHook ( inputPrefixCls ) ;
1818 const [ _2 , dropdownCls ] = genComponentStyleHook ( dropdownPrefixCls ) ;
19- const [ theme , token , _3 ] = useToken ( ) ;
19+ const [ theme , token ] = useToken ( ) ;
2020
2121 const inputClass = useMemo ( ( ) => {
2222 return `${ inputCls } ` + getStatusClassNames ( inputPrefixCls , status ) ;
Original file line number Diff line number Diff line change 11export default ( cssText : string ) => {
2+ window . addEventListener ( "load" , ( ) => {
3+ /** Resolve the overlap issue of the CSS rules when using Bootstrap */
4+ for ( const styleSheet of Array . from ( document . styleSheets ) ) {
5+ try {
6+ for ( const rule of Array . from ( styleSheet . cssRules || styleSheet . rules ) ) {
7+ if ( rule instanceof CSSStyleRule ) {
8+ rule . selectorText = rule . selectorText . replace (
9+ / ^ \. f o r m - c o n t r o l (? = : | $ ) / ,
10+ ".form-control:not(.ant-input)" ,
11+ )
12+ }
13+ }
14+ } catch ( e ) {
15+ }
16+ }
17+ } )
18+
19+ /** Inject the given `cssText` in the document head */
220 const style = document . createElement ( "style" ) ;
321 style . setAttribute ( "type" , "text/css" ) ;
422
Original file line number Diff line number Diff line change 1- import { GlobalToken } from "antd/lib/theme/interface " ;
2- import { genBasicInputStyle , initInputToken } from "antd/lib/input/style" ;
1+ import { mergeToken } from "antd/lib/theme/internal " ;
2+ import * as inputHelper from "antd/lib/input/style" ;
33
4- export default ( token : GlobalToken ) => ( {
4+ export default ( token : any ) => ( {
55 ".react-tel-input" : {
66 ".country-list" : {
77 boxShadow : token . boxShadow ,
88 backgroundColor : token . colorBgElevated ,
99 ".country-name" : { color : token . colorText } ,
1010 ".search" : { backgroundColor : token . colorBgElevated } ,
11- ".search-box" : genBasicInputStyle ( initInputToken ( token ) as any ) ,
11+ ".search-box" : inputHelper . genBasicInputStyle (
12+ mergeToken (
13+ ( ( inputHelper as any ) . initInputToken || ( ( ) => ( { } ) ) ) ( token ) ,
14+ ( ( inputHelper as any ) . initComponentToken || ( ( ) => ( { } ) ) ) ( token ) ,
15+ )
16+ ) ,
1217 ".country" : {
1318 borderRadius : token . borderRadiusOuter ,
1419 ".dial-code" : { color : token . colorTextDescription } ,
You can’t perform that action at this time.
0 commit comments