@ray-js/lamp-saturation-slider 1.1.6 → 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 +8 -5
- package/lib/props.d.ts +18 -0
- package/lib/props.js +5 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -21,7 +21,10 @@ function LampSaturationSlider(props) {
|
|
|
21
21
|
onTouchStart,
|
|
22
22
|
onTouchMove,
|
|
23
23
|
onTouchEnd,
|
|
24
|
-
enableTouch = true
|
|
24
|
+
enableTouch = true,
|
|
25
|
+
max = 1000,
|
|
26
|
+
useCustomThumbStyle,
|
|
27
|
+
useCustomTrackStyle
|
|
25
28
|
} = props;
|
|
26
29
|
const startRefValue = useRef(-1);
|
|
27
30
|
const endRefValue = useRef(-1);
|
|
@@ -48,7 +51,7 @@ function LampSaturationSlider(props) {
|
|
|
48
51
|
}, /*#__PURE__*/React.createElement(Slider, {
|
|
49
52
|
instanceId: props.instanceId || instanceId.current,
|
|
50
53
|
min: 0,
|
|
51
|
-
max:
|
|
54
|
+
max: max,
|
|
52
55
|
disable: disable,
|
|
53
56
|
end: controllerSaturation,
|
|
54
57
|
enableTouch: enableTouch,
|
|
@@ -117,7 +120,7 @@ function LampSaturationSlider(props) {
|
|
|
117
120
|
height: `${88}rpx`,
|
|
118
121
|
borderRadius: `${28}rpx`
|
|
119
122
|
}, trackStyle), {}, {
|
|
120
|
-
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%)`
|
|
121
124
|
})),
|
|
122
125
|
barStyle: toStyle({
|
|
123
126
|
background: 'transparent'
|
|
@@ -129,10 +132,10 @@ function LampSaturationSlider(props) {
|
|
|
129
132
|
borderRadius: '28rpx',
|
|
130
133
|
background: `${disable ? '#000' : 'transparent'}`
|
|
131
134
|
}, thumbStyle)),
|
|
132
|
-
thumbStyleRenderFormatter: {
|
|
135
|
+
thumbStyleRenderFormatter: useCustomThumbStyle ? null : {
|
|
133
136
|
background: `hsl(${props.hue}deg 100% value%)`
|
|
134
137
|
},
|
|
135
|
-
thumbStyleRenderValueScale:
|
|
138
|
+
thumbStyleRenderValueScale: 50 / max,
|
|
136
139
|
thumbStyleRenderValueStart: 50,
|
|
137
140
|
thumbStyleRenderValueReverse: true
|
|
138
141
|
}));
|
package/lib/props.d.ts
CHANGED
|
@@ -58,5 +58,23 @@ export interface IProps {
|
|
|
58
58
|
* @default true
|
|
59
59
|
*/
|
|
60
60
|
enableTouch?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* @description.en Maximum color temperature
|
|
63
|
+
* @description.zh 最大色温
|
|
64
|
+
* @default 1000
|
|
65
|
+
*/
|
|
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;
|
|
61
79
|
}
|
|
62
80
|
export declare const defaultProps: IProps;
|
package/lib/props.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/lamp-saturation-slider",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8-beta-1",
|
|
4
4
|
"description": "照明色温Slider",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"files": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@ray-js/components-ty-slider": "^0.2.
|
|
63
|
+
"@ray-js/components-ty-slider": "^0.2.52"
|
|
64
64
|
},
|
|
65
65
|
"maintainers": [
|
|
66
66
|
{
|