diff --git a/antdv-demo b/antdv-demo index ef8278395..0520bc64c 160000 --- a/antdv-demo +++ b/antdv-demo @@ -1 +1 @@ -Subproject commit ef827839524b6f1ed427aefa082adb09ac2cc95f +Subproject commit 0520bc64ceb1fa83ad4b614ea9bb2d46708e2d96 diff --git a/components/affix/__tests__/__snapshots__/demo.test.js.snap b/components/affix/__tests__/__snapshots__/demo.test.js.snap index 62bfb421b..d30eca0d8 100644 --- a/components/affix/__tests__/__snapshots__/demo.test.js.snap +++ b/components/affix/__tests__/__snapshots__/demo.test.js.snap @@ -1,8 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./antdv-demo/docs/affix/demo/basic.md correctly 1`] = ` -
-

@@ -14,8 +14,8 @@ exports[`renders ./antdv-demo/docs/affix/demo/basic.md correctly 1`] = ` `; exports[`renders ./antdv-demo/docs/affix/demo/on-change.md correctly 1`] = ` -
-
diff --git a/components/collapse/__tests__/__snapshots__/demo.test.js.snap b/components/collapse/__tests__/__snapshots__/demo.test.js.snap index ffd164b9b..5b8b8dae6 100644 --- a/components/collapse/__tests__/__snapshots__/demo.test.js.snap +++ b/components/collapse/__tests__/__snapshots__/demo.test.js.snap @@ -109,7 +109,7 @@ exports[`renders ./antdv-demo/docs/collapse/demo/extra.md correctly 1`] = `
This is panel header 1
-
+

A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.

