sun-select-color 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,10 +33,11 @@ import { ColorPicker } from 'sun-select-color'
33
33
  <!-- 方式一:受控,监听 change -->
34
34
  <ColorPicker :color="color" @change="onChange" />
35
35
 
36
- <!-- 方式二:不同颜色集合 -->
36
+ <!-- 方式二:不同颜色集合(支持切换自定义颜色) -->
37
37
  <ColorPicker :color="color" type="colorAll" />
38
38
  <ColorPicker :color="color" type="colorOne" />
39
39
  <ColorPicker :color="color" type="colorTwo" />
40
+ <!-- 在 colorAll/colorOne/colorTwo 模式下,点击面板右侧箭头可在预设颜色和自定义颜色之间切换 -->
40
41
 
41
42
  <!-- 宽高控制(选择框/面板) -->
42
43
  <ColorPicker :color="color" width="280px" height="260px" />
@@ -55,15 +56,15 @@ function onChange(v) { color.value = v }
55
56
 
56
57
  ### 效果预览(不同 type)
57
58
 
58
- - colorAll(默认所有颜色)
59
+ - colorAll(默认所有颜色,支持切换自定义颜色)
59
60
 
60
61
  <img alt="colorAll" src="https://unpkg.com/sun-select-color@latest/public/colorAll.png" width="320" />
61
62
 
62
- - colorOne(黑白与常用灰阶)
63
+ - colorOne(黑白与常用灰阶,支持切换自定义颜色)
63
64
 
64
65
  <img alt="colorOne" src="https://unpkg.com/sun-select-color@latest/public/colorOne.png" width="320" />
65
66
 
66
- - colorTwo(常用彩色/高对比色)
67
+ - colorTwo(常用彩色/高对比色,支持切换自定义颜色)
67
68
 
68
69
  <img alt="colorTwo" src="https://unpkg.com/sun-select-color@latest/public/colorTwo.png" width="320" />
69
70
 
@@ -71,6 +72,10 @@ function onChange(v) { color.value = v }
71
72
 
72
73
  <img alt="customPalette" src="https://unpkg.com/sun-select-color@latest/public/customPalette.png" width="320" />
73
74
 
75
+ ### 新功能:模式切换
76
+
77
+ 在 `colorAll`、`colorOne`、`colorTwo` 三种模式下,颜色面板右侧会显示一个切换箭头。点击箭头可以在预设颜色网格和自定义颜色选择器之间循环切换,方便用户在同一模式下灵活选择颜色。
78
+
74
79
  ### Props
75
80
 
76
81
  - `color` String 默认 颜色表第一个:当前颜色(受控)
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .ssc-color .select[data-v-6b4fe802]{position:relative;width:100%;min-width:200px;height:32px;display:flex;align-items:center;border:1px solid #e0e0ff;border-radius:6px;padding:0 12px;cursor:pointer;box-shadow:0 1px #00000005;font-size:14px}.ssc-color .select[data-v-6b4fe802]:hover{border-color:#4096ff}.swatch[data-v-6b4fe802]{width:16px;height:16px;border-radius:4px;border:1px solid #e0e0e0;margin-right:8px}.label[data-v-6b4fe802]{flex:1;color:#333}.arrow[data-v-6b4fe802]{width:16px;height:16px}.panel[data-v-6b4fe802]{position:absolute;left:0;right:0;top:32px;z-index:1;margin-top:6px;background:#fff;border-radius:8px;box-shadow:0 10px 20px #0000001a;padding:12px;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) transparent}.panel[data-v-6b4fe802]::-webkit-scrollbar{width:3px;height:3px}.panel[data-v-6b4fe802]::-webkit-scrollbar-thumb{background-color:#00000040;border-radius:4px}.panel[data-v-6b4fe802]::-webkit-scrollbar-track{background:transparent}.grid[data-v-6b4fe802]{display:grid;grid-template-columns:repeat(8,1fr);gap:6px}.chip[data-v-6b4fe802]{width:100%;height:26px;border-radius:6px;border:1px solid #fff;cursor:pointer;display:inline-block}.custom-palette[data-v-6b4fe802],.custom-component[data-v-6b4fe802]{width:100%}[data-v-6b4fe802] .vc-sketch{width:100%!important;box-shadow:none!important;padding:0!important}
1
+ .ssc-color .select[data-v-2a24144a]{position:relative;width:100%;min-width:200px;height:32px;display:flex;align-items:center;border:1px solid #e0e0ff;border-radius:6px;padding:0 12px;cursor:pointer;box-shadow:0 1px #00000005;font-size:14px;overflow:visible}.ssc-color .select[data-v-2a24144a]:hover{border-color:#4096ff}.swatch[data-v-2a24144a]{width:16px;height:16px;border-radius:4px;border:1px solid #e0e0e0;margin-right:8px}.label[data-v-2a24144a]{flex:1;color:#333}.arrow[data-v-2a24144a]{width:16px;height:16px}.panel-wrapper[data-v-2a24144a]{position:absolute;left:0;right:0;top:32px;z-index:1;margin-top:6px;overflow:visible}.panel[data-v-2a24144a]{position:relative;background:#fff;border-radius:8px;box-shadow:0 10px 20px #0000001a;padding:12px;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) transparent}.panel[data-v-2a24144a]::-webkit-scrollbar{width:3px;height:3px}.panel[data-v-2a24144a]::-webkit-scrollbar-thumb{background-color:#00000040;border-radius:4px}.panel[data-v-2a24144a]::-webkit-scrollbar-track{background:transparent}.grid[data-v-2a24144a]{display:grid;grid-template-columns:repeat(8,1fr);gap:6px}.chip[data-v-2a24144a]{width:100%;height:26px;border-radius:6px;border:1px solid #fff;cursor:pointer;display:inline-block}.custom-palette[data-v-2a24144a],.custom-component[data-v-2a24144a]{width:100%}.toggle-arrow-container[data-v-2a24144a]{position:absolute;right:-12px;top:50%;transform:translateY(-50%);width:12px;height:40px;background:#fff;border:1px solid #e0e0ff;border-left:none;border-radius:0 10px 10px 0;box-shadow:2px 0 8px #00000014;display:flex;align-items:center;justify-content:center;z-index:2;pointer-events:auto}.toggle-arrow[data-v-2a24144a]{width:100%;height:100%;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .2s ease-in-out;-webkit-user-select:none;user-select:none}.toggle-arrow[data-v-2a24144a]:hover{background-color:#4096ff1a}.toggle-arrow[data-v-2a24144a] svg{width:16px;height:16px;transform:rotate(-90deg);fill:#666;transition:fill .2s ease-in-out}.toggle-arrow[data-v-2a24144a]:hover svg{fill:#4096ff}[data-v-2a24144a] .vc-sketch{width:100%!important;box-shadow:none!important;padding:0!important}