From 99c16aa8d6cf5c3c620c23322ff9b778ed052d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Mon, 30 May 2022 19:06:51 +0800 Subject: [PATCH] refactor: Fix Dropdown nesting menu injection logic (#35810) * refactor: Dependency Inversion * test: update snapshot * test: Update snapshot * test: more * fix: table dropdown logic * fix: menu lint --- .../__snapshots__/demo-extend.test.ts.snap | 1 - .../__snapshots__/demo-extend.test.ts.snap | 1 - .../__snapshots__/demo-extend.test.ts.snap | 2 - .../__snapshots__/components.test.js.snap | 182 ++++++++++++++++-- .../__snapshots__/demo-extend.test.ts.snap | 35 ---- components/dropdown/dropdown.tsx | 94 +++++---- components/dropdown/style/index.tsx | 1 + .../__snapshots__/demo-extend.test.ts.snap | 2 - components/menu/OverrideContext.ts | 16 ++ components/menu/index.tsx | 70 ++++--- .../__snapshots__/demo-extend.test.ts.snap | 2 - .../Table.rowSelection.test.js.snap | 2 - .../__snapshots__/demo-extend.test.ts.snap | 27 ++- .../table/hooks/useFilter/FilterDropdown.tsx | 1 + .../__snapshots__/demo-extend.test.ts.snap | 18 -- .../__snapshots__/demo-extend.test.ts.snap | 20 -- package.json | 4 +- 17 files changed, 294 insertions(+), 184 deletions(-) create mode 100644 components/menu/OverrideContext.ts diff --git a/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap index 94b3e71de7..c5710ef962 100644 --- a/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -138,7 +138,6 @@ exports[`renders ./components/breadcrumb/demo/overlay.md extend context correctl > @@ -27398,9 +27438,29 @@ exports[`ConfigProvider components Table configProvider componentSize large 1`] > Submenu - + + + + + @@ -27679,9 +27739,29 @@ exports[`ConfigProvider components Table configProvider componentSize middle 1`] > Submenu - + + + + + @@ -27960,9 +28040,29 @@ exports[`ConfigProvider components Table configProvider virtual and dropdownMatc > Submenu - + + + + + @@ -28241,9 +28341,29 @@ exports[`ConfigProvider components Table normal 1`] = ` > Submenu - + + + + + @@ -28522,9 +28642,29 @@ exports[`ConfigProvider components Table prefixCls 1`] = ` > Submenu - + + + + + diff --git a/components/dropdown/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/dropdown/__tests__/__snapshots__/demo-extend.test.ts.snap index 34d698b919..91b94d2bdd 100644 --- a/components/dropdown/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/dropdown/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -20,7 +20,6 @@ Array [ />