@ray-js/lamp-saturation-slider 1.1.7 → 1.1.8-beta-1
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/lib/index.js +5 -3
- package/lib/props.d.ts +12 -0
- package/lib/props.js +3 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -22,7 +22,9 @@ function LampSaturationSlider(props) {
|
|
|
22
22
|
onTouchMove,
|
|
23
23
|
onTouchEnd,
|
|
24
24
|
enableTouch = true,
|
|
25
|
-
max = 1000
|
|
25
|
+
max = 1000,
|
|
26
|
+
useCustomThumbStyle,
|
|
27
|
+
useCustomTrackStyle
|
|
26
28
|
} = props;
|
|
27
29
|
const startRefValue = useRef(-1);
|
|
28
30
|
const endRefValue = useRef(-1);
|
|
@@ -118,7 +120,7 @@ function LampSaturationSlider(props) {
|
|
|
118
120
|
height: `${88}rpx`,
|
|
119
121
|
borderRadius: `${28}rpx`
|
|
120
122
|
}, trackStyle), {}, {
|
|
121
|
-
background: `linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0.01) 0%, rgba(${r}, ${g}, ${b}, 1) 100%)`
|
|
123
|
+
background: useCustomTrackStyle ? trackStyle === null || trackStyle === void 0 ? void 0 : trackStyle.background : `linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0.01) 0%, rgba(${r}, ${g}, ${b}, 1) 100%)`
|
|
122
124
|
})),
|
|
123
125
|
barStyle: toStyle({
|
|
124
126
|
background: 'transparent'
|
|
@@ -130,7 +132,7 @@ function LampSaturationSlider(props) {
|
|
|
130
132
|
borderRadius: '28rpx',
|
|
131
133
|
background: `${disable ? '#000' : 'transparent'}`
|
|
132
134
|
}, thumbStyle)),
|
|
133
|
-
thumbStyleRenderFormatter: {
|
|
135
|
+
thumbStyleRenderFormatter: useCustomThumbStyle ? null : {
|
|
134
136
|
background: `hsl(${props.hue}deg 100% value%)`
|
|
135
137
|
},
|
|
136
138
|
thumbStyleRenderValueScale: 50 / max,
|
package/lib/props.d.ts
CHANGED
|
@@ -64,5 +64,17 @@ export interface IProps {
|
|
|
64
64
|
* @default 1000
|
|
65
65
|
*/
|
|
66
66
|
max?: 100 | 1000;
|
|
67
|
+
/**
|
|
68
|
+
* @description.en useCustomThumbStyle
|
|
69
|
+
* @description.zh 使用自定义按钮样式
|
|
70
|
+
* @default null
|
|
71
|
+
*/
|
|
72
|
+
useCustomThumbStyle?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @description.en useCustomTrackStyle
|
|
75
|
+
* @description.zh 使用自定义滑槽样式
|
|
76
|
+
* @default null
|
|
77
|
+
*/
|
|
78
|
+
useCustomTrackStyle?: boolean;
|
|
67
79
|
}
|
|
68
80
|
export declare const defaultProps: IProps;
|
package/lib/props.js
CHANGED