Browse Source

fix: Steps progress circle size & rtl style when use `progress` (#26075)

* fix: Steps progress circle size

* test: update snapshot

* fix: rtl
pull/26105/head
07akioni 4 years ago
committed by GitHub
parent
commit
f964abc7f4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      components/steps/__tests__/__snapshots__/demo.test.js.snap
  2. 2
      components/steps/index.tsx
  3. 8
      components/steps/style/progress.less
  4. 16
      components/steps/style/rtl.less

10
components/steps/__tests__/__snapshots__/demo.test.js.snap

@ -1273,7 +1273,7 @@ exports[`renders ./components/steps/demo/progress.md correctly 1`] = `
> >
<div <div
class="ant-progress-inner" class="ant-progress-inner"
style="width:38px;height:38px;font-size:11.7px" style="width:40px;height:40px;font-size:12px"
> >
<svg <svg
class="ant-progress-circle" class="ant-progress-circle"
@ -1508,7 +1508,7 @@ Array [
> >
<div <div
class="ant-progress-inner" class="ant-progress-inner"
style="width:38px;height:38px;font-size:11.7px" style="width:40px;height:40px;font-size:12px"
> >
<svg <svg
class="ant-progress-circle" class="ant-progress-circle"
@ -1683,7 +1683,7 @@ Array [
> >
<div <div
class="ant-progress-inner" class="ant-progress-inner"
style="width:30px;height:30px;font-size:10.5px" style="width:32px;height:32px;font-size:10.8px"
> >
<svg <svg
class="ant-progress-circle" class="ant-progress-circle"
@ -1858,7 +1858,7 @@ Array [
> >
<div <div
class="ant-progress-inner" class="ant-progress-inner"
style="width:38px;height:38px;font-size:11.7px" style="width:40px;height:40px;font-size:12px"
> >
<svg <svg
class="ant-progress-circle" class="ant-progress-circle"
@ -2033,7 +2033,7 @@ Array [
> >
<div <div
class="ant-progress-inner" class="ant-progress-inner"
style="width:30px;height:30px;font-size:10.5px" style="width:32px;height:32px;font-size:10.8px"
> >
<svg <svg
class="ant-progress-circle" class="ant-progress-circle"

2
components/steps/index.tsx

@ -67,7 +67,7 @@ export default class Steps extends React.Component<StepsProps, any> {
}) => { }) => {
if (status === 'process' && percent !== undefined) { if (status === 'process' && percent !== undefined) {
// currently it's hard-coded, since we can't easily read the actually width of icon // currently it's hard-coded, since we can't easily read the actually width of icon
const progressWidth = size === 'small' ? 30 : 38; const progressWidth = size === 'small' ? 32 : 40;
const iconWithProgress = ( const iconWithProgress = (
<div className={`${prefixCls}-progress-icon`}> <div className={`${prefixCls}-progress-icon`}>
<Progress <Progress

8
components/steps/style/progress.less

@ -11,10 +11,10 @@
position: relative; position: relative;
.@{progress-prefix-cls} { .@{progress-prefix-cls} {
position: absolute; position: absolute;
top: -4px; top: -5px;
right: -4px; right: -5px;
bottom: -4px; bottom: -5px;
left: -4px; left: -5px;
} }
} }
} }

16
components/steps/style/rtl.less

@ -42,13 +42,13 @@
.@{steps-prefix-cls}-horizontal:not(.@{steps-prefix-cls}-label-vertical) { .@{steps-prefix-cls}-horizontal:not(.@{steps-prefix-cls}-label-vertical) {
.@{steps-prefix-cls}-item { .@{steps-prefix-cls}-item {
.@{steps-prefix-cls}-rtl& { .@{steps-prefix-cls}-rtl& {
margin-right: 0; padding-right: 16px;
margin-left: 16px; padding-left: 0;
} }
&:last-child { &:first-child {
.@{steps-prefix-cls}-rtl& { .@{steps-prefix-cls}-rtl& {
margin-left: 0; padding-right: 0;
} }
} }
&:last-child .@{steps-prefix-cls}-item-title { &:last-child .@{steps-prefix-cls}-item-title {
@ -115,13 +115,13 @@
&.@{steps-prefix-cls}-horizontal:not(.@{steps-prefix-cls}-label-vertical) &.@{steps-prefix-cls}-horizontal:not(.@{steps-prefix-cls}-label-vertical)
.@{steps-prefix-cls}-item { .@{steps-prefix-cls}-item {
.@{steps-prefix-cls}-rtl& { .@{steps-prefix-cls}-rtl& {
margin-right: 0; padding-right: 12px;
margin-left: 12px; padding-left: 0;
} }
&:last-child { &:first-child {
.@{steps-prefix-cls}-rtl& { .@{steps-prefix-cls}-rtl& {
margin-left: 0; padding-right: 0;
} }
} }
} }

Loading…
Cancel
Save