diff --git a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap index 5aa1225b8..fd875104c 100644 --- a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap +++ b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap @@ -140,9 +140,9 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/size.md correctly 1`] = `
Custom Size
-
- -
+
@@ -182,9 +182,9 @@ exports[`renders ./antdv-demo/docs/descriptions/demo/size.md correctly 1`] = `
Custom Size
-
- -
+
diff --git a/components/icon/__tests__/__snapshots__/demo.test.js.snap b/components/icon/__tests__/__snapshots__/demo.test.js.snap index 9c16035e7..ed0eb1e72 100644 --- a/components/icon/__tests__/__snapshots__/demo.test.js.snap +++ b/components/icon/__tests__/__snapshots__/demo.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders ./antdv-demo/docs/icon/demo/basic.md correctly 1`] = `
`; +exports[`renders ./antdv-demo/docs/icon/demo/basic.md correctly 1`] = `
`; exports[`renders ./antdv-demo/docs/icon/demo/iconfont.md correctly 1`] = `
`; diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index c683ae6fb..1b6d0a1fc 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -23,8 +23,8 @@ exports[`renders ./antdv-demo/docs/input/demo/allowClear.md correctly 1`] = ` `; exports[`renders ./antdv-demo/docs/input/demo/autosize-textarea.md correctly 1`] = ` -
-
+
+
`; diff --git a/components/layout/__tests__/__snapshots__/demo.test.js.snap b/components/layout/__tests__/__snapshots__/demo.test.js.snap index de46e160b..6e21a515b 100644 --- a/components/layout/__tests__/__snapshots__/demo.test.js.snap +++ b/components/layout/__tests__/__snapshots__/demo.test.js.snap @@ -80,8 +80,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/fixed.md correctly 1`] = ` @@ -91,8 +90,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/fixed.md correctly 1`] = ` @@ -102,8 +100,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/fixed.md correctly 1`] = ` @@ -113,8 +110,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/fixed.md correctly 1`] = ` @@ -230,34 +226,12 @@ exports[`renders ./antdv-demo/docs/layout/demo/side.md correctly 1`] = ` @@ -287,8 +261,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top.md correctly 1`] = ` @@ -298,8 +271,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top.md correctly 1`] = ` @@ -309,8 +281,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top.md correctly 1`] = ` @@ -320,8 +291,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top.md correctly 1`] = ` @@ -342,8 +312,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side.md correctly 1`] = ` @@ -353,8 +322,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side.md correctly 1`] = ` @@ -364,8 +332,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side.md correctly 1`] = ` @@ -375,8 +342,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side.md correctly 1`] = ` @@ -411,46 +377,12 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side.md correctly 1`] = ` @@ -472,8 +404,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side-2.md correctly 1`] = ` @@ -483,8 +414,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side-2.md correctly 1`] = ` @@ -494,8 +424,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side-2.md correctly 1`] = ` @@ -505,8 +434,7 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side-2.md correctly 1`] = ` @@ -539,46 +467,12 @@ exports[`renders ./antdv-demo/docs/layout/demo/top-side-2.md correctly 1`] = ` diff --git a/components/tag/__tests__/__snapshots__/demo.test.js.snap b/components/tag/__tests__/__snapshots__/demo.test.js.snap index 09047fa92..0c55692cb 100644 --- a/components/tag/__tests__/__snapshots__/demo.test.js.snap +++ b/components/tag/__tests__/__snapshots__/demo.test.js.snap @@ -26,7 +26,15 @@ exports[`renders ./antdv-demo/docs/tag/demo/controlled.md correctly 1`] = `
`; -exports[`renders ./antdv-demo/docs/tag/demo/hot-tags.md correctly 1`] = `
Categories:MoviesBooksMusicSports
`; +exports[`renders ./antdv-demo/docs/tag/demo/hot-tags.md correctly 1`] = `
Categories:MoviesBooksMusicSports
`; + +exports[`renders ./antdv-demo/docs/tag/demo/icon.md correctly 1`] = ` + Twitter + Youtube + Facebook + LinkedIn + +`; exports[`renders ./antdv-demo/docs/tag/demo/status.md correctly 1`] = ` diff --git a/components/vc-collapse/src/Panel.jsx b/components/vc-collapse/src/Panel.jsx index 157e008f2..cb7ffd4aa 100644 --- a/components/vc-collapse/src/Panel.jsx +++ b/components/vc-collapse/src/Panel.jsx @@ -1,8 +1,9 @@ import PanelContent from './PanelContent'; import { initDefaultProps, getComponent, getSlot } from '../../_util/props-util'; import { panelProps } from './commonProps'; -import { defineComponent, Transition } from 'vue'; +import { defineComponent } from 'vue'; import BaseMixin from '../../_util/BaseMixin'; +import Transition from '../../_util/transition'; export default defineComponent({ name: 'Panel', diff --git a/components/vc-select/SelectTrigger.tsx b/components/vc-select/SelectTrigger.tsx index d418e3971..bd148f981 100644 --- a/components/vc-select/SelectTrigger.tsx +++ b/components/vc-select/SelectTrigger.tsx @@ -5,6 +5,7 @@ import classNames from '../_util/classNames'; import createRef from '../_util/createRef'; import { CSSProperties, defineComponent, VNodeChild } from 'vue'; import { RenderDOMFunc } from './interface'; +import { DropdownRender } from './interface/generator'; const getBuiltInPlacements = (dropdownMatchSelectWidth: number | boolean) => { // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided @@ -57,7 +58,7 @@ export interface SelectTriggerProps { dropdownClassName: string; direction: string; dropdownMatchSelectWidth?: boolean | number; - dropdownRender?: (menu: VNodeChild | JSX.Element) => VNodeChild; + dropdownRender?: DropdownRender; getPopupContainer?: RenderDOMFunc; dropdownAlign: object; empty: boolean; diff --git a/components/vc-select/generate.tsx b/components/vc-select/generate.tsx index 8fc5d4e05..abefb8159 100644 --- a/components/vc-select/generate.tsx +++ b/components/vc-select/generate.tsx @@ -27,6 +27,7 @@ import { INTERNAL_PROPS_MARK, SelectSource, CustomTagProps, + DropdownRender, } from './interface/generator'; import { OptionListProps } from './OptionList'; import { toInnerValue, toOuterValues, removeLastEnabledValue, getUUID } from './utils/commonUtil'; @@ -216,7 +217,7 @@ export interface SelectProps { dropdownClassName?: string; dropdownMatchSelectWidth?: boolean | number; virtual?: boolean; - dropdownRender?: (menu: VNodeChild | JSX.Element) => VNodeChild; + dropdownRender?: DropdownRender; dropdownAlign?: any; animation?: string; transitionName?: string; diff --git a/components/vc-select/interface/generator.ts b/components/vc-select/interface/generator.ts index 62e4548f5..165a726a2 100644 --- a/components/vc-select/interface/generator.ts +++ b/components/vc-select/interface/generator.ts @@ -1,3 +1,4 @@ +import { VueNode } from '../../_util/type'; import { VNodeChild } from 'vue'; export type SelectSource = 'option' | 'selection' | 'input'; @@ -61,3 +62,10 @@ export type FlattenOptionsType = { /** Used for customize data */ [name: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any }[]; + +export type DropdownObject = { + menuNode?: VueNode; + props?: Record; +}; + +export type DropdownRender = (opt?: DropdownObject) => VueNode; diff --git a/examples/App.vue b/examples/App.vue index 2a473db44..bdac98add 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -1,30 +1,39 @@ diff --git a/tests/shared/demoTest.js b/tests/shared/demoTest.js index 3a0f7dc60..1327c90ab 100644 --- a/tests/shared/demoTest.js +++ b/tests/shared/demoTest.js @@ -19,7 +19,7 @@ export default function demoTest(component, options = {}) { const demo = require(`../.${file}`).default || require(`../.${file}`); document.body.innerHTML = ''; const wrapper = mount(demo, { global: { plugins: [antd] }, attachTo: document.body }); - await sleep(); + await sleep(100); // should get dom from element // snap files copy from antd does not need to change // or just change a little