From ed127e941879fe5bb083b57806d063d0fbebcb8e Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 19 Apr 2024 17:17:56 +0800 Subject: [PATCH] feat: Carousel support arrows for switching (#48542) * feat: Carousel support arrows function * fix: order matters * feat: Carousel support arrows in vertical mode * chore: update snapshot * Apply suggestions from code review Signed-off-by: afc163 * chore: fix lint * chore: fix lint * chore: dotMargin => dotGap --------- Signed-off-by: afc163 --- .../__snapshots__/demo-extend.test.ts.snap | 311 ++++++++++++++++ .../__tests__/__snapshots__/demo.test.ts.snap | 304 +++++++++++++++ components/carousel/demo/arrows.md | 7 + components/carousel/demo/arrows.tsx | 47 +++ components/carousel/index.en-US.md | 2 + components/carousel/index.tsx | 4 + components/carousel/index.zh-CN.md | 2 + components/carousel/style/index.ts | 347 +++++++++++------- components/date-picker/style/panel.ts | 12 +- 9 files changed, 887 insertions(+), 149 deletions(-) create mode 100644 components/carousel/demo/arrows.md create mode 100644 components/carousel/demo/arrows.tsx diff --git a/components/carousel/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/carousel/__tests__/__snapshots__/demo-extend.test.ts.snap index 80ef71c3ff..ebe3c3c045 100644 --- a/components/carousel/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/carousel/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1,5 +1,316 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`renders components/carousel/demo/arrows.tsx extend context correctly 1`] = ` +Array [ + , +
, + , +] +`; + +exports[`renders components/carousel/demo/arrows.tsx extend context correctly 2`] = ` +[ + "Warning: React does not recognize the \`%s\` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase \`%s\` instead. If you accidentally passed it from a parent component, remove it from the DOM element.%s", +] +`; + exports[`renders components/carousel/demo/autoplay.tsx extend context correctly 1`] = ` , +
, + , +] +`; + exports[`renders components/carousel/demo/autoplay.tsx correctly 1`] = `