Browse Source

feat: update some less

pull/3053/head
tangjinzhou 4 years ago
parent
commit
e165b1eced
  1. 8
      components/_util/transition.tsx
  2. 7
      components/badge/style/index.less
  3. 2
      components/form/FormItem.tsx
  4. 4
      components/style/themes/default.less
  5. 20
      components/table/__tests__/__snapshots__/demo.test.js.snap
  6. 4
      components/table/__tests__/__snapshots__/empty.test.js.snap

8
components/_util/transition.tsx

@ -46,7 +46,7 @@ let TransitionGroup = TG;
if (process.env.NODE_ENV === 'test') { if (process.env.NODE_ENV === 'test') {
Transition = (props, { slots }) => { Transition = (props, { slots }) => {
let child = slots.default?.()[0]; const child = slots.default?.()[0];
if (child && child.dirs && child.dirs[0]) { if (child && child.dirs && child.dirs[0]) {
const value = child.dirs[0].value; const value = child.dirs[0].value;
const oldValue = child.dirs[0].oldValue; const oldValue = child.dirs[0].oldValue;
@ -60,7 +60,7 @@ if (process.env.NODE_ENV === 'test') {
} }
return slots.default?.(); return slots.default?.();
}; };
Transition.displayName = 'TransitionForTest' Transition.displayName = 'TransitionForTest';
Transition.inheritAttrs = false; Transition.inheritAttrs = false;
TransitionGroup = defineComponent({ TransitionGroup = defineComponent({
name: 'TransitionGroupForTest', name: 'TransitionGroupForTest',
@ -70,8 +70,8 @@ if (process.env.NODE_ENV === 'test') {
const { tag: Tag, ...rest } = props; const { tag: Tag, ...rest } = props;
return () => { return () => {
const children = slots.default?.() || []; const children = slots.default?.() || [];
if(Tag) { if (Tag) {
return <Tag {...rest}>{children}</Tag> return <Tag {...rest}>{children}</Tag>;
} else { } else {
return children; return children;
} }

7
components/badge/style/index.less

@ -13,7 +13,6 @@
line-height: 1; line-height: 1;
&-count { &-count {
z-index: @zindex-badge;
min-width: @badge-height; min-width: @badge-height;
height: @badge-height; height: @badge-height;
padding: 0 6px; padding: 0 6px;
@ -37,7 +36,6 @@
} }
&-dot { &-dot {
z-index: @zindex-badge;
width: @badge-dot-size; width: @badge-dot-size;
height: @badge-dot-size; height: @badge-dot-size;
background: @highlight-color; background: @highlight-color;
@ -51,6 +49,7 @@
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
z-index: @zindex-badge;
transform: translate(50%, -50%); transform: translate(50%, -50%);
transform-origin: 100% 0%; transform-origin: 100% 0%;
} }
@ -114,10 +113,6 @@
} }
} }
&-dot-status {
line-height: 1;
}
&-zoom-appear, &-zoom-appear,
&-zoom-enter { &-zoom-enter {
animation: antZoomBadgeIn 0.3s @ease-out-back; animation: antZoomBadgeIn 0.3s @ease-out-back;

2
components/form/FormItem.tsx

@ -356,7 +356,7 @@ export default defineComponent({
let classes = `${prefixCls}-item-control`; let classes = `${prefixCls}-item-control`;
if (validateStatus) { if (validateStatus) {
classes = classNames(`${prefixCls}-item-control`, { classes = classNames(`${prefixCls}-item-control`, {
'has-feedback': this.hasFeedback || validateStatus === 'validating', 'has-feedback': validateStatus && this.hasFeedback,
'has-success': validateStatus === 'success', 'has-success': validateStatus === 'success',
'has-warning': validateStatus === 'warning', 'has-warning': validateStatus === 'warning',
'has-error': validateStatus === 'error', 'has-error': validateStatus === 'error',

4
components/style/themes/default.less

@ -265,8 +265,8 @@
@layout-trigger-color-light: @text-color; @layout-trigger-color-light: @text-color;
// z-index list, order by `z-index` // z-index list, order by `z-index`
@zindex-badge: auto; @zindex-badge: 1;
@zindex-table-fixed: auto; @zindex-table-fixed: 1;
@zindex-affix: 10; @zindex-affix: 10;
@zindex-back-top: 10; @zindex-back-top: 10;
@zindex-picker-panel: 10; @zindex-picker-panel: 10;

20
components/table/__tests__/__snapshots__/demo.test.js.snap

@ -1504,7 +1504,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns.md correctly 1`] = `
<!----> <!---->
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner"> <div class="ant-table-body-inner">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 200px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
@ -1551,7 +1551,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns.md correctly 1`] = `
<!----> <!---->
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner"> <div class="ant-table-body-inner">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 100px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
</colgroup> </colgroup>
@ -2151,7 +2151,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
</div> </div>
<div class="ant-table-fixed-left"> <div class="ant-table-fixed-left">
<div class="ant-table-header"> <div class="ant-table-header">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 200px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
@ -2173,7 +2173,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
</div> </div>
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner" style="max-height: 300px; overflow-y: scroll;"> <div class="ant-table-body-inner" style="max-height: 300px; overflow-y: scroll;">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 200px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
@ -2287,7 +2287,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
</div> </div>
<div class="ant-table-fixed-right"> <div class="ant-table-fixed-right">
<div class="ant-table-header"> <div class="ant-table-header">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 100px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
</colgroup> </colgroup>
@ -2304,7 +2304,7 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly
</div> </div>
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner" style="max-height: 300px; overflow-y: scroll;"> <div class="ant-table-body-inner" style="max-height: 300px; overflow-y: scroll;">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 100px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
</colgroup> </colgroup>
@ -3603,7 +3603,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
</div> </div>
<div class="ant-table-fixed-left"> <div class="ant-table-fixed-left">
<div class="ant-table-header"> <div class="ant-table-header">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 100px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
</colgroup> </colgroup>
@ -3620,7 +3620,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
</div> </div>
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner" style="max-height: 240px; overflow-y: scroll;"> <div class="ant-table-body-inner" style="max-height: 240px; overflow-y: scroll;">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 100px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
</colgroup> </colgroup>
@ -3693,7 +3693,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
</div> </div>
<div class="ant-table-fixed-right"> <div class="ant-table-fixed-right">
<div class="ant-table-header"> <div class="ant-table-header">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 80px;">
<colgroup> <colgroup>
<col style="width: 80px; min-width: 80px;"> <col style="width: 80px; min-width: 80px;">
</colgroup> </colgroup>
@ -3710,7 +3710,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
</div> </div>
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner" style="max-height: 240px; overflow-y: scroll;"> <div class="ant-table-body-inner" style="max-height: 240px; overflow-y: scroll;">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 80px;">
<colgroup> <colgroup>
<col style="width: 80px; min-width: 80px;"> <col style="width: 80px; min-width: 80px;">
</colgroup> </colgroup>

4
components/table/__tests__/__snapshots__/empty.test.js.snap

@ -245,7 +245,7 @@ exports[`Table renders empty table with fixed columns 1`] = `
<!----> <!---->
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner"> <div class="ant-table-body-inner">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 200px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
@ -271,7 +271,7 @@ exports[`Table renders empty table with fixed columns 1`] = `
<!----> <!---->
<div class="ant-table-body-outer"> <div class="ant-table-body-outer">
<div class="ant-table-body-inner"> <div class="ant-table-body-inner">
<table class="ant-table-fixed"> <table class="ant-table-fixed" style="width: 100px;">
<colgroup> <colgroup>
<col style="width: 100px; min-width: 100px;"> <col style="width: 100px; min-width: 100px;">
</colgroup> </colgroup>

Loading…
Cancel
Save