From e165b1ecedd320068a758b4678110218e1dbbd19 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 27 Oct 2020 23:02:45 +0800 Subject: [PATCH] feat: update some less --- components/_util/transition.tsx | 8 ++++---- components/badge/style/index.less | 7 +------ components/form/FormItem.tsx | 2 +- components/style/themes/default.less | 4 ++-- .../__tests__/__snapshots__/demo.test.js.snap | 20 +++++++++---------- .../__snapshots__/empty.test.js.snap | 4 ++-- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/components/_util/transition.tsx b/components/_util/transition.tsx index d3534fd0f..feeff5ff5 100644 --- a/components/_util/transition.tsx +++ b/components/_util/transition.tsx @@ -46,7 +46,7 @@ let TransitionGroup = TG; if (process.env.NODE_ENV === 'test') { Transition = (props, { slots }) => { - let child = slots.default?.()[0]; + const child = slots.default?.()[0]; if (child && child.dirs && child.dirs[0]) { const value = child.dirs[0].value; const oldValue = child.dirs[0].oldValue; @@ -60,7 +60,7 @@ if (process.env.NODE_ENV === 'test') { } return slots.default?.(); }; - Transition.displayName = 'TransitionForTest' + Transition.displayName = 'TransitionForTest'; Transition.inheritAttrs = false; TransitionGroup = defineComponent({ name: 'TransitionGroupForTest', @@ -70,8 +70,8 @@ if (process.env.NODE_ENV === 'test') { const { tag: Tag, ...rest } = props; return () => { const children = slots.default?.() || []; - if(Tag) { - return {children} + if (Tag) { + return {children}; } else { return children; } diff --git a/components/badge/style/index.less b/components/badge/style/index.less index 896e2b014..1e33c6083 100644 --- a/components/badge/style/index.less +++ b/components/badge/style/index.less @@ -13,7 +13,6 @@ line-height: 1; &-count { - z-index: @zindex-badge; min-width: @badge-height; height: @badge-height; padding: 0 6px; @@ -37,7 +36,6 @@ } &-dot { - z-index: @zindex-badge; width: @badge-dot-size; height: @badge-dot-size; background: @highlight-color; @@ -51,6 +49,7 @@ position: absolute; top: 0; right: 0; + z-index: @zindex-badge; transform: translate(50%, -50%); transform-origin: 100% 0%; } @@ -114,10 +113,6 @@ } } - &-dot-status { - line-height: 1; - } - &-zoom-appear, &-zoom-enter { animation: antZoomBadgeIn 0.3s @ease-out-back; diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 12a8622dc..e734f58e2 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -356,7 +356,7 @@ export default defineComponent({ let classes = `${prefixCls}-item-control`; if (validateStatus) { classes = classNames(`${prefixCls}-item-control`, { - 'has-feedback': this.hasFeedback || validateStatus === 'validating', + 'has-feedback': validateStatus && this.hasFeedback, 'has-success': validateStatus === 'success', 'has-warning': validateStatus === 'warning', 'has-error': validateStatus === 'error', diff --git a/components/style/themes/default.less b/components/style/themes/default.less index dde5c7c8a..eb41ef527 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -265,8 +265,8 @@ @layout-trigger-color-light: @text-color; // z-index list, order by `z-index` -@zindex-badge: auto; -@zindex-table-fixed: auto; +@zindex-badge: 1; +@zindex-table-fixed: 1; @zindex-affix: 10; @zindex-back-top: 10; @zindex-picker-panel: 10; diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index ab8fdd083..f4e809e83 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -1504,7 +1504,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns.md correctly 1`] = `
- +
@@ -1551,7 +1551,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns.md correctly 1`] = `
-
+
@@ -2151,7 +2151,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
-
+
@@ -2173,7 +2173,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
-
+
@@ -2287,7 +2287,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
-
+
@@ -2304,7 +2304,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
-
+
@@ -3603,7 +3603,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
-
+
@@ -3620,7 +3620,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
-
+
@@ -3693,7 +3693,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
-
+
@@ -3710,7 +3710,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
-
+
diff --git a/components/table/__tests__/__snapshots__/empty.test.js.snap b/components/table/__tests__/__snapshots__/empty.test.js.snap index d9751d971..5d8b6612f 100644 --- a/components/table/__tests__/__snapshots__/empty.test.js.snap +++ b/components/table/__tests__/__snapshots__/empty.test.js.snap @@ -245,7 +245,7 @@ exports[`Table renders empty table with fixed columns 1`] = `
-
+
@@ -271,7 +271,7 @@ exports[`Table renders empty table with fixed columns 1`] = `
-
+