From 8fb97df92c789ba48500a14ef5fc1b369e28b8db Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 25 May 2023 19:26:47 +0800 Subject: [PATCH] feat: Pagination size change select component is searchable (#42608) * feat: Paginaition size change select enable search close https://github.com/ant-design/ant-design/issues/27684 * test: update snapshot * test: update snapshot --- .../__snapshots__/components.test.tsx.snap | 70 +--- .../__snapshots__/pagination.test.tsx.snap | 23 +- .../__snapshots__/index.test.tsx.snap | 345 ++++-------------- components/pagination/Select.tsx | 4 +- .../__snapshots__/demo-extend.test.ts.snap | 65 +--- .../__tests__/__snapshots__/demo.test.ts.snap | 65 +--- .../__snapshots__/index.test.tsx.snap | 5 +- .../__snapshots__/demo-extend.test.ts.snap | 30 +- .../__tests__/__snapshots__/demo.test.ts.snap | 30 +- 9 files changed, 131 insertions(+), 506 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap index e57fe8327e..e4de3939da 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap @@ -18988,7 +18988,7 @@ exports[`ConfigProvider components Pagination configProvider 1`] = ` >
@@ -19134,7 +19131,7 @@ exports[`ConfigProvider components Pagination configProvider 1`] = ` >
@@ -19285,7 +19279,7 @@ exports[`ConfigProvider components Pagination configProvider componentDisabled 1 >
@@ -19432,7 +19423,7 @@ exports[`ConfigProvider components Pagination configProvider componentDisabled 1 >
@@ -19584,7 +19572,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize large >
@@ -19730,7 +19715,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize large >
@@ -19881,7 +19863,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl >
@@ -20027,7 +20006,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl >
@@ -20178,7 +20154,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize small >
@@ -20324,7 +20297,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize small >
@@ -20475,7 +20445,7 @@ exports[`ConfigProvider components Pagination normal 1`] = ` >
@@ -20621,7 +20588,7 @@ exports[`ConfigProvider components Pagination normal 1`] = ` >
@@ -20772,7 +20736,7 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = ` >
@@ -20918,7 +20879,7 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = ` >
diff --git a/components/list/__tests__/__snapshots__/pagination.test.tsx.snap b/components/list/__tests__/__snapshots__/pagination.test.tsx.snap index 5a8834458f..7b3705a2db 100644 --- a/components/list/__tests__/__snapshots__/pagination.test.tsx.snap +++ b/components/list/__tests__/__snapshots__/pagination.test.tsx.snap @@ -300,7 +300,7 @@ exports[`List.pagination should change page size work 1`] = ` >
@@ -449,7 +446,7 @@ exports[`List.pagination should change page size work 2`] = ` >
@@ -592,13 +586,13 @@ exports[`List.pagination should change page size work 2`] = ` unselectable="on" > @@ -711,7 +705,7 @@ exports[`List.pagination should default work 1`] = ` >
diff --git a/components/locale/__tests__/__snapshots__/index.test.tsx.snap b/components/locale/__tests__/__snapshots__/index.test.tsx.snap index 3043367cce..3ec50b3f18 100644 --- a/components/locale/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/locale/__tests__/__snapshots__/index.test.tsx.snap @@ -2001,7 +2001,7 @@ exports[`Locale Provider should display the text as ar 1`] = ` >
@@ -7114,7 +7111,7 @@ exports[`Locale Provider should display the text as az 1`] = ` >
@@ -12227,7 +12221,7 @@ exports[`Locale Provider should display the text as bg 1`] = ` >
@@ -17340,7 +17331,7 @@ exports[`Locale Provider should display the text as bn-bd 1`] = ` >
@@ -22453,7 +22441,7 @@ exports[`Locale Provider should display the text as by 1`] = ` >
@@ -27566,7 +27551,7 @@ exports[`Locale Provider should display the text as ca 1`] = ` >
@@ -32679,7 +32661,7 @@ exports[`Locale Provider should display the text as cs 1`] = ` >
@@ -37792,7 +37771,7 @@ exports[`Locale Provider should display the text as da 1`] = ` >
@@ -42905,7 +42881,7 @@ exports[`Locale Provider should display the text as de 1`] = ` >
@@ -48018,7 +47991,7 @@ exports[`Locale Provider should display the text as el 1`] = ` >
@@ -53131,7 +53101,7 @@ exports[`Locale Provider should display the text as en 1`] = ` >
@@ -58244,7 +58211,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` >
@@ -63357,7 +63321,7 @@ exports[`Locale Provider should display the text as es 1`] = ` >
@@ -68470,7 +68431,7 @@ exports[`Locale Provider should display the text as et 1`] = ` >
@@ -73583,7 +73541,7 @@ exports[`Locale Provider should display the text as eu 1`] = ` >
@@ -78696,7 +78651,7 @@ exports[`Locale Provider should display the text as fa 1`] = ` >
@@ -83809,7 +83761,7 @@ exports[`Locale Provider should display the text as fi 1`] = ` >
@@ -88922,7 +88871,7 @@ exports[`Locale Provider should display the text as fr 1`] = ` >
@@ -94035,7 +93981,7 @@ exports[`Locale Provider should display the text as fr 2`] = ` >
@@ -99148,7 +99091,7 @@ exports[`Locale Provider should display the text as fr 3`] = ` >
@@ -104261,7 +104201,7 @@ exports[`Locale Provider should display the text as ga 1`] = ` >
@@ -109374,7 +109311,7 @@ exports[`Locale Provider should display the text as gl 1`] = ` >
@@ -114487,7 +114421,7 @@ exports[`Locale Provider should display the text as he 1`] = ` >
@@ -119600,7 +119531,7 @@ exports[`Locale Provider should display the text as hi 1`] = ` >
@@ -124713,7 +124641,7 @@ exports[`Locale Provider should display the text as hr 1`] = ` >
@@ -129826,7 +129751,7 @@ exports[`Locale Provider should display the text as hu 1`] = ` >
@@ -134939,7 +134861,7 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` >
@@ -140052,7 +139971,7 @@ exports[`Locale Provider should display the text as id 1`] = ` >
@@ -145165,7 +145081,7 @@ exports[`Locale Provider should display the text as is 1`] = ` >
@@ -150278,7 +150191,7 @@ exports[`Locale Provider should display the text as it 1`] = ` >
@@ -155391,7 +155301,7 @@ exports[`Locale Provider should display the text as ja 1`] = ` >
@@ -160504,7 +160411,7 @@ exports[`Locale Provider should display the text as ka 1`] = ` >
@@ -165617,7 +165521,7 @@ exports[`Locale Provider should display the text as kk 1`] = ` >
@@ -170730,7 +170631,7 @@ exports[`Locale Provider should display the text as km 1`] = ` >
@@ -175841,7 +175739,7 @@ exports[`Locale Provider should display the text as kn 1`] = ` >
@@ -180954,7 +180849,7 @@ exports[`Locale Provider should display the text as ko 1`] = ` >
@@ -186067,7 +185959,7 @@ exports[`Locale Provider should display the text as ku 1`] = ` >
@@ -191180,7 +191069,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` >
@@ -196293,7 +196179,7 @@ exports[`Locale Provider should display the text as lt 1`] = ` >
@@ -201406,7 +201289,7 @@ exports[`Locale Provider should display the text as lv 1`] = ` >
@@ -206519,7 +206399,7 @@ exports[`Locale Provider should display the text as mk 1`] = ` >
@@ -211632,7 +211509,7 @@ exports[`Locale Provider should display the text as ml 1`] = ` >
@@ -216745,7 +216619,7 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` >
@@ -221858,7 +221729,7 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` >
@@ -226971,7 +226839,7 @@ exports[`Locale Provider should display the text as my 1`] = ` >
@@ -232084,7 +231949,7 @@ exports[`Locale Provider should display the text as nb 1`] = ` >
@@ -237197,7 +237059,7 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` >
@@ -242310,7 +242169,7 @@ exports[`Locale Provider should display the text as nl 1`] = ` >
@@ -247423,7 +247279,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` >
@@ -252536,7 +252389,7 @@ exports[`Locale Provider should display the text as pl 1`] = ` >
@@ -257649,7 +257499,7 @@ exports[`Locale Provider should display the text as pt 1`] = ` >
@@ -262762,7 +262609,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` >
@@ -267875,7 +267719,7 @@ exports[`Locale Provider should display the text as ro 1`] = ` >
@@ -272988,7 +272829,7 @@ exports[`Locale Provider should display the text as ru 1`] = ` >
@@ -278101,7 +277939,7 @@ exports[`Locale Provider should display the text as si 1`] = ` >
@@ -283214,7 +283049,7 @@ exports[`Locale Provider should display the text as sk 1`] = ` >
@@ -288327,7 +288159,7 @@ exports[`Locale Provider should display the text as sl 1`] = ` >
@@ -293440,7 +293269,7 @@ exports[`Locale Provider should display the text as sr 1`] = ` >
@@ -298553,7 +298379,7 @@ exports[`Locale Provider should display the text as sv 1`] = ` >
@@ -303666,7 +303489,7 @@ exports[`Locale Provider should display the text as ta 1`] = ` >
@@ -308779,7 +308599,7 @@ exports[`Locale Provider should display the text as th 1`] = ` >
@@ -313892,7 +313709,7 @@ exports[`Locale Provider should display the text as tk 1`] = ` >
@@ -319005,7 +318819,7 @@ exports[`Locale Provider should display the text as tr 1`] = ` >
@@ -324118,7 +323929,7 @@ exports[`Locale Provider should display the text as uk 1`] = ` >
@@ -329231,7 +329039,7 @@ exports[`Locale Provider should display the text as ur 1`] = ` >
@@ -334344,7 +334149,7 @@ exports[`Locale Provider should display the text as vi 1`] = ` >
@@ -339457,7 +339259,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` >
@@ -344570,7 +344369,7 @@ exports[`Locale Provider should display the text as zh-hk 1`] = ` >
@@ -349683,7 +349479,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` >
diff --git a/components/pagination/Select.tsx b/components/pagination/Select.tsx index b0cec749a2..49fc5c8342 100644 --- a/components/pagination/Select.tsx +++ b/components/pagination/Select.tsx @@ -6,8 +6,8 @@ type CompoundedComponent = React.FC & { Option: typeof Select.Option; }; -const MiniSelect: CompoundedComponent = (props) => ; +const MiniSelect: CompoundedComponent = (props) => ; MiniSelect.Option = Select.Option; MiddleSelect.Option = Select.Option; diff --git a/components/pagination/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/pagination/__tests__/__snapshots__/demo-extend.test.ts.snap index 8672c18ed4..a8e577bd1f 100644 --- a/components/pagination/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/pagination/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -182,7 +182,7 @@ exports[`renders components/pagination/demo/all.tsx extend context correctly 1`] >
@@ -664,7 +661,7 @@ Array [ >
@@ -1006,7 +1000,7 @@ Array [ >
@@ -1435,7 +1426,7 @@ exports[`renders components/pagination/demo/itemRender.tsx extend context correc >
@@ -1780,7 +1768,7 @@ Array [ >
@@ -2133,7 +2118,7 @@ Array [ >
@@ -2566,7 +2548,7 @@ Array [ >
@@ -3002,7 +2981,7 @@ Array [ >
@@ -3409,7 +3385,7 @@ exports[`renders components/pagination/demo/more.tsx extend context correctly 1` >
@@ -3885,7 +3858,7 @@ Array [ >
@@ -4183,7 +4153,7 @@ Array [ >
@@ -4529,7 +4496,7 @@ Array [ >
@@ -4871,7 +4835,7 @@ Array [ >
diff --git a/components/pagination/__tests__/__snapshots__/demo.test.ts.snap b/components/pagination/__tests__/__snapshots__/demo.test.ts.snap index 658b878889..641725b3a7 100644 --- a/components/pagination/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/pagination/__tests__/__snapshots__/demo.test.ts.snap @@ -182,7 +182,7 @@ exports[`renders components/pagination/demo/all.tsx correctly 1`] = ` >
@@ -561,7 +558,7 @@ Array [ >
@@ -800,7 +794,7 @@ Array [ >
@@ -1126,7 +1117,7 @@ exports[`renders components/pagination/demo/itemRender.tsx correctly 1`] = ` >
@@ -1368,7 +1356,7 @@ Array [ >
@@ -1618,7 +1603,7 @@ Array [ >
@@ -1948,7 +1930,7 @@ Array [ >
@@ -2281,7 +2260,7 @@ Array [ >
@@ -2585,7 +2561,7 @@ exports[`renders components/pagination/demo/more.tsx correctly 1`] = ` >
@@ -2958,7 +2931,7 @@ Array [ >
@@ -3153,7 +3123,7 @@ Array [ >
@@ -3396,7 +3363,7 @@ Array [ >
@@ -3635,7 +3599,7 @@ Array [ >
diff --git a/components/pagination/__tests__/__snapshots__/index.test.tsx.snap b/components/pagination/__tests__/__snapshots__/index.test.tsx.snap index ab209e897f..df558c2d9c 100644 --- a/components/pagination/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/pagination/__tests__/__snapshots__/index.test.tsx.snap @@ -254,7 +254,7 @@ exports[`Pagination ConfigProvider should be rendered correctly when componentSi >
diff --git a/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap index 29bc1af82f..5b055df0d3 100644 --- a/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/table/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -5591,7 +5591,7 @@ exports[`renders components/table/demo/edit-row.tsx extend context correctly 1`] >
@@ -10231,7 +10228,7 @@ exports[`renders components/table/demo/fixed-columns-header.tsx extend context c >
@@ -11598,7 +11592,7 @@ exports[`renders components/table/demo/fixed-header.tsx extend context correctly >
@@ -12922,7 +12913,7 @@ exports[`renders components/table/demo/grouping-columns.tsx extend context corre >
@@ -15336,7 +15324,7 @@ exports[`renders components/table/demo/narrow.tsx extend context correctly 1`] = >
@@ -27838,7 +27823,7 @@ exports[`renders components/table/demo/sticky.tsx extend context correctly 1`] = >
diff --git a/components/table/__tests__/__snapshots__/demo.test.ts.snap b/components/table/__tests__/__snapshots__/demo.test.ts.snap index e8397ec88b..3094b24626 100644 --- a/components/table/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/table/__tests__/__snapshots__/demo.test.ts.snap @@ -4872,7 +4872,7 @@ exports[`renders components/table/demo/edit-row.tsx correctly 1`] = ` >
@@ -8092,7 +8089,7 @@ exports[`renders components/table/demo/fixed-columns-header.tsx correctly 1`] = >
@@ -9356,7 +9350,7 @@ exports[`renders components/table/demo/fixed-header.tsx correctly 1`] = ` >
@@ -10390,7 +10381,7 @@ exports[`renders components/table/demo/grouping-columns.tsx correctly 1`] = ` >
@@ -12093,7 +12081,7 @@ exports[`renders components/table/demo/narrow.tsx correctly 1`] = ` >
@@ -22713,7 +22698,7 @@ exports[`renders components/table/demo/sticky.tsx correctly 1`] = ` >