4
diff --git a/components/carousel/index.jsx b/components/carousel/index.jsx
index 22b87d849..bf63b4738 100644
--- a/components/carousel/index.jsx
+++ b/components/carousel/index.jsx
@@ -5,26 +5,7 @@ import hasProp, { initDefaultProps, getComponent } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider';
import warning from '../_util/warning';
import classNames from 'classnames';
-
-// matchMedia polyfill for
-// https://github.com/WickyNilliams/enquire.js/issues/82
-if (typeof window !== 'undefined') {
- const matchMediaPolyfill = mediaQuery => {
- return {
- media: mediaQuery,
- matches: false,
- addListener() {},
- removeListener() {},
- };
- };
- // ref: https://github.com/ant-design/ant-design/issues/18774
- if (!window.matchMedia) window.matchMedia = matchMediaPolyfill;
-}
-// Use require over import (will be lifted up)
-// make sure matchMedia polyfill run before require('vc-slick')
-// Fix https://github.com/ant-design/ant-design/issues/6560
-// Fix https://github.com/ant-design/ant-design/issues/3308
-const SlickCarousel = require('../vc-slick/src').default;
+import SlickCarousel from '../vc-slick/src';
export const CarouselEffect = PropTypes.oneOf(['scrollx', 'fade']);
// Carousel
diff --git a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap
index 7ac0fae17..1394b7394 100644
--- a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap
@@ -8,12 +8,18 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/basic.md correctly 1`] = `
UserName Zhou Maomao |
+
+
Telephone 1810000000 |
+
+
Live Hangzhou, Zhejiang |
Remark empty |
- Address No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China |
+
+
+ Address No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China |
@@ -30,14 +36,20 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/border.md correctly 1`] = `
Product |
Cloud Database |
+
+
Billing Mode |
Prepaid |
+
+
Automatic Renewal |
YES |
Order time |
2018-04-24 18:00:00 |
+
+
Usage Time |
2019-04-24 18:00:00 |
@@ -48,14 +60,18 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/border.md correctly 1`] = `
Negotiated Amount |
$80.00 |
+
+
Discount |
$20.00 |
+
+
Official Receipts |
$60.00 |
Config Info |
- Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1
|
+ Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1
|
@@ -72,22 +88,30 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/responsive.md correctly 1`]
Product |
Cloud Database |
+
+
Billing |
Prepaid |
+
+
Time |
18:00:00 |
Amount |
$80.00 |
+
+
Discount |
$20.00 |
+
+
Official |
$60.00 |
Config Info |
- Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1 |
+ Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1 |
@@ -106,22 +130,30 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/size.md correctly 1`] = `
Product |
Cloud Database |
+
+
Billing |
Prepaid |
+
+
Time |
18:00:00 |
Amount |
$80.00 |
+
+
Discount |
$20.00 |
+
+
Official |
$60.00 |
Config Info |
- Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1
|
+ Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1
|
@@ -134,12 +166,20 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/size.md correctly 1`] = `
Product Cloud Database |
+
+
Billing Prepaid |
+
+
Time 18:00:00 |
Amount $80.00 |
+
+
Discount $20.00 |
+
+
Official $60.00 |
@@ -157,20 +197,32 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/vertical.md correctly 1`] =
UserName |
- Telephone |
- Live |
Zhou Maomao |
+
+
+ Telephone |
+
+
1810000000 |
+
+
+ Live |
+
+
Hangzhou, Zhejiang |
Address |
- Remark |
No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China |
+
+
+ Remark |
+
+
empty |
@@ -187,20 +239,32 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/vertical-border.md correctl
Product |
- Billing Mode |
- Automatic Renewal |
Cloud Database |
+
+
+ Billing Mode |
+
+
Prepaid |
+
+
+ Automatic Renewal |
+
+
YES |
Order time |
- Usage Time |
2018-04-24 18:00:00 |
+
+
+ Usage Time |
+
+
2019-04-24 18:00:00 |
@@ -211,19 +275,27 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/vertical-border.md correctl
Negotiated Amount |
- Discount |
- Official Receipts |
$80.00 |
+
+
+ Discount |
+
+
$20.00 |
+
+
+ Official Receipts |
+
+
$60.00 |
- Config Info |
+ Config Info |
- Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1
|
+ Data disk type: MongoDB Database version: 3.4 Package: dds.mongo.mid Storage space: 10 GB Replication factor: 3 Region: East China 1
|
diff --git a/components/descriptions/__tests__/index.test.js b/components/descriptions/__tests__/index.test.js
index 676685d6c..c80c51528 100644
--- a/components/descriptions/__tests__/index.test.js
+++ b/components/descriptions/__tests__/index.test.js
@@ -4,24 +4,6 @@ import Descriptions from '..';
import { resetWarned } from '../../_util/warning';
import { asyncExpect } from '@/tests/utils';
-jest.mock('enquire.js', () => {
- let that;
- let unmatchFun;
- return {
- unregister: jest.fn(),
- register: (media, options) => {
- if (media === '(max-width: 575px)') {
- that = this;
- options.match.call(that);
- unmatchFun = options.unmatch;
- }
- },
- callunmatch() {
- unmatchFun.call(that);
- },
- };
-});
-
describe('Descriptions', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
@@ -176,7 +158,6 @@ describe('Descriptions', () => {
it('when max-width: 575px,column=1', async () => {
// eslint-disable-next-line global-require
- const enquire = require('enquire.js');
const wrapper = mount(
{
render() {
@@ -198,13 +179,10 @@ describe('Descriptions', () => {
expect(wrapper.findAll('.ant-descriptions-item-no-label')).toHaveLength(1);
});
- enquire.callunmatch();
wrapper.unmount();
});
it('when max-width: 575px,column=2', async () => {
- // eslint-disable-next-line global-require
- const enquire = require('enquire.js');
const wrapper = mount(
{
render() {
@@ -222,8 +200,6 @@ describe('Descriptions', () => {
);
await asyncExpect(() => {});
expect(wrapper.findAll('tr')).toHaveLength(2);
-
- enquire.callunmatch();
wrapper.unmount();
});
});
diff --git a/components/layout/Sider.jsx b/components/layout/Sider.jsx
index 42c179fe1..6099a34f1 100644
--- a/components/layout/Sider.jsx
+++ b/components/layout/Sider.jsx
@@ -16,20 +16,6 @@ import RightOutlined from '@ant-design/icons-vue/RightOutlined';
import LeftOutlined from '@ant-design/icons-vue/LeftOutlined';
import omit from 'omit.js';
-// matchMedia polyfill for
-// https://github.com/WickyNilliams/enquire.js/issues/82
-if (typeof window !== 'undefined') {
- const matchMediaPolyfill = mediaQuery => {
- return {
- media: mediaQuery,
- matches: false,
- addListener() {},
- removeListener() {},
- };
- };
- window.matchMedia = window.matchMedia || matchMediaPolyfill;
-}
-
const dimensionMaxMap = {
xs: '479.98px',
sm: '575.98px',
diff --git a/components/layout/__tests__/__snapshots__/demo.test.js.snap b/components/layout/__tests__/__snapshots__/demo.test.js.snap
index ea7ca60c5..4ad41417c 100644
--- a/components/layout/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/layout/__tests__/__snapshots__/demo.test.js.snap
@@ -356,7 +356,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side.md correctly 1`] = `