@ray-js/lamp-saturation-slider 1.1.6-beta-2 → 1.1.7

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 CHANGED
@@ -133,7 +133,7 @@ function LampSaturationSlider(props) {
133
133
  thumbStyleRenderFormatter: {
134
134
  background: `hsl(${props.hue}deg 100% value%)`
135
135
  },
136
- thumbStyleRenderValueScale: max === 1000 ? 0.05 : 0.5,
136
+ thumbStyleRenderValueScale: 50 / max,
137
137
  thumbStyleRenderValueStart: 50,
138
138
  thumbStyleRenderValueReverse: true
139
139
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lamp-saturation-slider",
3
- "version": "1.1.6-beta-2",
3
+ "version": "1.1.7",
4
4
  "description": "照明色温Slider",
5
5
  "main": "lib/index",
6
6
  "files": [
package/README-zh_CN.md DELETED
@@ -1,95 +0,0 @@
1
- [English](./README.md) | 简体中文
2
-
3
- # @ray-js/lamp-saturation-slider
4
-
5
- > 照明饱和度 Slider
6
-
7
- ## 安装
8
-
9
- ```sh
10
- $ npm install @ray-js/components-ty-lamp
11
- // 或者
12
- $ yarn add @ray-js/components-ty-lamp
13
- ```
14
-
15
- ## 使用
16
-
17
- ```ts
18
- // 属性
19
- export interface IProps {
20
- /**
21
- * @description.zh 禁止滑动
22
- * @description.en Ban sliding
23
- * @default false
24
- */
25
- disable?: boolean;
26
- /**
27
- * @description.zh 滑动槽样式
28
- * @description.en
29
- * @default {}
30
- */
31
- trackStyle?: React.CSSProperties;
32
- /**
33
- * @description.zh slider值
34
- * @description.en slider value
35
- * @default 0
36
- */
37
- value: number;
38
- /**
39
- * @description.zh slider 展示的颜色值 对应hsv的hue
40
- * @description.en slider value
41
- * @default 0
42
- */
43
- hue: number; // 0 - 359
44
- /**
45
- * @description.zh slider 手指点击时触发
46
- * @description.en slider Value changes
47
- * @default () => {}
48
- */
49
- onTouchStart?: (value: number) => void;
50
- /**
51
- * @description.zh slider 手指拖动时触发
52
- * @description.en slider Value changes
53
- * @default () => {}
54
- */
55
- onTouchMove?: (value: number) => void;
56
- /**
57
- * @description.zh slider 手指离开时触发
58
- * @description.en Values change after the trigger
59
- * @default () => {}
60
- */
61
- onTouchEnd?: (value: number) => void;
62
- }
63
-
64
- export const defaultProps: IProps = {
65
- value: 0,
66
- onTouchStart: () => null,
67
- onTouchMove: () => null,
68
- onTouchEnd: () => null,
69
- };
70
- ```
71
-
72
- ```tsx
73
- import { LampSaturationSlider } from '@ray-js/components-ty-lamp';
74
-
75
- export default () => {
76
- const [saturation, setSaturation] = useState(100);
77
-
78
- useEffect(() => {
79
- // 模拟dp上报
80
- setTimeout(() => {
81
- setSaturation(321);
82
- }, 3000);
83
- }, []);
84
-
85
- return (
86
- <LampSaturationSlider
87
- hue={100}
88
- value={saturation}
89
- onTouchEnd={val => {
90
- setSaturation(val);
91
- }}
92
- />
93
- );
94
- };
95
- ```