From 9d6c31ccf49153d34ebd3a141a2079c8da0b4490 Mon Sep 17 00:00:00 2001 From: James Yeung Date: Mon, 16 Nov 2020 10:20:32 +0800 Subject: [PATCH] chore: sync ant-design v4.8.3 (#789) --- components/alert/style/rtl.less | 5 ----- components/avatar/style/index.less | 4 ++++ components/button/style/rtl.less | 5 ----- components/calendar/style/rtl.less | 6 ------ components/card/style/size.less | 2 -- components/date-picker/style/index.less | 4 ++++ components/date-picker/style/panel.less | 4 ++-- components/date-picker/style/rtl.less | 12 ++++++++++-- components/dropdown/style/index.less | 5 +---- components/dropdown/style/rtl.less | 4 ++++ components/menu/style/index.less | 2 +- components/menu/style/rtl.less | 8 ++++---- components/radio/style/index.less | 10 ++++------ components/select/style/multiple.less | 8 ++++---- components/select/style/rtl.less | 7 +++++++ components/style/themes/default.less | 2 ++ components/typography/style/index.less | 10 +++++++--- 17 files changed, 54 insertions(+), 44 deletions(-) diff --git a/components/alert/style/rtl.less b/components/alert/style/rtl.less index 125ca0fe..6f0c45a0 100644 --- a/components/alert/style/rtl.less +++ b/components/alert/style/rtl.less @@ -1,8 +1,3 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; - -@alert-prefix-cls: ~'@{ant-prefix}-alert'; - .@{alert-prefix-cls} { &&-rtl { padding: 8px 37px 8px 15px; diff --git a/components/avatar/style/index.less b/components/avatar/style/index.less index dc84db5d..6ba2dadd 100644 --- a/components/avatar/style/index.less +++ b/components/avatar/style/index.less @@ -19,6 +19,10 @@ background: transparent; } + .@{ant-prefix}-image-img { + display: block; + } + .avatar-size(@avatar-size-base, @avatar-font-size-base); &-lg { diff --git a/components/button/style/rtl.less b/components/button/style/rtl.less index e585cc12..6cf8b6f9 100644 --- a/components/button/style/rtl.less +++ b/components/button/style/rtl.less @@ -1,8 +1,3 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; - -@btn-prefix-cls: ~'@{ant-prefix}-btn'; - .@{btn-prefix-cls} { &-rtl { direction: rtl; diff --git a/components/calendar/style/rtl.less b/components/calendar/style/rtl.less index 44d0560d..06464daa 100644 --- a/components/calendar/style/rtl.less +++ b/components/calendar/style/rtl.less @@ -1,9 +1,3 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; - -@calendar-prefix-cls: ~'@{ant-prefix}-picker-calendar'; -@calendar-picker-prefix-cls: ~'@{ant-prefix}-picker'; - .@{calendar-prefix-cls} { &-rtl { direction: rtl; diff --git a/components/card/style/size.less b/components/card/style/size.less index 00bb7a7a..d78f464a 100644 --- a/components/card/style/size.less +++ b/components/card/style/size.less @@ -1,5 +1,3 @@ -@import './index'; - .@{card-prefix-cls}-small { > .@{card-prefix-cls}-head { min-height: @card-head-height-sm; diff --git a/components/date-picker/style/index.less b/components/date-picker/style/index.less index cd1730cc..6e3aaccc 100644 --- a/components/date-picker/style/index.less +++ b/components/date-picker/style/index.less @@ -209,6 +209,10 @@ .@{picker-prefix-cls}-clear { right: @input-padding-horizontal-sm; } + + .@{picker-prefix-cls}-active-bar { + margin-left: @input-padding-horizontal-sm; + } } } diff --git a/components/date-picker/style/panel.less b/components/date-picker/style/panel.less index 4d57191a..4238e662 100644 --- a/components/date-picker/style/panel.less +++ b/components/date-picker/style/panel.less @@ -302,12 +302,12 @@ .@{picker-prefix-cls}-date-panel &-in-view&-in-range&-range-hover-start .@{cellClassName}::after { - right: -6px - @border-width-base; + right: -5px - @border-width-base; left: 0; } .@{picker-prefix-cls}-date-panel &-in-view&-in-range&-range-hover-end .@{cellClassName}::after { right: 0; - left: -6px - @border-width-base; + left: -5px - @border-width-base; } // Hover with range start & end diff --git a/components/date-picker/style/rtl.less b/components/date-picker/style/rtl.less index 7316c0bf..1308c4c6 100644 --- a/components/date-picker/style/rtl.less +++ b/components/date-picker/style/rtl.less @@ -60,6 +60,14 @@ margin-left: 0; } } + + &.@{picker-prefix-cls}-small { + .@{picker-prefix-cls}-active-bar { + .@{picker-prefix-cls}-rtl& { + margin-right: @input-padding-horizontal-sm; + } + } + } } // ======================== Ranges ======================== @@ -141,13 +149,13 @@ .@{cellClassName}::after { .@{picker-prefix-cls}-panel-rtl & { right: 0; - left: -6px - @border-width-base; + left: -5px - @border-width-base; } } .@{picker-prefix-cls}-date-panel &-in-view&-in-range&-range-hover-end .@{cellClassName}::after { .@{picker-prefix-cls}-panel-rtl & { - right: -6px - @border-width-base; + right: -5px - @border-width-base; left: 0; } } diff --git a/components/dropdown/style/index.less b/components/dropdown/style/index.less index 4240037c..e60932d2 100644 --- a/components/dropdown/style/index.less +++ b/components/dropdown/style/index.less @@ -140,10 +140,7 @@ z-index: @zindex-dropdown; background: transparent; box-shadow: none; - - > .@{dropdown-prefix-cls}-menu { - transform-origin: 0 0; - } + transform-origin: 0 0; ul, li { diff --git a/components/dropdown/style/rtl.less b/components/dropdown/style/rtl.less index 54c090da..5054117b 100644 --- a/components/dropdown/style/rtl.less +++ b/components/dropdown/style/rtl.less @@ -29,6 +29,10 @@ } &-submenu-popup { + &.@{dropdown-prefix-cls}-menu-submenu-rtl { + transform-origin: 100% 0; + } + ul, li { .@{dropdown-prefix-cls}-rtl & { diff --git a/components/menu/style/index.less b/components/menu/style/index.less index 82d4d886..5ee55866 100644 --- a/components/menu/style/index.less +++ b/components/menu/style/index.less @@ -144,7 +144,6 @@ padding: 0; overflow: hidden; border-right: 0; - transform-origin: 0 0; // https://github.com/ant-design/ant-design/issues/22244 // https://github.com/ant-design/ant-design/issues/26812 @@ -220,6 +219,7 @@ background: transparent; border-radius: @border-radius-base; box-shadow: none; + transform-origin: 0 0; // https://github.com/ant-design/ant-design/issues/13955 &::before { diff --git a/components/menu/style/rtl.less b/components/menu/style/rtl.less index 32913df6..7e4dad20 100644 --- a/components/menu/style/rtl.less +++ b/components/menu/style/rtl.less @@ -33,10 +33,6 @@ &-vertical&-sub, &-vertical-left&-sub, &-vertical-right&-sub { - .@{menu-prefix-cls}-rtl& { - transform-origin: top right; - } - > .@{menu-prefix-cls}-item, > .@{menu-prefix-cls}-submenu { .@{menu-prefix-cls}-rtl& { @@ -64,6 +60,10 @@ } &-submenu { + &-rtl.@{menu-prefix-cls}-submenu-popup { + transform-origin: 100% 0; + } + &-vertical, &-vertical-left, &-vertical-right, diff --git a/components/radio/style/index.less b/components/radio/style/index.less index 0d9cc555..2c30a747 100644 --- a/components/radio/style/index.less +++ b/components/radio/style/index.less @@ -78,11 +78,9 @@ &-inner { &::after { - @radio-dot-size: @radio-size - 8px; - position: absolute; - top: (@radio-size - @radio-dot-size) / 2 - 1px; - left: (@radio-size - @radio-dot-size) / 2 - 1px; + top: (@radio-size - @radio-dot-size) / 2 - @radio-border-width; + left: (@radio-size - @radio-dot-size) / 2 - @radio-border-width; display: table; width: @radio-dot-size; height: @radio-dot-size; @@ -105,8 +103,8 @@ background-color: @radio-button-bg; border-color: @border-color-base; border-style: solid; - border-width: 1px; - border-radius: 100px; + border-width: @radio-border-width; + border-radius: 50%; transition: all @radio-duration; } diff --git a/components/select/style/multiple.less b/components/select/style/multiple.less index 60775ad6..a8cf390a 100644 --- a/components/select/style/multiple.less +++ b/components/select/style/multiple.less @@ -78,7 +78,7 @@ display: inline-block; margin-right: @padding-xs / 2; overflow: hidden; - white-space: nowrap; + white-space: pre; // fix whitespace wrapping. custom tags display all whitespace within. text-overflow: ellipsis; } @@ -123,13 +123,13 @@ top: 0; left: 0; z-index: 999; - white-space: nowrap; + white-space: pre; // fix whitespace wrapping caused width calculation bug visibility: hidden; } // https://github.com/ant-design/ant-design/issues/22906 - &:first-child .@{select-prefix-cls}-selection-search-input { - margin-left: 6.5px; + &:first-child > .@{select-prefix-cls}-selection-search-input { + margin-left: 6.5px !important; } } diff --git a/components/select/style/rtl.less b/components/select/style/rtl.less index 82e055e6..78dae773 100644 --- a/components/select/style/rtl.less +++ b/components/select/style/rtl.less @@ -94,6 +94,13 @@ left: auto; } } + + &:first-child > .@{select-prefix-cls}-selection-search-input { + .@{select-prefix-cls}-rtl& { + margin-right: 5px !important; + margin-left: 0 !important; + } + } } // ======================= Placeholder ======================= diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 8dbe72ef..142adde6 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -258,6 +258,8 @@ // Radio @radio-size: 16px; @radio-top: 0px; +@radio-border-width: 1px; +@radio-dot-size: @radio-size - 8px; @radio-dot-color: @primary-color; @radio-dot-disabled-color: fade(@black, 20%); @radio-solid-checked-color: @component-background; diff --git a/components/typography/style/index.less b/components/typography/style/index.less index 185b1a00..82404b32 100644 --- a/components/typography/style/index.less +++ b/components/typography/style/index.less @@ -105,15 +105,19 @@ text-decoration: @link-hover-decoration; } - &[disabled] { + &[disabled], + &.@{typography-prefix-cls}-disabled { color: @disabled-color; cursor: not-allowed; - pointer-events: none; - + &:active, &:hover { color: @disabled-color; } + + &:active { + pointer-events: none; + } } }