From f45d57720a14842bfeaf1d8e289752ec03c61b4f Mon Sep 17 00:00:00 2001 From: novlan1 <1576271227@qq.com> Date: Mon, 17 Feb 2025 18:16:17 +0800 Subject: [PATCH 1/3] feat(color-picker): add color-picker --- site/docs.config.js | 8 + .../__test__/__snapshots__/demo.test.jsx.snap | 1666 +++++++++++++++++ src/color-picker/__test__/demo.test.jsx | 27 + src/color-picker/color-picker.en-US.md | 32 + src/color-picker/color-picker.md | 32 + src/color-picker/color-picker.tsx | 404 ++++ src/color-picker/constants.js | 2 + src/color-picker/demos/base.vue | 8 + src/color-picker/demos/format.vue | 83 + src/color-picker/demos/mobile.vue | 25 + src/color-picker/demos/multiple.vue | 12 + src/color-picker/demos/use-popup.vue | 14 + src/color-picker/helper.ts | 47 + src/color-picker/index.ts | 12 + src/color-picker/props.ts | 79 + src/color-picker/style/css.js | 1 + src/color-picker/style/index.js | 1 + src/color-picker/type.ts | 118 ++ src/components.ts | 1 + 19 files changed, 2572 insertions(+) create mode 100644 src/color-picker/__test__/__snapshots__/demo.test.jsx.snap create mode 100644 src/color-picker/__test__/demo.test.jsx create mode 100644 src/color-picker/color-picker.en-US.md create mode 100644 src/color-picker/color-picker.md create mode 100644 src/color-picker/color-picker.tsx create mode 100644 src/color-picker/constants.js create mode 100644 src/color-picker/demos/base.vue create mode 100644 src/color-picker/demos/format.vue create mode 100644 src/color-picker/demos/mobile.vue create mode 100644 src/color-picker/demos/multiple.vue create mode 100644 src/color-picker/demos/use-popup.vue create mode 100644 src/color-picker/helper.ts create mode 100644 src/color-picker/index.ts create mode 100644 src/color-picker/props.ts create mode 100644 src/color-picker/style/css.js create mode 100644 src/color-picker/style/index.js create mode 100644 src/color-picker/type.ts diff --git a/site/docs.config.js b/site/docs.config.js index 06a28ac97..d3ad11aff 100644 --- a/site/docs.config.js +++ b/site/docs.config.js @@ -200,6 +200,14 @@ export const docs = [ component: () => import('@/checkbox/checkbox.md'), componentEn: () => import('@/checkbox/checkbox.en-US.md'), }, + { + title: 'ColorPicker 颜色选择器', + titleEn: 'ColorPicker', + name: 'color-picker', + path: '/mobile-vue/components/color-picker', + component: () => import('@/color-picker/color-picker.md'), + componentEn: () => import('@/color-picker/color-picker.en-US.md'), + }, { title: 'Input 输入框', titleEn: 'Input', diff --git a/src/color-picker/__test__/__snapshots__/demo.test.jsx.snap b/src/color-picker/__test__/__snapshots__/demo.test.jsx.snap new file mode 100644 index 000000000..227f4a556 --- /dev/null +++ b/src/color-picker/__test__/__snapshots__/demo.test.jsx.snap @@ -0,0 +1,1666 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ColorPicker > ColorPicker baseVue demo works fine 1`] = ` +
+ 用于颜色选择,支持多种格式。 +
++ 基础颜色选择器 +
++ 带色板的颜色选择器 +
++ 弹窗形式的颜色选择器 +
++ 组件模式选择 +
+用于颜色选择,支持多种格式。
+