-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Progress): complete refactoring (#387)
* feat(Progress): complete refactoring * feat(Progress): update demo * test: add test unit * fix: fir cr * fix: update api docs
- Loading branch information
Showing
27 changed files
with
584 additions
and
223 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
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 |
---|---|---|
@@ -1,46 +1,77 @@ | ||
.tdesign-mobile-demo { | ||
background-color: #F6F6F6; | ||
font-family: "PingFang SC"; | ||
background-color: #f6f6f6; | ||
font-family: 'PingFang SC'; | ||
padding-bottom: 28px; | ||
box-sizing: border-box; | ||
|
||
&-header { | ||
&__title { | ||
padding: 24px 16px 8px 16px; | ||
opacity: 1; | ||
color: rgba(0, 0, 0, 0.9); | ||
font-size: 20px; | ||
font-weight: 700; | ||
line-height: 28px; | ||
} | ||
|
||
&__summary { | ||
opacity: 1; | ||
color: rgba(0, 0, 0, 0.4); | ||
font-size: 12px; | ||
line-height: 22px; | ||
padding: 0 16px; | ||
} | ||
.title { | ||
font-size: 24px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
padding: 24px 16px 0; | ||
color: rgba(0, 0, 0, 0.9); | ||
} | ||
|
||
.summary { | ||
font-size: 14px; | ||
color: rgba(0, 0, 0, 0.6); | ||
margin: 8px 16px 0; | ||
line-height: 22px; | ||
} | ||
|
||
|
||
&-block { | ||
width: 100%; | ||
margin: 32px 0 0; | ||
|
||
&__title { | ||
padding: 24px 16px 0; | ||
font-size: 16px; | ||
font-weight: 700; | ||
&__header { | ||
color: #000; | ||
margin: 0 16px; | ||
} | ||
|
||
&__title + &__summary { | ||
padding: 8px 16px 16px; | ||
&__title { | ||
font-weight: 700; | ||
font-size: 18px; | ||
line-height: 26px; | ||
} | ||
|
||
&__summary { | ||
opacity: 1; | ||
color: rgba(0, 0, 0, 0.4); | ||
font-size: 12px; | ||
margin-top: 8px; | ||
font-size: 14px; | ||
white-space: pre-line; | ||
color: rgba(0, 0, 0, 0.6); | ||
line-height: 22px; | ||
padding: 16px; | ||
} | ||
|
||
&__slot { | ||
margin-top: 16px; | ||
|
||
&.with-padding { | ||
margin: 16px 16px 0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.tdesign-mobile-demo-block_notitle { | ||
margin-top: 0px; | ||
|
||
.tdesign-mobile-demo-block_subtitle { | ||
margin-top: 24px; | ||
} | ||
} | ||
|
||
.tdesign-mobile-demo-header { | ||
&__title { | ||
font-size: 24px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
padding: 24px 16px 0; | ||
color: rgba(0, 0, 0, 0.9); | ||
} | ||
|
||
&__summary { | ||
font-size: 14px; | ||
color: rgba(0, 0, 0, 0.6); | ||
margin: 8px 16px 0; | ||
line-height: 22px; | ||
} | ||
} |
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,4 +1,6 @@ | ||
module.exports = { | ||
button: { statements: '100%', branches: '66.66%', functions: '100%', lines: '100%' }, | ||
configProvider: { statements: '100%', branches: '100%', functions: '100%', lines: '100%' }, | ||
hooks: { statements: '100%', branches: '100%', functions: '100%', lines: '100%' }, | ||
progress: { statements: '84.37%', branches: '56.75%', functions: '85.71%', lines: '85.48%' }, | ||
}; |
Submodule _common
updated
1026 files
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,17 @@ | ||
import { useMemo } from 'react'; | ||
|
||
// defaultProps 将于 18.3.0 废弃,故需实现 hook 在组件内部兼容 | ||
// https://github.com/facebook/react/pull/16210 | ||
export default function useDefaultProps<T>(originalProps: T, defaultProps: Record<PropertyKey, any>): T { | ||
return useMemo<T>(() => { | ||
// eslint-disable-next-line | ||
const props = Object.assign({}, originalProps); | ||
Object.keys(defaultProps).forEach((key) => { | ||
// https://github.com/facebook/react/blob/main/packages/react/src/jsx/ReactJSXElement.js#L719-L722 | ||
if (props[key] === undefined) { | ||
props[key] = defaultProps[key]; | ||
} | ||
}); | ||
return props; | ||
}, [originalProps, defaultProps]); | ||
} |
Oops, something went wrong.